radeonsi: fix scratch buffer setup for geometry shaders
authorMarek Olšák <marek.olsak@amd.com>
Mon, 18 May 2015 12:56:34 +0000 (14:56 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 26 May 2015 10:42:37 +0000 (12:42 +0200)
Cc: 10.6 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeonsi/si_state_shaders.c

index 25811ab413dd09a1388fc8b77582f96357c82df0..610af948f1223972c5add2bbed7a6f446e2fb27e 100644 (file)
@@ -841,8 +841,15 @@ static void si_update_spi_tmpring_size(struct si_context *sctx)
                        si_pm4_bind_state(sctx, ps, sctx->ps_shader->current->pm4);
                if (si_update_scratch_buffer(sctx, sctx->gs_shader))
                        si_pm4_bind_state(sctx, gs, sctx->gs_shader->current->pm4);
-               if (si_update_scratch_buffer(sctx, sctx->vs_shader))
-                       si_pm4_bind_state(sctx, vs, sctx->vs_shader->current->pm4);
+
+               /* VS can be bound as ES or VS. */
+               if (sctx->gs_shader) {
+                       if (si_update_scratch_buffer(sctx, sctx->vs_shader))
+                               si_pm4_bind_state(sctx, es, sctx->vs_shader->current->pm4);
+               } else {
+                       if (si_update_scratch_buffer(sctx, sctx->vs_shader))
+                               si_pm4_bind_state(sctx, vs, sctx->vs_shader->current->pm4);
+               }
        }
 
        /* The LLVM shader backend should be reporting aligned scratch_sizes. */