nir/vtn: Add type constant to image intrinsics
Since OpenCL supports untyped images, backends might need type info to be able to support the load/store ops. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5242>
This commit is contained in:
@@ -386,16 +386,16 @@ atomic3("atomic_counter_comp_swap")
|
||||
# argument with the value to be written, and image atomic operations take
|
||||
# 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=[], **kwargs):
|
||||
def image(name, src_comp=[], extra_indices=[], **kwargs):
|
||||
intrinsic("image_deref_" + name, src_comp=[1] + src_comp,
|
||||
indices=[ACCESS], **kwargs)
|
||||
indices=[ACCESS] + extra_indices, **kwargs)
|
||||
intrinsic("image_" + name, src_comp=[1] + src_comp,
|
||||
indices=[IMAGE_DIM, IMAGE_ARRAY, FORMAT, ACCESS], **kwargs)
|
||||
indices=[IMAGE_DIM, IMAGE_ARRAY, FORMAT, ACCESS] + extra_indices, **kwargs)
|
||||
intrinsic("bindless_image_" + name, src_comp=[1] + src_comp,
|
||||
indices=[IMAGE_DIM, IMAGE_ARRAY, FORMAT, ACCESS], **kwargs)
|
||||
indices=[IMAGE_DIM, IMAGE_ARRAY, FORMAT, ACCESS] + extra_indices, **kwargs)
|
||||
|
||||
image("load", src_comp=[4, 1, 1], dest_comp=0, flags=[CAN_ELIMINATE])
|
||||
image("store", src_comp=[4, 1, 0, 1])
|
||||
image("load", src_comp=[4, 1, 1], extra_indices=[TYPE], dest_comp=0, flags=[CAN_ELIMINATE])
|
||||
image("store", src_comp=[4, 1, 0, 1], extra_indices=[TYPE])
|
||||
image("atomic_add", src_comp=[4, 1, 1], dest_comp=1)
|
||||
image("atomic_imin", src_comp=[4, 1, 1], dest_comp=1)
|
||||
image("atomic_umin", src_comp=[4, 1, 1], dest_comp=1)
|
||||
|
Reference in New Issue
Block a user