summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnor Abbott <cwabbott0@gmail.com>2017-06-06 16:02:22 -0700
committerConnor Abbott <cwabbott0@gmail.com>2017-08-08 12:05:25 -0700
commit13c2d573efdf9924f901330d7cb457cc126d885d (patch)
tree72628f1a4f4f7440a60fe4fb726345cac677b5aa
parent76920b1a545e34c400bdde0a98878cd1d26ca780 (diff)
compiler: add new system values for SPV_KHR_shader_ballot
For SPIR-V, Khronos decided to make the SubGroup*Mask system values consist of 4 32-bit components rather than one 64-bit component. Although we'll lower away the difference in nir_lower_system_values so drivers won't have to deal with them, adding these system values makes it easier to implement the SPIRV-to-NIR bits. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
-rw-r--r--src/compiler/shader_enums.c5
-rw-r--r--src/compiler/shader_enums.h11
2 files changed, 16 insertions, 0 deletions
diff --git a/src/compiler/shader_enums.c b/src/compiler/shader_enums.c
index b2ca80b49c..571a43e652 100644
--- a/src/compiler/shader_enums.c
+++ b/src/compiler/shader_enums.c
@@ -211,6 +211,11 @@ gl_system_value_name(gl_system_value sysval)
ENUM(SYSTEM_VALUE_SUBGROUP_GT_MASK),
ENUM(SYSTEM_VALUE_SUBGROUP_LE_MASK),
ENUM(SYSTEM_VALUE_SUBGROUP_LT_MASK),
+ ENUM(SYSTEM_VALUE_SUBGROUP_EQ_MASK_32BIT),
+ ENUM(SYSTEM_VALUE_SUBGROUP_GE_MASK_32BIT),
+ ENUM(SYSTEM_VALUE_SUBGROUP_GT_MASK_32BIT),
+ ENUM(SYSTEM_VALUE_SUBGROUP_LE_MASK_32BIT),
+ ENUM(SYSTEM_VALUE_SUBGROUP_LT_MASK_32BIT),
ENUM(SYSTEM_VALUE_VERTEX_ID),
ENUM(SYSTEM_VALUE_INSTANCE_ID),
ENUM(SYSTEM_VALUE_INSTANCE_INDEX),
diff --git a/src/compiler/shader_enums.h b/src/compiler/shader_enums.h
index 2f20e68c5d..c73b3826c9 100644
--- a/src/compiler/shader_enums.h
+++ b/src/compiler/shader_enums.h
@@ -374,6 +374,17 @@ typedef enum
SYSTEM_VALUE_SUBGROUP_GT_MASK,
SYSTEM_VALUE_SUBGROUP_LE_MASK,
SYSTEM_VALUE_SUBGROUP_LT_MASK,
+
+ /**
+ * These are the same as system values above, except that they consist of 4
+ * 32-bit components rather than 1 64-bit component. This matches the
+ * semantics of the SPIR-V KHR_shader_ballot extension.
+ */
+ SYSTEM_VALUE_SUBGROUP_EQ_MASK_32BIT,
+ SYSTEM_VALUE_SUBGROUP_GE_MASK_32BIT,
+ SYSTEM_VALUE_SUBGROUP_GT_MASK_32BIT,
+ SYSTEM_VALUE_SUBGROUP_LE_MASK_32BIT,
+ SYSTEM_VALUE_SUBGROUP_LT_MASK_32BIT,
/*@}*/
/*@}*/