[Mesa-dev] [PATCH 02/20] nir: add streams to nir data

Timothy Arceri tarceri at itsqueeze.com
Fri Nov 10 03:13:36 UTC 2017


This will be used by gallium drivers.
---
 src/compiler/glsl/glsl_to_nir.cpp | 1 +
 src/compiler/nir/nir.h            | 8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp
index caea2ea3b2..d327f52be6 100644
--- a/src/compiler/glsl/glsl_to_nir.cpp
+++ b/src/compiler/glsl/glsl_to_nir.cpp
@@ -315,20 +315,21 @@ nir_visitor::visit(ir_variable *ir)
    var->type = ir->type;
    var->name = ralloc_strdup(var, ir->name);
 
    var->data.always_active_io = ir->data.always_active_io;
    var->data.read_only = ir->data.read_only;
    var->data.centroid = ir->data.centroid;
    var->data.sample = ir->data.sample;
    var->data.patch = ir->data.patch;
    var->data.invariant = ir->data.invariant;
    var->data.location = ir->data.location;
+   var->data.stream = ir->data.stream;
    var->data.compact = false;
 
    switch(ir->data.mode) {
    case ir_var_auto:
    case ir_var_temporary:
       if (is_global)
          var->data.mode = nir_var_global;
       else
          var->data.mode = nir_var_local;
       break;
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 1a33d751bd..b6c7ac3e54 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -267,20 +267,28 @@ typedef struct nir_variable {
        * slot has not been assigned, the value will be -1.
        */
       int location;
 
       /**
        * The actual location of the variable in the IR. Only valid for inputs
        * and outputs.
        */
       unsigned int driver_location;
 
+      /**
+       * Vertex stream output identifier.
+       *
+       * For packed outputs, bit 31 is set and bits [2*i+1,2*i] indicate the
+       * stream of the i-th component.
+       */
+      unsigned stream;
+
       /**
        * output index for dual source blending.
        */
       int index;
 
       /**
        * Descriptor set binding for sampler or UBO.
        */
       int descriptor_set;
 
-- 
2.14.3



More information about the mesa-dev mailing list