summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2016-01-11 15:20:32 +0100
committerSamuel Pitoiset <[email protected]>2016-02-13 16:01:00 +0100
commit61c87cd2c0698fad68e4a02c44cdcbd4fd00191a (patch)
treefece7fb2cc3d007c3562743988be81807c34d72c /src/mesa
parente8db4e4e0a2e168d3710f18302e4d4d6218f8005 (diff)
st/mesa: add mappings for compute shader sysvals
LOCAL_INVOCATION_ID, WORK_GROUP_ID and NUM_WORK_GROUPS are respectively mapped to THREAD_ID, BLOCK_ID and GRID_SIZE. Changes from v2: - add assertions in st_translate_program() Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 9725abe55ef..436de87ec1e 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -4976,6 +4976,12 @@ const unsigned _mesa_sysval_to_semantic[SYSTEM_VALUE_MAX] = {
TGSI_SEMANTIC_PRIMID,
TGSI_SEMANTIC_TESSOUTER,
TGSI_SEMANTIC_TESSINNER,
+
+ /* Compute shaders
+ */
+ TGSI_SEMANTIC_THREAD_ID,
+ TGSI_SEMANTIC_BLOCK_ID,
+ TGSI_SEMANTIC_GRID_SIZE,
};
/**
@@ -5746,6 +5752,12 @@ st_translate_program(
TGSI_SEMANTIC_TESSCOORD);
assert(_mesa_sysval_to_semantic[SYSTEM_VALUE_HELPER_INVOCATION] ==
TGSI_SEMANTIC_HELPER_INVOCATION);
+ assert(_mesa_sysval_to_semantic[SYSTEM_VALUE_LOCAL_INVOCATION_ID] ==
+ TGSI_SEMANTIC_THREAD_ID);
+ assert(_mesa_sysval_to_semantic[SYSTEM_VALUE_WORK_GROUP_ID] ==
+ TGSI_SEMANTIC_BLOCK_ID);
+ assert(_mesa_sysval_to_semantic[SYSTEM_VALUE_NUM_WORK_GROUPS] ==
+ TGSI_SEMANTIC_GRID_SIZE);
t = CALLOC_STRUCT(st_translate);
if (!t) {