nir: add some fields to nir_variable_data

These will be used to provide NIR linking functionality to GLSL.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
This commit is contained in:
Timothy Arceri
2019-10-23 12:05:10 +11:00
parent 89b2b0f767
commit 56c25b938c

View File

@@ -330,6 +330,19 @@ typedef struct nir_variable {
unsigned patch:1;
unsigned invariant:1;
/**
* Precision qualifier.
*
* In desktop GLSL we do not care about precision qualifiers at all, in
* fact, the spec says that precision qualifiers are ignored.
*
* To make things easy, we make it so that this field is always
* GLSL_PRECISION_NONE on desktop shaders. This way all the variables
* have the same precision value and the checks we add in the compiler
* for this field will never break a desktop shader compile.
*/
unsigned precision:2;
/**
* Can this variable be coalesced with another?
*
@@ -392,6 +405,15 @@ typedef struct nir_variable {
*/
unsigned explicit_binding:1;
/**
* Was the location explicitly set in the shader?
*
* If the location is explicitly set in the shader, it \b cannot be changed
* by the linker or by the API (e.g., calls to \c glBindAttribLocation have
* no effect).
*/
unsigned explicit_location:1;
/**
* Was a transfer feedback buffer set in the shader?
*/
@@ -407,6 +429,12 @@ typedef struct nir_variable {
*/
unsigned explicit_offset:1;
/**
* Non-zero if this variable was created by lowering a named interface
* block.
*/
unsigned from_named_ifc_block:1;
/**
* How the variable was declared. See nir_var_declaration_type.
*