[Mesa-dev] [PATCH 02/26] nir: Add a descriptor_set field to nir_variable

Jason Ekstrand jason at jlekstrand.net
Fri Mar 25 23:12:16 UTC 2016


This is needed for supporting the Vulkan binding model
---
 src/compiler/nir/glsl_to_nir.cpp | 1 +
 src/compiler/nir/nir.h           | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/src/compiler/nir/glsl_to_nir.cpp b/src/compiler/nir/glsl_to_nir.cpp
index f6e1a17..efef9f5 100644
--- a/src/compiler/nir/glsl_to_nir.cpp
+++ b/src/compiler/nir/glsl_to_nir.cpp
@@ -386,6 +386,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.offset = ir->data.offset;
    var->data.image.read_only = ir->data.image_read_only;
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index bd44a40..996f104 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -267,6 +267,11 @@ typedef struct nir_variable {
       int index;
 
       /**
+       * Descriptor set binding for sampler or UBO.
+       */
+      int descriptor_set;
+
+      /**
        * Initial binding point for a sampler or UBO.
        *
        * For array types, this represents the binding point for the first element.
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list