Mesa (master): radv: move a few passes to after load/store vectorization

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Nov 4 12:08:03 UTC 2020


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

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Thu Oct 29 11:21:42 2020 +0000

radv: move a few passes to after load/store vectorization

load/store vectorization can create 8/16-bit alu to do packing/unpacking,
which would make shader_info::bit_sizes_used out of date.

Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Daniel Schürmann <daniel at schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4791>

---

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

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index fdeeffd90c6..75858298a66 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -3101,9 +3101,6 @@ VkResult radv_create_shaders(struct radv_pipeline *pipeline,
 		if (nir[i]) {
 			radv_start_feedback(stage_feedbacks[i]);
 
-			/* do this again since information such as outputs_read can be out-of-date */
-			nir_shader_gather_info(nir[i], nir_shader_get_entrypoint(nir[i]));
-
 			if (!radv_use_llvm_for_stage(device, i)) {
 				NIR_PASS_V(nir[i], nir_lower_non_uniform_access,
 				           nir_lower_non_uniform_ubo_access |
@@ -3113,8 +3110,6 @@ VkResult radv_create_shaders(struct radv_pipeline *pipeline,
 			}
 			NIR_PASS_V(nir[i], nir_lower_memory_model);
 
-			radv_lower_io(device, nir[i]);
-
 			bool lower_to_scalar = false;
 			bool lower_pack = false;
 			nir_variable_mode robust_modes = (nir_variable_mode)0;
@@ -3135,6 +3130,11 @@ VkResult radv_create_shaders(struct radv_pipeline *pipeline,
 				lower_pack = true;
 			}
 
+			/* do this again since information such as outputs_read can be out-of-date */
+			nir_shader_gather_info(nir[i], nir_shader_get_entrypoint(nir[i]));
+
+			radv_lower_io(device, nir[i]);
+
 			lower_to_scalar |= nir_opt_shrink_vectors(nir[i]);
 
 			if (lower_to_scalar)



More information about the mesa-commit mailing list