gallium: clarify reference counting for fence
authorRob Clark <robclark@freedesktop.org>
Wed, 8 Jul 2015 19:00:51 +0000 (15:00 -0400)
committerRob Clark <robclark@freedesktop.org>
Fri, 10 Jul 2015 15:57:30 +0000 (11:57 -0400)
Nowhere was it spelled out that the state tracker may expect the pipe
driver to unref the old fence.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/include/pipe/p_context.h

index c2eedf8e7c72c6604337c4da5007964beb51d049..d2c2e4c8d144681f7b9b65ad6d4123f8e9b55746 100644 (file)
@@ -361,8 +361,14 @@ struct pipe_context {
                         const void *clear_value,
                         int clear_value_size);
 
-   /** Flush draw commands
+   /**
+    * Flush draw commands
+    *
+    * NOTE: use screen->fence_reference() (or equivalent) to transfer
+    * new fence ref to **fence, to ensure that previous fence is unref'd
     *
+    * \param fence  if not NULL, an old fence to unref and transfer a
+    *    new fence reference to
     * \param flags  bitfield of enum pipe_flush_flags values.
     */
    void (*flush)(struct pipe_context *pipe,