radv: Set active_stages the same whether or not shaders were cached
authorAlex Smith <asmith@feralinteractive.com>
Thu, 31 May 2018 14:02:32 +0000 (15:02 +0100)
committerAlex Smith <asmith@feralinteractive.com>
Fri, 1 Jun 2018 07:53:01 +0000 (08:53 +0100)
With GFX9 merged shaders, active_stages would be set to the original
stages specified if shaders were not cached, but to the stages still
present after merging if they were.

Be consistent and use the original stages.

Signed-off-by: Alex Smith <asmith@feralinteractive.com>
Cc: "18.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_pipeline.c

index 03911471c844827500996690b76b2c0f517fbdaf..7a44544f44e5be07e0519c838eb447cc862f0fff 100644 (file)
@@ -1964,6 +1964,8 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
                                _mesa_sha1_compute(modules[i]->nir->info.name,
                                                   strlen(modules[i]->nir->info.name),
                                                   modules[i]->sha1);
+
+                       pipeline->active_stages |= mesa_to_vk_shader_stage(i);
                }
        }
 
@@ -1979,10 +1981,6 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
 
        if (radv_create_shader_variants_from_pipeline_cache(device, cache, hash, pipeline->shaders) &&
            (!modules[MESA_SHADER_GEOMETRY] || pipeline->gs_copy_shader)) {
-               for (unsigned i = 0; i < MESA_SHADER_STAGES; ++i) {
-                       if (pipeline->shaders[i])
-                               pipeline->active_stages |= mesa_to_vk_shader_stage(i);
-               }
                return;
        }
 
@@ -2015,7 +2013,6 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
                                                    stage ? stage->pName : "main", i,
                                                    stage ? stage->pSpecializationInfo : NULL,
                                                    flags);
-               pipeline->active_stages |= mesa_to_vk_shader_stage(i);
 
                /* We don't want to alter meta shaders IR directly so clone it
                 * first.