summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Arceri <tarceri@itsqueeze.com>2019-10-23 12:05:10 +1100
committerTimothy Arceri <tarceri@itsqueeze.com>2019-12-13 00:07:19 +0000
commit56c25b938cd4122cb8accb67d07b16f3060f7c29 (patch)
tree48b259075ef4b04255fda506d684ce324abb1e00
parent89b2b0f767e2bf7bc83972c2110b9cdc6a2e1c08 (diff)
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>
-rw-r--r--src/compiler/nir/nir.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index dca4b8f82b8..fc46a3e6604 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -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?
*
@@ -393,6 +406,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?
*/
unsigned explicit_xfb_buffer:1;
@@ -408,6 +430,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.
*
* This is used to detect variables generated by the compiler, so should