tgsi: Add WORK_DIM System Value

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>
This commit is contained in:
Hans de Goede 2016-04-22 14:26:50 +02:00
parent da7efadf04
commit d386cef246
3 changed files with 10 additions and 0 deletions

View 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] =

View 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
^^^^^^^^^^^^^^^^^^^^^^^

View 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 */
};