tgsi: Add WORK_DIM System Value
authorHans de Goede <hdegoede@redhat.com>
Fri, 22 Apr 2016 12:26:50 +0000 (14:26 +0200)
committerHans de Goede <hdegoede@redhat.com>
Sat, 2 Jul 2016 10:21:28 +0000 (12:21 +0200)
Add a new WORK_DIM SV type, this is will return the grid dimensions
(1-4) for compute (opencl) kernels.

This is necessary to implement the opencl get_work_dim() function.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/gallium/auxiliary/tgsi/tgsi_strings.c
src/gallium/docs/source/tgsi.rst
src/gallium/include/pipe/p_shader_tokens.h

index c13f7eaeccaacd3dd4655c87c52a75345af39fde..536a4c8f3a933355cc9cfc1bda67163819dfa89e 100644 (file)
@@ -99,6 +99,7 @@ const char *tgsi_semantic_names[TGSI_SEMANTIC_COUNT] =
    "HELPER_INVOCATION",
    "BASEINSTANCE",
    "DRAWID",
+   "WORK_DIM",
 };
 
 const char *tgsi_texture_names[TGSI_TEXTURE_COUNT] =
index bf094068e881da3bb4eee5c09d6c44975e39462c..c6e5ceb7ecebed5b1889d40e5b186b2f9d031735 100644 (file)
@@ -3046,6 +3046,14 @@ For vertex shaders, the zero-based index of the current draw in a
 component is used.
 
 
+TGSI_SEMANTIC_WORK_DIM
+""""""""""""""""""""""
+
+For compute shaders started via opencl this retrieves the work_dim
+parameter to the clEnqueueNDRangeKernel call with which the shader
+was started.
+
+
 Declaration Interpolate
 ^^^^^^^^^^^^^^^^^^^^^^^
 
index abf26d3b4683d904c14f18d1e283b6112c935b27..7621ab92fac9c8c7b0e58cc6ba6c8b695d7f1485 100644 (file)
@@ -199,6 +199,7 @@ enum tgsi_semantic {
    TGSI_SEMANTIC_HELPER_INVOCATION,  /**< current invocation is helper */
    TGSI_SEMANTIC_BASEINSTANCE,
    TGSI_SEMANTIC_DRAWID,
+   TGSI_SEMANTIC_WORK_DIM,    /**< opencl get_work_dim value */
    TGSI_SEMANTIC_COUNT,       /**< number of semantic values */
 };