From 7e664a538355018a16ef60ecf8aaef304a25aa59 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timur=20Krist=C3=B3f?= Date: Mon, 31 May 2021 17:43:23 +0200 Subject: [PATCH] radv: Don't generate GS copy shader when the pipeline has NGG. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Previously the code used radv_pipeline_has_ngg but that always returned false because the pipeline->shaders was all NULL at the time when the GS copy shader was created. Fixes: ca783612e721bc66af545075d76dc578ddbf7666 Signed-off-by: Timur Kristóf Reviewed-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_pipeline.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index 141183c..64c6afa 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -3363,8 +3363,10 @@ radv_create_shaders(struct radv_pipeline *pipeline, struct radv_device *device, radv_fill_shader_keys(device, keys, pipeline_key, nir); radv_fill_shader_info(pipeline, pStages, keys, infos, nir); - if ((nir[MESA_SHADER_VERTEX] && keys[MESA_SHADER_VERTEX].vs_common_out.as_ngg) || - (nir[MESA_SHADER_TESS_EVAL] && keys[MESA_SHADER_TESS_EVAL].vs_common_out.as_ngg)) { + bool pipeline_has_ngg = (nir[MESA_SHADER_VERTEX] && keys[MESA_SHADER_VERTEX].vs_common_out.as_ngg) || + (nir[MESA_SHADER_TESS_EVAL] && keys[MESA_SHADER_TESS_EVAL].vs_common_out.as_ngg); + + if (pipeline_has_ngg) { struct gfx10_ngg_info *ngg_info; if (nir[MESA_SHADER_GEOMETRY]) @@ -3512,7 +3514,7 @@ radv_create_shaders(struct radv_pipeline *pipeline, struct radv_device *device, if (modules[MESA_SHADER_GEOMETRY]) { struct radv_shader_binary *gs_copy_binary = NULL; - if (!radv_pipeline_has_ngg(pipeline)) { + if (!pipeline_has_ngg) { struct radv_shader_info info = {0}; struct radv_shader_variant_key key = {0}; -- 2.7.4