From: Timothy Arceri Date: Wed, 23 Oct 2019 01:05:10 +0000 (+1100) Subject: nir: add some fields to nir_variable_data X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=56c25b938cd4122cb8accb67d07b16f3060f7c29;p=mesa.git nir: add some fields to nir_variable_data These will be used to provide NIR linking functionality to GLSL. Reviewed-by: Alejandro PiƱeiro --- 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? * @@ -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. *