aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_intrinsics.py
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-10-28 07:52:44 -0500
committerJason Ekstrand <[email protected]>2019-03-25 16:12:09 -0500
commit40074ebf743326a1b8ca3be36512db0978de6aac (patch)
treec2698ff8053f1a9f248a55b45ea28e73fffd76bb /src/compiler/nir/nir_intrinsics.py
parente0db0c74b96b8a843e9260749ebbbcbacbabd139 (diff)
nir: Add texture sources and intrinsics for bindless
On Intel, we have both bindless and bindful and we'd like to use them at the same time if we can so we need to be able to distinguish at the NIR level between the two. This also fixes nir_lower_tex to properly handle bindless in its tex_texture_size and get_texture_lod helpers. Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_intrinsics.py')
-rw-r--r--src/compiler/nir/nir_intrinsics.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py
index ea092a991ca..148628645d0 100644
--- a/src/compiler/nir/nir_intrinsics.py
+++ b/src/compiler/nir/nir_intrinsics.py
@@ -306,12 +306,13 @@ atomic3("atomic_counter_comp_swap")
# Image load, store and atomic intrinsics.
#
-# All image intrinsics come in two versions. One which take an image target
-# passed as a deref chain as the first source and one which takes an index or
-# handle as the first source. In the first version, the image variable
-# contains the memory and layout qualifiers that influence the semantics of
-# the intrinsic. In the second, the image format and access qualifiers are
-# provided as constant indices.
+# All image intrinsics come in three versions. One which take an image target
+# passed as a deref chain as the first source, one which takes an index as the
+# first source, and one which takes a bindless handle as the first source.
+# In the first version, the image variable contains the memory and layout
+# qualifiers that influence the semantics of the intrinsic. In the second and
+# third, the image format and access qualifiers are provided as constant
+# indices.
#
# All image intrinsics take a four-coordinate vector and a sample index as
# 2nd and 3rd sources, determining the location within the image that will be
@@ -324,6 +325,8 @@ def image(name, src_comp=[], **kwargs):
intrinsic("image_deref_" + name, src_comp=[1] + src_comp, **kwargs)
intrinsic("image_" + name, src_comp=[1] + src_comp,
indices=[IMAGE_DIM, IMAGE_ARRAY, FORMAT, ACCESS], **kwargs)
+ intrinsic("bindless_image_" + name, src_comp=[1] + src_comp,
+ indices=[IMAGE_DIM, IMAGE_ARRAY, FORMAT, ACCESS], **kwargs)
image("load", src_comp=[4, 1], dest_comp=0, flags=[CAN_ELIMINATE])
image("store", src_comp=[4, 1, 0])