panfrost: Delay payloads[].offset_start initialization
authorBoris Brezillon <boris.brezillon@collabora.com>
Thu, 5 Sep 2019 19:01:20 +0000 (21:01 +0200)
committerBoris Brezillon <boris.brezillon@collabora.com>
Fri, 13 Sep 2019 14:25:06 +0000 (16:25 +0200)
panfrost_draw_vbo() Might call the primeconvert/without_prim_restart
helpers which will enter the ->draw_vbo() again. Let's delay
payloads[].offset_start initialization so we don't initialize them
twice.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
src/gallium/drivers/panfrost/pan_context.c

index 745d42e314f46fcc94e815484dcebb23ff35f7b8..de11dae0fc2113cc10190bd566a1736f043c151e 100644 (file)
@@ -1577,9 +1577,6 @@ panfrost_draw_vbo(
         if (panfrost_scissor_culls_everything(ctx))
                 return;
 
-        ctx->payloads[PIPE_SHADER_VERTEX].offset_start = info->start;
-        ctx->payloads[PIPE_SHADER_FRAGMENT].offset_start = info->start;
-
         int mode = info->mode;
 
         /* Fallback unsupported restart index */
@@ -1610,6 +1607,9 @@ panfrost_draw_vbo(
                 }
         }
 
+        ctx->payloads[PIPE_SHADER_VERTEX].offset_start = info->start;
+        ctx->payloads[PIPE_SHADER_FRAGMENT].offset_start = info->start;
+
         /* Now that we have a guaranteed terminating path, find the job.
          * Assignment commented out to prevent unused warning */