diff --git a/src/gallium/drivers/panfrost/pan_shader.c b/src/gallium/drivers/panfrost/pan_shader.c index 733b2c9c374..5c714c09d17 100644 --- a/src/gallium/drivers/panfrost/pan_shader.c +++ b/src/gallium/drivers/panfrost/pan_shader.c @@ -519,12 +519,6 @@ panfrost_create_shader_state(struct pipe_context *pctx, if (dev->arch >= 6 && nir->info.stage == MESA_SHADER_FRAGMENT) NIR_PASS(_, nir, pan_nir_lower_noperspective_fs); - /* 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 bifrost_nir_lower_store_component below. - */ - NIR_PASS(_, nir, nir_opt_constant_folding); - 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 9de6adbc411..8204688783d 100644 --- a/src/panfrost/compiler/bifrost_compile.c +++ b/src/panfrost/compiler/bifrost_compile.c @@ -6014,6 +6014,11 @@ bifrost_postprocess_nir(nir_shader *nir, unsigned gpu_id) VARYING_BIT_PSIZ, false); } + /* 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. + */ + NIR_PASS(_, nir, nir_opt_constant_folding); NIR_PASS(_, nir, pan_nir_lower_store_component); } diff --git a/src/panfrost/vulkan/panvk_vX_shader.c b/src/panfrost/vulkan/panvk_vX_shader.c index ca1e2e0bd0f..ba3f04e287a 100644 --- a/src/panfrost/vulkan/panvk_vX_shader.c +++ b/src/panfrost/vulkan/panvk_vX_shader.c @@ -927,12 +927,6 @@ panvk_lower_nir(struct panvk_device *dev, nir_shader *nir, if (nir->info.stage == MESA_SHADER_FRAGMENT) NIR_PASS(_, nir, pan_nir_lower_noperspective_fs); - /* 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 bifrost_nir_lower_store_component below. - */ - NIR_PASS(_, nir, nir_opt_constant_folding); - pan_shader_postprocess(nir, compile_input->gpu_id); if (stage == MESA_SHADER_VERTEX)