radv: Don't generate GS copy shader when the pipeline has NGG.

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: ca783612e7
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11092>
This commit is contained in:
Timur Kristóf
2021-05-31 17:43:23 +02:00
committed by Marge Bot
parent 93b1089d19
commit 7e664a5383

View File

@@ -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};