[Mesa-dev] [PATCH 4/9] radv/gfx10: Use correct ES shader for es_vgpr_comp_cnt for GS.

Samuel Pitoiset samuel.pitoiset at gmail.com
Thu Jul 11 06:44:15 UTC 2019


From: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/amd/vulkan/radv_shader.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index 79418b401fb..1987d439612 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -796,11 +796,14 @@ static void radv_postprocess_config(const struct radv_physical_device *pdevice,
 	if (pdevice->rad_info.chip_class >= GFX10 &&
 	    (stage == MESA_SHADER_VERTEX || stage == MESA_SHADER_TESS_EVAL || stage == MESA_SHADER_GEOMETRY)) {
 		unsigned gs_vgpr_comp_cnt, es_vgpr_comp_cnt;
+		gl_shader_stage es_stage = stage;
+		if (stage == MESA_SHADER_GEOMETRY)
+			es_stage = info->gs.es_type;
 
 		/* VGPR5-8: (VertexID, UserVGPR0, UserVGPR1, UserVGPR2 / InstanceID) */
-		if (stage == MESA_SHADER_VERTEX) {
+		if (es_stage == MESA_SHADER_VERTEX) {
 			es_vgpr_comp_cnt = info->info.vs.needs_instance_id ? 3 : 0;
-		} else if (stage == MESA_SHADER_TESS_EVAL) {
+		} else if (es_stage == MESA_SHADER_TESS_EVAL) {
 			bool enable_prim_id = info->tes.export_prim_id || info->info.uses_prim_id;
 			es_vgpr_comp_cnt = enable_prim_id ? 3 : 2;
 		}
-- 
2.22.0



More information about the mesa-dev mailing list