tgsi: add SUBGROUP_* semantics
authorIlia Mirkin <imirkin@alum.mit.edu>
Thu, 9 Feb 2017 23:48:18 +0000 (18:48 -0500)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 5 Apr 2017 13:29:41 +0000 (15:29 +0200)
v2: add documentation (Nicolai)

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/tgsi/tgsi_strings.c
src/gallium/docs/source/tgsi.rst
src/gallium/include/pipe/p_shader_tokens.h

index 85bb8d1727f090e11ccaabb7391808542dfabbba..26403508ec5bed0ded35b9096e47b37f7c356077 100644 (file)
@@ -99,6 +99,13 @@ const char *tgsi_semantic_names[TGSI_SEMANTIC_COUNT] =
    "BASEINSTANCE",
    "DRAWID",
    "WORK_DIM",
+   "SUBGROUP_SIZE",
+   "SUBGROUP_INVOCATION",
+   "SUBGROUP_EQ_MASK",
+   "SUBGROUP_GE_MASK",
+   "SUBGROUP_GT_MASK",
+   "SUBGROUP_LE_MASK",
+   "SUBGROUP_LT_MASK",
 };
 
 const char *tgsi_texture_names[TGSI_TEXTURE_COUNT] =
index 9362d430f079a179c85eb581751205fd2126d3e0..a9568a8298de5404edc8ccc443e6bd793e3c2d71 100644 (file)
@@ -3430,6 +3430,57 @@ For compute shaders, this semantic indicates the (x, y, z) coordinates of the
 current thread inside of the block.
 
 
+TGSI_SEMANTIC_SUBGROUP_SIZE
+"""""""""""""""""""""""""""
+
+This semantic indicates the subgroup size for the current invocation. This is
+an integer of at most 64, as it indicates the width of lanemasks. It does not
+depend on the number of invocations that are active.
+
+
+TGSI_SEMANTIC_SUBGROUP_INVOCATION
+"""""""""""""""""""""""""""""""""
+
+The index of the current invocation within its subgroup.
+
+
+TGSI_SEMANTIC_SUBGROUP_EQ_MASK
+""""""""""""""""""""""""""""""
+
+A bit mask of ``bit index == TGSI_SEMANTIC_SUBGROUP_INVOCATION``, i.e.
+``1 << subgroup_invocation`` in arbitrary precision arithmetic.
+
+
+TGSI_SEMANTIC_SUBGROUP_GE_MASK
+""""""""""""""""""""""""""""""
+
+A bit mask of ``bit index >= TGSI_SEMANTIC_SUBGROUP_INVOCATION``, i.e.
+``((1 << (subgroup_size - subgroup_invocation)) - 1) << subgroup_invocation``
+in arbitrary precision arithmetic.
+
+
+TGSI_SEMANTIC_SUBGROUP_GT_MASK
+""""""""""""""""""""""""""""""
+
+A bit mask of ``bit index > TGSI_SEMANTIC_SUBGROUP_INVOCATION``, i.e.
+``((1 << (subgroup_size - subgroup_invocation - 1)) - 1) << (subgroup_invocation + 1)``
+in arbitrary precision arithmetic.
+
+
+TGSI_SEMANTIC_SUBGROUP_LE_MASK
+""""""""""""""""""""""""""""""
+
+A bit mask of ``bit index <= TGSI_SEMANTIC_SUBGROUP_INVOCATION``, i.e.
+``(1 << (subgroup_invocation + 1)) - 1`` in arbitrary precision arithmetic.
+
+
+TGSI_SEMANTIC_SUBGROUP_LT_MASK
+""""""""""""""""""""""""""""""
+
+A bit mask of ``bit index > TGSI_SEMANTIC_SUBGROUP_INVOCATION``, i.e.
+``(1 << subgroup_invocation) - 1`` in arbitrary precision arithmetic.
+
+
 Declaration Interpolate
 ^^^^^^^^^^^^^^^^^^^^^^^
 
index 7e8b3caf23b0bd7276376fd9df29408270caf25f..a671121f10ff9a46fa0d2d3db345b9bdd80707c1 100644 (file)
@@ -199,6 +199,13 @@ enum tgsi_semantic {
    TGSI_SEMANTIC_BASEINSTANCE,
    TGSI_SEMANTIC_DRAWID,
    TGSI_SEMANTIC_WORK_DIM,    /**< opencl get_work_dim value */
+   TGSI_SEMANTIC_SUBGROUP_SIZE,
+   TGSI_SEMANTIC_SUBGROUP_INVOCATION,
+   TGSI_SEMANTIC_SUBGROUP_EQ_MASK,
+   TGSI_SEMANTIC_SUBGROUP_GE_MASK,
+   TGSI_SEMANTIC_SUBGROUP_GT_MASK,
+   TGSI_SEMANTIC_SUBGROUP_LE_MASK,
+   TGSI_SEMANTIC_SUBGROUP_LT_MASK,
    TGSI_SEMANTIC_COUNT,       /**< number of semantic values */
 };