aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2019-10-22 11:29:47 +1100
committerTimothy Arceri <[email protected]>2019-12-13 00:07:19 +0000
commit89b2b0f767e2bf7bc83972c2110b9cdc6a2e1c08 (patch)
tree97482df5a1f5bbb3133b2b352f082cbe090c1c62
parentc3823d2d2944e8cd1f22bba01390cfb96c245bf7 (diff)
glsl: copy the how_declared field when converting to nir
This is needed to make use of nir_build_program_resource_list(). Reviewed-by: Alejandro PiƱeiro <[email protected]>
-rw-r--r--src/compiler/glsl/glsl_to_nir.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp
index dadcf69a539..a70fadc4b1c 100644
--- a/src/compiler/glsl/glsl_to_nir.cpp
+++ b/src/compiler/glsl/glsl_to_nir.cpp
@@ -410,6 +410,15 @@ wrap_type_in_array(const glsl_type *elem_type, const glsl_type *array_type)
return glsl_type::get_array_instance(elem_type, array_type->length);
}
+static unsigned
+get_nir_how_declared(unsigned how_declared)
+{
+ if (how_declared == ir_var_hidden)
+ return nir_var_hidden;
+
+ return nir_var_declared_normally;
+}
+
void
nir_visitor::visit(ir_variable *ir)
{
@@ -435,6 +444,7 @@ nir_visitor::visit(ir_variable *ir)
var->data.centroid = ir->data.centroid;
var->data.sample = ir->data.sample;
var->data.patch = ir->data.patch;
+ var->data.how_declared = get_nir_how_declared(ir->data.how_declared);
var->data.invariant = ir->data.invariant;
var->data.location = ir->data.location;
var->data.stream = ir->data.stream;