About Social Code
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFaith Ekstrand <faith.ekstrand@collabora.com>2025-11-05 13:53:55 -0500
committerMarge Bot <marge-bot@fdo.invalid>2025-11-06 14:57:32 +0000
commit6c5f981ba8db80c7e12b67819b60e206333d416a (patch)
tree115379d1a28e0c366fa7b4bf82ae83c60601144e
parent0ccadf7a86510b5325294a856520c7243bd3071e (diff)
pan/bi: Move lower_noperspective*() to postprocess()
Reviewed-by: Olivia Lee <olivia.lee@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38265>
-rw-r--r--src/gallium/drivers/panfrost/pan_shader.c5
-rw-r--r--src/panfrost/compiler/bifrost_compile.c4
-rw-r--r--src/panfrost/vulkan/panvk_vX_shader.c5
3 files changed, 4 insertions, 10 deletions
diff --git a/src/gallium/drivers/panfrost/pan_shader.c b/src/gallium/drivers/panfrost/pan_shader.c
index 5c714c09d17..9c0c760f775 100644
--- a/src/gallium/drivers/panfrost/pan_shader.c
+++ b/src/gallium/drivers/panfrost/pan_shader.c
@@ -514,11 +514,6 @@ panfrost_create_shader_state(struct pipe_context *pctx,
NIR_PASS(_, nir, nir_lower_io, nir_var_shader_in | nir_var_shader_out,
glsl_type_size, nir_lower_io_use_interpolated_input_intrinsics);
- if (dev->arch >= 6 && nir->info.stage == MESA_SHADER_VERTEX)
- NIR_PASS(_, nir, pan_nir_lower_noperspective_vs);
- if (dev->arch >= 6 && nir->info.stage == MESA_SHADER_FRAGMENT)
- NIR_PASS(_, nir, pan_nir_lower_noperspective_fs);
-
pan_shader_postprocess(nir, panfrost_device_gpu_id(dev));
if (nir->info.stage == MESA_SHADER_FRAGMENT)
diff --git a/src/panfrost/compiler/bifrost_compile.c b/src/panfrost/compiler/bifrost_compile.c
index 8204688783d..89e41b1d4a7 100644
--- a/src/panfrost/compiler/bifrost_compile.c
+++ b/src/panfrost/compiler/bifrost_compile.c
@@ -6000,6 +6000,8 @@ bifrost_postprocess_nir(nir_shader *nir, unsigned gpu_id)
bifrost_lower_texture_nir(nir, gpu_id);
if (nir->info.stage == MESA_SHADER_FRAGMENT) {
+ NIR_PASS(_, nir, pan_nir_lower_noperspective_fs);
+
NIR_PASS(_, nir, nir_lower_mediump_io,
nir_var_shader_in | nir_var_shader_out,
~bi_fp32_varying_mask(nir), false);
@@ -6009,6 +6011,8 @@ bifrost_postprocess_nir(nir_shader *nir, unsigned gpu_id)
NIR_PASS(_, nir, bifrost_nir_lower_load_output);
} else if (nir->info.stage == MESA_SHADER_VERTEX) {
+ NIR_PASS(_, nir, pan_nir_lower_noperspective_vs);
+
if (pan_arch(gpu_id) >= 9) {
NIR_PASS(_, nir, nir_lower_mediump_io, nir_var_shader_out,
VARYING_BIT_PSIZ, false);
diff --git a/src/panfrost/vulkan/panvk_vX_shader.c b/src/panfrost/vulkan/panvk_vX_shader.c
index ba3f04e287a..b940b0efe83 100644
--- a/src/panfrost/vulkan/panvk_vX_shader.c
+++ b/src/panfrost/vulkan/panvk_vX_shader.c
@@ -922,11 +922,6 @@ panvk_lower_nir(struct panvk_device *dev, nir_shader *nir,
NIR_PASS(_, nir, nir_lower_io, nir_var_shader_in | nir_var_shader_out,
glsl_type_size, nir_lower_io_use_interpolated_input_intrinsics);
- if (nir->info.stage == MESA_SHADER_VERTEX)
- NIR_PASS(_, nir, pan_nir_lower_noperspective_vs);
- if (nir->info.stage == MESA_SHADER_FRAGMENT)
- NIR_PASS(_, nir, pan_nir_lower_noperspective_fs);
-
pan_shader_postprocess(nir, compile_input->gpu_id);
if (stage == MESA_SHADER_VERTEX)