nir: Set src_components = -1 for image intrinsic deref sources

Semantically, -1 means "Unknown; don't validate" but it's really only
used for derefs because they often need to be flexible.  We don't really
need that flexibility for image intrinsics but this makes it more
consistent.  More immediately useful is that this gives us the ability
to tell _deref forms of these intrinsics apart from the lowered ones.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11849>
This commit is contained in:
Jason Ekstrand 2021-07-12 10:03:59 -05:00 committed by Marge Bot
parent c0afb60258
commit 0b57272af8
1 changed files with 1 additions and 1 deletions

View File

@ -561,7 +561,7 @@ atomic3("atomic_counter_comp_swap")
# either one or two additional scalar arguments with the same meaning as in
# the ARB_shader_image_load_store specification.
def image(name, src_comp=[], extra_indices=[], **kwargs):
intrinsic("image_deref_" + name, src_comp=[1] + src_comp,
intrinsic("image_deref_" + name, src_comp=[-1] + src_comp,
indices=[IMAGE_DIM, IMAGE_ARRAY, ACCESS] + extra_indices, **kwargs)
intrinsic("image_" + name, src_comp=[1] + src_comp,
indices=[IMAGE_DIM, IMAGE_ARRAY, FORMAT, ACCESS] + extra_indices, **kwargs)