gallium/u_threaded: properly initialize fence unflushed tokens
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 10 Nov 2017 10:28:28 +0000 (11:28 +0100)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 20 Nov 2017 17:15:56 +0000 (18:15 +0100)
This got lost in a rebase but never hurt anything because we happened
to always sync in fence_finish anyway...

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/util/u_threaded_context.c

index d0a8ffbd11af90d1f3f9b47e457aac636d507a1a..84fbb224533b7148266bb211ae6beef1ed356ac2 100644 (file)
@@ -1931,7 +1931,6 @@ tc_flush(struct pipe_context *_pipe, struct pipe_fence_handle **fence,
 
    if (async && tc->create_fence) {
       if (fence) {
-         struct tc_unflushed_batch_token *token = NULL;
          struct tc_batch *next = &tc->batch_slots[tc->next];
 
          if (!next->token) {
@@ -1943,7 +1942,7 @@ tc_flush(struct pipe_context *_pipe, struct pipe_fence_handle **fence,
             next->token->tc = tc;
          }
 
-         screen->fence_reference(screen, fence, tc->create_fence(pipe, token));
+         screen->fence_reference(screen, fence, tc->create_fence(pipe, next->token));
          if (!*fence)
             goto out_of_memory;
       }