tgsi: provide a way to encode memory qualifiers for SSBO

Each load/store on most hardware can specify what caching to do. Since
SSBO allows individual variables to also have separate caching modes,
allow loads/stores to have the qualifiers instead of attempting to
encode them in declarations.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Ilia Mirkin
2015-11-07 02:25:20 -05:00
parent 888ddd632d
commit 50b8488926
10 changed files with 180 additions and 2 deletions

View File

@@ -572,7 +572,8 @@ struct tgsi_instruction
unsigned Predicate : 1; /* BOOL */
unsigned Label : 1;
unsigned Texture : 1;
unsigned Padding : 2;
unsigned Memory : 1;
unsigned Padding : 1;
};
/*
@@ -729,6 +730,19 @@ struct tgsi_dst_register
unsigned Padding : 6;
};
#define TGSI_MEMORY_COHERENT (1 << 0)
#define TGSI_MEMORY_RESTRICT (1 << 1)
#define TGSI_MEMORY_VOLATILE (1 << 2)
/**
* Specifies the type of memory access to do for the LOAD/STORE instruction.
*/
struct tgsi_instruction_memory
{
unsigned Qualifier : 3; /* TGSI_MEMORY_ */
unsigned Padding : 29;
};
#ifdef __cplusplus
}