aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/include/pipe/p_shader_tokens.h
diff options
context:
space:
mode:
authorHans de Goede <[email protected]>2016-03-10 13:52:00 +0100
committerHans de Goede <[email protected]>2016-03-21 12:20:24 +0100
commit3788e1bf748eca3186377dfa60dbba1c37f8939e (patch)
treef11c11e8c07eff743e57d11a59ca794cb473014a /src/gallium/include/pipe/p_shader_tokens.h
parent43ddec2f435b3e42a1c271ef485f6959bd59b148 (diff)
tgsi: Add support for global / private / input MEMORY
Extend the MEMORY file support to differentiate between global, private and shared memory, as well as "input" memory. "MEMORY[x], INPUT" is intended to access OpenCL kernel parameters, a special memory type is added for this, since the actual storage of these (e.g. UBO-s) may differ per implementation. The uploading of kernel parameters is handled by launch_grid, "MEMORY[x], INPUT" allows drivers to use an access mechanism for parameter reads which matches with the upload method. Signed-off-by: Hans de Goede <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> (v1) Reviewed-by: Samuel Pitoiset <[email protected]> (v2)
Diffstat (limited to 'src/gallium/include/pipe/p_shader_tokens.h')
-rw-r--r--src/gallium/include/pipe/p_shader_tokens.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h
index 5c460276d73..e1979dd1ebd 100644
--- a/src/gallium/include/pipe/p_shader_tokens.h
+++ b/src/gallium/include/pipe/p_shader_tokens.h
@@ -117,6 +117,12 @@ enum tgsi_file_type {
#define TGSI_CYLINDRICAL_WRAP_Z (1 << 2)
#define TGSI_CYLINDRICAL_WRAP_W (1 << 3)
+#define TGSI_MEMORY_TYPE_GLOBAL 0 /* OpenCL global */
+#define TGSI_MEMORY_TYPE_SHARED 1 /* OpenCL local / GLSL shared */
+#define TGSI_MEMORY_TYPE_PRIVATE 2 /* OpenCL private */
+#define TGSI_MEMORY_TYPE_INPUT 3 /* OpenCL kernel input params */
+#define TGSI_MEMORY_TYPE_COUNT 4
+
struct tgsi_declaration
{
unsigned Type : 4; /**< TGSI_TOKEN_TYPE_DECLARATION */
@@ -130,8 +136,8 @@ struct tgsi_declaration
unsigned Local : 1; /**< optimize as subroutine local variable? */
unsigned Array : 1; /**< extra array info? */
unsigned Atomic : 1; /**< atomic only? for TGSI_FILE_BUFFER */
- unsigned Shared : 1; /**< shared storage for TGSI_FILE_MEMORY */
- unsigned Padding : 4;
+ unsigned MemType : 2; /**< TGSI_MEMORY_TYPE_x for TGSI_FILE_MEMORY */
+ unsigned Padding : 3;
};
struct tgsi_declaration_range