diff --git a/src/panfrost/compiler/bifrost_compile.c b/src/panfrost/compiler/bifrost_compile.c index 89e41b1d4a7..34516f5600c 100644 --- a/src/panfrost/compiler/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost_compile.c @@ -5946,9 +5946,6 @@ bifrost_preprocess_nir(nir_shader *nir, unsigned gpu_id) if (pan_arch(gpu_id) <= 7) NIR_PASS(_, nir, pan_nir_lower_vertex_id); - NIR_PASS(_, nir, nir_lower_viewport_transform); - NIR_PASS(_, nir, nir_lower_point_size, 1.0, 0.0); - nir_variable *psiz = nir_find_variable_with_location( nir, nir_var_shader_out, VARYING_SLOT_PSIZ); if (psiz != NULL) @@ -6011,6 +6008,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, nir_lower_viewport_transform); + NIR_PASS(_, nir, nir_lower_point_size, 1.0, 0.0); NIR_PASS(_, nir, pan_nir_lower_noperspective_vs); if (pan_arch(gpu_id) >= 9) { diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index 6e8a332eea6..619d0a99d8e 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -377,11 +377,8 @@ midgard_preprocess_nir(nir_shader *nir, UNUSED unsigned gpu_id) */ NIR_PASS(_, nir, nir_lower_vars_to_ssa); - if (nir->info.stage == MESA_SHADER_VERTEX) { + if (nir->info.stage == MESA_SHADER_VERTEX) NIR_PASS(_, nir, pan_nir_lower_vertex_id); - NIR_PASS(_, nir, nir_lower_viewport_transform); - NIR_PASS(_, nir, nir_lower_point_size, 1.0, 0.0); - } NIR_PASS(_, nir, nir_lower_var_copies); NIR_PASS(_, nir, nir_lower_vars_to_ssa); @@ -398,6 +395,9 @@ midgard_postprocess_nir(nir_shader *nir, UNUSED unsigned gpu_id) midgard_lower_texture_nir(nir, gpu_id); if (nir->info.stage == MESA_SHADER_VERTEX) { + NIR_PASS(_, nir, nir_lower_viewport_transform); + NIR_PASS(_, nir, nir_lower_point_size, 1.0, 0.0); + /* nir_lower[_explicit]_io is lazy and emits mul+add chains even * for offsets it could figure out are constant. Do some * constant folding before pan_nir_lower_store_component below.