[Mesa-dev] [PATCH 2/3] nir: Copy "patch" flag from ir_variable to nir_variable.

Kenneth Graunke kenneth at whitecape.org
Wed Oct 28 03:37:35 PDT 2015


This was introduced in GLSL IR after NIR development had branched.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 src/glsl/nir/glsl_to_nir.cpp | 1 +
 src/glsl/nir/nir.h           | 1 +
 src/glsl/nir/nir_print.c     | 5 +++--
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp
index 01f16d7..7275b48 100644
--- a/src/glsl/nir/glsl_to_nir.cpp
+++ b/src/glsl/nir/glsl_to_nir.cpp
@@ -303,6 +303,7 @@ nir_visitor::visit(ir_variable *ir)
    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;
 
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
index 04a21a7..ac42251 100644
--- a/src/glsl/nir/nir.h
+++ b/src/glsl/nir/nir.h
@@ -171,6 +171,7 @@ typedef struct {
       unsigned read_only:1;
       unsigned centroid:1;
       unsigned sample:1;
+      unsigned patch:1;
       unsigned invariant:1;
 
       /**
diff --git a/src/glsl/nir/nir_print.c b/src/glsl/nir/nir_print.c
index 0966399..30220c5 100644
--- a/src/glsl/nir/nir_print.c
+++ b/src/glsl/nir/nir_print.c
@@ -228,12 +228,13 @@ print_var_decl(nir_variable *var, print_state *state)
 
    const char *const cent = (var->data.centroid) ? "centroid " : "";
    const char *const samp = (var->data.sample) ? "sample " : "";
+   const char *const patch = (var->data.patch) ? "patch " : "";
    const char *const inv = (var->data.invariant) ? "invariant " : "";
    const char *const mode[] = { "shader_in ", "shader_out ", "", "",
                                 "uniform ", "shader_storage", "system " };
 
-   fprintf(fp, "%s%s%s%s%s ",
-      cent, samp, inv, mode[var->data.mode],
+   fprintf(fp, "%s%s%s%s%s%s ",
+      cent, samp, patch, inv, mode[var->data.mode],
 	  glsl_interp_qualifier_name(var->data.interpolation));
 
    glsl_print_type(var->type, fp);
-- 
2.6.2



More information about the mesa-dev mailing list