radeonsi: emit rw_buffers for tes_shader only if tes_shader present
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 22 Jan 2016 22:50:06 +0000 (17:50 -0500)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 25 Jan 2016 15:16:08 +0000 (10:16 -0500)
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_descriptors.c

index d157a9ffb008b04e87912a6ca1116c88b59dfd22..aad836d819bae230e6e4032a80e9aed19767ca48 100644 (file)
@@ -978,9 +978,11 @@ void si_emit_shader_userdata(struct si_context *sctx, struct r600_atom *atom)
                si_emit_shader_pointer(sctx, &sctx->const_buffers[i].desc, vs_base, true);
                si_emit_shader_pointer(sctx, &sctx->rw_buffers[i].desc, vs_base, true);
 
-               /* The TESSEVAL shader needs this for the ESGS ring buffer. */
-               si_emit_shader_pointer(sctx, &sctx->rw_buffers[i].desc,
-                                      R_00B330_SPI_SHADER_USER_DATA_ES_0, true);
+               if (sctx->tes_shader.cso) {
+                       /* The TESSEVAL shader needs this for the ESGS ring buffer. */
+                       si_emit_shader_pointer(sctx, &sctx->rw_buffers[i].desc,
+                                              R_00B330_SPI_SHADER_USER_DATA_ES_0, true);
+               }
        } else if (sctx->tes_shader.cso) {
                /* The TESSEVAL shader needs this for streamout. */
                si_emit_shader_pointer(sctx, &sctx->rw_buffers[PIPE_SHADER_VERTEX].desc,