r600: bind geometry shader ring to the correct place
authorDave Airlie <airlied@redhat.com>
Mon, 30 Nov 2015 05:07:34 +0000 (15:07 +1000)
committerDave Airlie <airlied@redhat.com>
Sun, 6 Dec 2015 23:59:00 +0000 (09:59 +1000)
When tess/gs are enabled, the geom shader ring needs
to bind to the tess eval not the vertex shader.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/r600_state_common.c

index bf2f10986e83160f5306921ac89f2743ddf8d474..1a18e695fa807f0f4ba36514bba2b79d9ccea840 100644 (file)
@@ -1354,13 +1354,20 @@ static void update_gs_block_state(struct r600_context *rctx, unsigned enable)
                if (enable) {
                        r600_set_constant_buffer(&rctx->b.b, PIPE_SHADER_GEOMETRY,
                                        R600_GS_RING_CONST_BUFFER, &rctx->gs_rings.esgs_ring);
-                       r600_set_constant_buffer(&rctx->b.b, PIPE_SHADER_VERTEX,
-                                       R600_GS_RING_CONST_BUFFER, &rctx->gs_rings.gsvs_ring);
+                       if (rctx->tes_shader) {
+                               r600_set_constant_buffer(&rctx->b.b, PIPE_SHADER_TESS_EVAL,
+                                                        R600_GS_RING_CONST_BUFFER, &rctx->gs_rings.gsvs_ring);
+                       } else {
+                               r600_set_constant_buffer(&rctx->b.b, PIPE_SHADER_VERTEX,
+                                                        R600_GS_RING_CONST_BUFFER, &rctx->gs_rings.gsvs_ring);
+                       }
                } else {
                        r600_set_constant_buffer(&rctx->b.b, PIPE_SHADER_GEOMETRY,
                                        R600_GS_RING_CONST_BUFFER, NULL);
                        r600_set_constant_buffer(&rctx->b.b, PIPE_SHADER_VERTEX,
                                        R600_GS_RING_CONST_BUFFER, NULL);
+                       r600_set_constant_buffer(&rctx->b.b, PIPE_SHADER_TESS_EVAL,
+                                       R600_GS_RING_CONST_BUFFER, NULL);
                }
        }
 }