[Mesa-dev] [PATCH v2 04/21] nir: Add explicit_binding to nir_variable

Alejandro PiƱeiro apinheiro at igalia.com
Sat May 12 09:40:42 UTC 2018


From: Neil Roberts <nroberts at igalia.com>

This is copied from the corresponding value in ir_variable. The
intention is to eventually use it in a pure-NIR linker.

Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
---
 src/compiler/glsl/glsl_to_nir.cpp | 1 +
 src/compiler/nir/nir.h            | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp
index 8e5e9c34912..817e9dad2b8 100644
--- a/src/compiler/glsl/glsl_to_nir.cpp
+++ b/src/compiler/glsl/glsl_to_nir.cpp
@@ -435,6 +435,7 @@ nir_visitor::visit(ir_variable *ir)
    var->data.index = ir->data.index;
    var->data.descriptor_set = 0;
    var->data.binding = ir->data.binding;
+   var->data.explicit_binding = ir->data.explicit_binding;
    var->data.bindless = ir->data.bindless;
    var->data.offset = ir->data.offset;
    var->data.image.read_only = ir->data.memory_read_only;
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index a379928cdcd..1c1fef3b2ef 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -252,6 +252,11 @@ typedef struct nir_variable {
        */
       unsigned bindless:1;
 
+      /**
+       * Was an explicit binding set in the shader?
+       */
+      unsigned explicit_binding:1;
+
       /**
        * \brief Layout qualifier for gl_FragDepth.
        *
-- 
2.14.1



More information about the mesa-dev mailing list