mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 11:08:03 +02:00
nir_lower_fragcoord_wtrans: Support Vulkan shaders
In Vulkan shaders, you might not have all derefs pointing to a variable Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20400>
This commit is contained in:
parent
ac5af6c06d
commit
b0f3a387c9
1 changed files with 3 additions and 2 deletions
|
|
@ -45,10 +45,11 @@ lower_fragcoord_wtrans_filter(const nir_instr *instr, UNUSED const void *_option
|
|||
if (intr->intrinsic != nir_intrinsic_load_deref)
|
||||
return false;
|
||||
|
||||
nir_variable *var = nir_intrinsic_get_var(intr, 0);
|
||||
if (var->data.mode != nir_var_shader_in)
|
||||
nir_deref_instr *deref = nir_src_as_deref(intr->src[0]);
|
||||
if (!nir_deref_mode_must_be(deref, nir_var_shader_in))
|
||||
return false;
|
||||
|
||||
nir_variable *var = nir_intrinsic_get_var(intr, 0);
|
||||
return var->data.location == VARYING_SLOT_POS;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue