nir/intrinsics: Add access flags to load/store_deref
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 28 Nov 2018 19:44:56 +0000 (13:44 -0600)
committerJason Ekstrand <jason@jlekstrand.net>
Tue, 8 Jan 2019 00:38:30 +0000 (00:38 +0000)
Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/compiler/nir/nir.h
src/compiler/nir/nir_intrinsics.py

index 0042f803eb2d89b9a5f2cbcf8e28424ff1c60211..29b4da22330de8d10e8d4dd065ebeaa57f9ef611 100644 (file)
@@ -1262,7 +1262,7 @@ typedef enum {
    NIR_INTRINSIC_FORMAT = 15,
 
    /**
-    * Access qualifiers for image intrinsics
+    * Access qualifiers for image and memory access intrinsics
     */
    NIR_INTRINSIC_ACCESS = 16,
 
index 24bcd6bb169ecab3878e7fec9d4c03d96d2d55f9..e449764492d5031e71d139b23e085d3a2ebaa788 100644 (file)
@@ -105,7 +105,7 @@ PARAM_IDX = "NIR_INTRINSIC_PARAM_IDX"
 IMAGE_DIM = "NIR_INTRINSIC_IMAGE_DIM"
 # Non-zero if we are accessing an array image
 IMAGE_ARRAY = "NIR_INTRINSIC_IMAGE_ARRAY"
-# Access qualifiers for image intrinsics
+# Access qualifiers for image and memory access intrinsics
 ACCESS = "NIR_INTRINSIC_ACCESS"
 # Image format for image intrinsics
 FORMAT = "NIR_INTRINSIC_FORMAT"
@@ -132,8 +132,9 @@ intrinsic("nop", flags=[CAN_ELIMINATE])
 
 intrinsic("load_param", dest_comp=0, indices=[PARAM_IDX], flags=[CAN_ELIMINATE])
 
-intrinsic("load_deref", dest_comp=0, src_comp=[-1], flags=[CAN_ELIMINATE])
-intrinsic("store_deref", src_comp=[-1, 0], indices=[WRMASK])
+intrinsic("load_deref", dest_comp=0, src_comp=[-1],
+          indices=[ACCESS], flags=[CAN_ELIMINATE])
+intrinsic("store_deref", src_comp=[-1, 0], indices=[WRMASK, ACCESS])
 intrinsic("copy_deref", src_comp=[-1, -1])
 
 # Interpolation of input.  The interp_deref_at* intrinsics are similar to the