mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 02:48:06 +02:00
nir: Don't reorder volatile intrinsics
Fixes issue with "is helper invocation" that in recent SPIR-V is mapped to a volatile Load. The CSE was catching the loads before they were transformed in the new is_helper_invocation intrinsic (that is not reorderable). Fixes:729df14e45("nir: Handle volatile semantics for loading HelperInvocation builtin") Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: M Henning <drawoc@darkrefraction.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19432> (cherry picked from commit8ab628ab2e)
This commit is contained in:
parent
e54150d6e1
commit
f4a7f28608
2 changed files with 4 additions and 1 deletions
|
|
@ -211,7 +211,7 @@
|
||||||
"description": "nir: Don't reorder volatile intrinsics",
|
"description": "nir: Don't reorder volatile intrinsics",
|
||||||
"nominated": true,
|
"nominated": true,
|
||||||
"nomination_type": 1,
|
"nomination_type": 1,
|
||||||
"resolution": 0,
|
"resolution": 1,
|
||||||
"main_sha": null,
|
"main_sha": null,
|
||||||
"because_sha": "729df14e4528b70e63332e4255571729253e9791"
|
"because_sha": "729df14e4528b70e63332e4255571729253e9791"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1965,6 +1965,9 @@ void nir_rewrite_image_intrinsic(nir_intrinsic_instr *instr,
|
||||||
static inline bool
|
static inline bool
|
||||||
nir_intrinsic_can_reorder(nir_intrinsic_instr *instr)
|
nir_intrinsic_can_reorder(nir_intrinsic_instr *instr)
|
||||||
{
|
{
|
||||||
|
if (nir_intrinsic_has_access(instr) &&
|
||||||
|
nir_intrinsic_access(instr) & ACCESS_VOLATILE)
|
||||||
|
return false;
|
||||||
if (instr->intrinsic == nir_intrinsic_load_deref) {
|
if (instr->intrinsic == nir_intrinsic_load_deref) {
|
||||||
nir_deref_instr *deref = nir_src_as_deref(instr->src[0]);
|
nir_deref_instr *deref = nir_src_as_deref(instr->src[0]);
|
||||||
return nir_deref_mode_is_in_set(deref, nir_var_read_only_modes) ||
|
return nir_deref_mode_is_in_set(deref, nir_var_read_only_modes) ||
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue