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 <hdegoede@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> (v1)
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> (v2)
This commit is contained in:
Hans de Goede
2016-03-10 13:52:00 +01:00
parent 43ddec2f43
commit 3788e1bf74
8 changed files with 51 additions and 26 deletions

View File

@@ -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