[Mesa-dev] [PATCH 2/4] radeonsi: fix gl_PrimitiveIDIn in geometry shader when using tessellation

Nicolai Hähnle nhaehnle at gmail.com
Mon May 15 09:18:36 UTC 2017


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

This builds on commit 0549ea15ec38 ("radeonsi: fix primitive ID in
fragment shader when using tessellation").

Fixes piglit
arb_tessellation_shader/execution/gs-primitiveid-instanced.shader_test

Cc: 17.1 <mesa-stable at lists.freedesktop.org>
---
 src/gallium/drivers/radeonsi/si_state_shaders.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index 5da6014..f761073 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -2126,20 +2126,22 @@ static void si_bind_vs_shader(struct pipe_context *ctx, void *state)
 	r600_update_vs_writes_viewport_index(&sctx->b, si_get_vs_info(sctx));
 }
 
 static void si_update_tcs_tes_uses_prim_id(struct si_context *sctx)
 {
 	sctx->ia_multi_vgt_param_key.u.tcs_tes_uses_prim_id =
 		(sctx->tes_shader.cso &&
 		 sctx->tes_shader.cso->info.uses_primid) ||
 		(sctx->tcs_shader.cso &&
 		 sctx->tcs_shader.cso->info.uses_primid) ||
+		(sctx->gs_shader.cso &&
+		 sctx->gs_shader.cso->info.uses_primid) ||
 		(sctx->ps_shader.cso && !sctx->gs_shader.cso &&
 		 sctx->ps_shader.cso->info.uses_primid);
 }
 
 static void si_bind_gs_shader(struct pipe_context *ctx, void *state)
 {
 	struct si_context *sctx = (struct si_context *)ctx;
 	struct si_shader_selector *sel = state;
 	bool enable_changed = !!sctx->gs_shader.cso != !!sel;
 
-- 
2.9.3



More information about the mesa-dev mailing list