nir/lower_wpos_ytransform: handle frag_coord_xy

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41227>
This commit is contained in:
Marek Olšák 2026-04-29 05:43:05 -04:00 committed by Marge Bot
parent e49f29f25e
commit 076b0aaf1d

View file

@ -279,7 +279,8 @@ lower_wpos_ytransform_instr(nir_builder *b, nir_intrinsic_instr *intr,
nir_deref_instr *deref = nir_src_as_deref(intr->src[0]);
nir_variable *var = nir_deref_instr_get_variable(deref);
if (var->data.mode == nir_var_system_value &&
var->data.location == SYSTEM_VALUE_FRAG_COORD) {
(var->data.location == SYSTEM_VALUE_FRAG_COORD ||
var->data.location == SYSTEM_VALUE_FRAG_COORD_XY)) {
/* gl_FragCoord should not have array/struct derefs: */
return lower_fragcoord(state, intr);
} else if (var->data.mode == nir_var_system_value &&
@ -295,6 +296,7 @@ lower_wpos_ytransform_instr(nir_builder *b, nir_intrinsic_instr *intr,
return false;
}
case nir_intrinsic_load_frag_coord:
case nir_intrinsic_load_frag_coord_xy:
return lower_fragcoord(state, intr);
case nir_intrinsic_load_sample_pos:
return lower_load_sample_pos(state, intr);