From bf830250a70d71acec83df0063a81c4b54713e46 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Tue, 14 Jan 2020 17:12:06 +1100 Subject: [PATCH] glsl_to_nir: update interface type properly MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Since 76ba225184ed the member variable types were being redefined but we assigned the old interface type to the variable. In a following patch series we will use the types to check if we are dealing with an interface instance when apply GLSL linking rules. Reviewed-by: Alejandro Piñeiro Tested-by: Marge Bot Part-of: --- src/compiler/glsl/glsl_to_nir.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index 57c07978493..fdc14bfe507 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -539,11 +539,15 @@ nir_visitor::visit(ir_variable *ir) if (ir->data.memory_restrict) mem_access |= ACCESS_RESTRICT; + var->interface_type = ir->get_interface_type(); + /* For UBO and SSBO variables, we need explicit types */ if (var->data.mode & (nir_var_mem_ubo | nir_var_mem_ssbo)) { const glsl_type *explicit_ifc_type = ir->get_interface_type()->get_explicit_interface_type(supports_std430); + var->interface_type = explicit_ifc_type; + if (ir->type->without_array()->is_interface()) { /* If the type contains the interface, wrap the explicit type in the * right number of arrays. @@ -636,8 +640,6 @@ nir_visitor::visit(ir_variable *ir) var->constant_initializer = constant_copy(ir->constant_initializer, var); - var->interface_type = ir->get_interface_type(); - if (var->data.mode == nir_var_function_temp) nir_function_impl_add_variable(impl, var); else -- 2.30.2