Module: Mesa
Branch: master
Commit: 0da7b3b18bc51ba539a5204058963dbb945c027b
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0da7b3b18bc51ba539a5204058963dbb945c027b

Author: Rhys Perry <[email protected]>
Date:   Fri Sep 20 13:45:42 2019 +0100

radv: move gs copy shader creation before other variants

ACO lowers output derefs which breaks the shader_info pass used by gs copy
shader creation.

v3: rebase

Signed-off-by: Rhys Perry <[email protected]>
Reviewed-by: Daniel Schürmann <[email protected]>
Reviewed-by: Samuel Pitoiset <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2421>

---

 src/amd/vulkan/radv_pipeline.c | 72 +++++++++++++++++++++---------------------
 1 file changed, 36 insertions(+), 36 deletions(-)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index eaedc023873..588a249ad50 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -2863,6 +2863,42 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
                gfx9_get_gs_info(key, pipeline, nir, infos, gs_info);
        }
 
+       if(modules[MESA_SHADER_GEOMETRY]) {
+               struct radv_shader_binary *gs_copy_binary = NULL;
+               if (!pipeline->gs_copy_shader &&
+                   !radv_pipeline_has_ngg(pipeline)) {
+                       struct radv_shader_info info = {};
+                       struct radv_shader_variant_key key = {};
+
+                       key.has_multiview_view_index =
+                               
keys[MESA_SHADER_GEOMETRY].has_multiview_view_index;
+
+                       radv_nir_shader_info_pass(nir[MESA_SHADER_GEOMETRY],
+                                                 pipeline->layout, &key,
+                                                 &info);
+                       info.wave_size = 64; /* Wave32 not supported. */
+
+                       pipeline->gs_copy_shader = radv_create_gs_copy_shader(
+                                       device, nir[MESA_SHADER_GEOMETRY], 
&info,
+                                       &gs_copy_binary, keep_executable_info,
+                                       
keys[MESA_SHADER_GEOMETRY].has_multiview_view_index);
+               }
+
+               if (!keep_executable_info && pipeline->gs_copy_shader) {
+                       struct radv_shader_binary *binaries[MESA_SHADER_STAGES] 
= {NULL};
+                       struct radv_shader_variant 
*variants[MESA_SHADER_STAGES] = {0};
+
+                       binaries[MESA_SHADER_GEOMETRY] = gs_copy_binary;
+                       variants[MESA_SHADER_GEOMETRY] = 
pipeline->gs_copy_shader;
+
+                       radv_pipeline_cache_insert_shaders(device, cache,
+                                                          gs_copy_hash,
+                                                          variants,
+                                                          binaries);
+               }
+               free(gs_copy_binary);
+       }
+
        if (nir[MESA_SHADER_FRAGMENT]) {
                if (!pipeline->shaders[MESA_SHADER_FRAGMENT]) {
                        
radv_start_feedback(stage_feedbacks[MESA_SHADER_FRAGMENT]);
@@ -2938,42 +2974,6 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
                }
        }
 
-       if(modules[MESA_SHADER_GEOMETRY]) {
-               struct radv_shader_binary *gs_copy_binary = NULL;
-               if (!pipeline->gs_copy_shader &&
-                   !radv_pipeline_has_ngg(pipeline)) {
-                       struct radv_shader_info info = {};
-                       struct radv_shader_variant_key key = {};
-
-                       key.has_multiview_view_index =
-                               
keys[MESA_SHADER_GEOMETRY].has_multiview_view_index;
-
-                       radv_nir_shader_info_pass(nir[MESA_SHADER_GEOMETRY],
-                                                 pipeline->layout, &key,
-                                                 &info);
-                       info.wave_size = 64; /* Wave32 not supported. */
-
-                       pipeline->gs_copy_shader = radv_create_gs_copy_shader(
-                                       device, nir[MESA_SHADER_GEOMETRY], 
&info,
-                                       &gs_copy_binary, keep_executable_info,
-                                       
keys[MESA_SHADER_GEOMETRY].has_multiview_view_index);
-               }
-
-               if (!keep_executable_info && pipeline->gs_copy_shader) {
-                       struct radv_shader_binary *binaries[MESA_SHADER_STAGES] 
= {NULL};
-                       struct radv_shader_variant 
*variants[MESA_SHADER_STAGES] = {0};
-
-                       binaries[MESA_SHADER_GEOMETRY] = gs_copy_binary;
-                       variants[MESA_SHADER_GEOMETRY] = 
pipeline->gs_copy_shader;
-
-                       radv_pipeline_cache_insert_shaders(device, cache,
-                                                          gs_copy_hash,
-                                                          variants,
-                                                          binaries);
-               }
-               free(gs_copy_binary);
-       }
-
        if (!keep_executable_info) {
                radv_pipeline_cache_insert_shaders(device, cache, hash, 
pipeline->shaders,
                                                   binaries);

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to