Commit b6531649 authored by Timur Kristóf's avatar Timur Kristóf Committed by Marge Bot
Browse files

radv: Fix gs_vgpr_comp_cnt for NGG culling in vertex shaders.

Previously these shaders always took the path to gs_vgpr_comp_cnt=3,
but now they are 0 when they don't use primitive id.

Fixes: 7ad69e2f

Signed-off-by: Timur Kristóf's avatarTimur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset's avatarSamuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <mesa/mesa!13031>
parent 240e60ba
Pipeline #409022 waiting for manual action with stages
...@@ -1291,13 +1291,14 @@ radv_postprocess_config(const struct radv_device *device, const struct ac_shader ...@@ -1291,13 +1291,14 @@ radv_postprocess_config(const struct radv_device *device, const struct ac_shader
} else } else
unreachable("Unexpected ES shader stage"); unreachable("Unexpected ES shader stage");
bool nggc = info->has_ngg_culling; /* Culling uses GS vertex offsets 0, 1, 2. */
bool tes_triangles = bool tes_triangles =
stage == MESA_SHADER_TESS_EVAL && info->tes.primitive_mode >= 4; /* GL_TRIANGLES */ stage == MESA_SHADER_TESS_EVAL && info->tes.primitive_mode >= 4; /* GL_TRIANGLES */
if (info->uses_invocation_id) { if (info->uses_invocation_id) {
gs_vgpr_comp_cnt = 3; /* VGPR3 contains InvocationID. */ gs_vgpr_comp_cnt = 3; /* VGPR3 contains InvocationID. */
} else if (info->uses_prim_id) { } else if (info->uses_prim_id) {
gs_vgpr_comp_cnt = 2; /* VGPR2 contains PrimitiveID. */ gs_vgpr_comp_cnt = 2; /* VGPR2 contains PrimitiveID. */
} else if (info->gs.vertices_in >= 3 || tes_triangles) { } else if (info->gs.vertices_in >= 3 || tes_triangles || nggc) {
gs_vgpr_comp_cnt = 1; /* VGPR1 contains offsets 2, 3 */ gs_vgpr_comp_cnt = 1; /* VGPR1 contains offsets 2, 3 */
} else { } else {
gs_vgpr_comp_cnt = 0; /* VGPR0 contains offsets 0, 1 */ gs_vgpr_comp_cnt = 0; /* VGPR0 contains offsets 0, 1 */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment