pan: Use nir_lower_point_size for the float16 conversion
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

This is more robust than smashing the variable to mediump and then
asking for mediump to be lowered later.  It's also faster because it
only involves one compiler pass, not two.

Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38379>
This commit is contained in:
Faith Ekstrand 2025-11-11 13:29:00 -05:00 committed by Marge Bot
parent 6ee4ea5ea3
commit f187b537b5

View file

@ -6051,11 +6051,6 @@ bifrost_preprocess_nir(nir_shader *nir, unsigned gpu_id)
if (nir->info.stage == MESA_SHADER_VERTEX) {
if (pan_arch(gpu_id) <= 7)
NIR_PASS(_, nir, pan_nir_lower_vertex_id);
nir_variable *psiz = nir_find_variable_with_location(
nir, nir_var_shader_out, VARYING_SLOT_PSIZ);
if (psiz != NULL)
psiz->data.precision = GLSL_PRECISION_MEDIUM;
}
/* Get rid of any global vars before we lower to scratch. */
@ -6115,14 +6110,10 @@ 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_type_invalid);
NIR_PASS(_, nir, nir_lower_point_size, 1.0, 0.0,
pan_arch(gpu_id) >= 9 ? nir_type_float16 : nir_type_float32);
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);
}
/* 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.