aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2020-01-03 21:16:22 -0500
committerMarek Olšák <[email protected]>2020-01-20 16:16:11 -0500
commit41fef6fc09b9e8913dc0cf6e926fa109c680f9c2 (patch)
tree15076b31cbc853eecedaea1906d017678cbab760
parent943d131e7db4147113ac204e99382a18ce3fc99d (diff)
radeonsi/gfx10: don't initialize VGPRs not used by NGG passthrough
v2: TES doesn't use the GS PrimitiveID Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
-rw-r--r--src/gallium/drivers/radeonsi/si_state_shaders.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index 96e6f88bb57..6b2b9e15890 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -1160,11 +1160,13 @@ static void gfx10_shader_ngg(struct si_screen *sscreen, struct si_shader *shader
* pass edge flags for decomposed primitives (such as quads) to the PA
* for the GL_LINE polygon mode to skip rendering lines on inner edges.
*/
- if (gs_info->uses_invocationid || gs_type == PIPE_SHADER_VERTEX)
+ if (gs_info->uses_invocationid ||
+ (gs_type == PIPE_SHADER_VERTEX && !gfx10_is_ngg_passthrough(shader)))
gs_vgpr_comp_cnt = 3; /* VGPR3 contains InvocationID, edge flags. */
- else if (gs_info->uses_primid)
+ else if ((gs_type == PIPE_SHADER_GEOMETRY && gs_info->uses_primid) ||
+ (gs_type == PIPE_SHADER_VERTEX && shader->key.mono.u.vs_export_prim_id))
gs_vgpr_comp_cnt = 2; /* VGPR2 contains PrimitiveID. */
- else if (input_prim >= PIPE_PRIM_TRIANGLES)
+ else if (input_prim >= PIPE_PRIM_TRIANGLES && !gfx10_is_ngg_passthrough(shader))
gs_vgpr_comp_cnt = 1; /* VGPR1 contains offsets 2, 3 */
else
gs_vgpr_comp_cnt = 0; /* VGPR0 contains offsets 0, 1 */