From d0c6ef2793370a943a21c1d5e47e397c96b183f6 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Tue, 23 Oct 2018 23:26:22 +0200 Subject: nir: rename global/local to private/function memory the naming is a bit confusing no matter how you look at it. Within SPIR-V "global" memory is memory accessible from all threads. glsl "global" memory normally refers to shader thread private memory declared at global scope. As we already use "shared" for memory shared across all thrads of a work group the solution where everybody could be happy with is to rename "global" to "private" and use "global" later for memory usually stored within system accessible memory (be it VRAM or system RAM if keeping SVM in mind). glsl "local" memory is memory only accessible within a function, while SPIR-V "local" memory is memory accessible within the same workgroup. v2: rename local to function as well v3: rename vtn_variable_mode_local as well Signed-off-by: Karol Herbst Reviewed-by: Jason Ekstrand --- src/compiler/glsl/glsl_to_nir.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/compiler/glsl/glsl_to_nir.cpp') diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index d1a051b1d18..15b74cac281 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -310,16 +310,16 @@ nir_visitor::visit(ir_variable *ir) case ir_var_auto: case ir_var_temporary: if (is_global) - var->data.mode = nir_var_global; + var->data.mode = nir_var_private; else - var->data.mode = nir_var_local; + var->data.mode = nir_var_function; break; case ir_var_function_in: case ir_var_function_out: case ir_var_function_inout: case ir_var_const_in: - var->data.mode = nir_var_local; + var->data.mode = nir_var_function; break; case ir_var_shader_in: @@ -448,7 +448,7 @@ nir_visitor::visit(ir_variable *ir) var->interface_type = ir->get_interface_type(); - if (var->data.mode == nir_var_local) + if (var->data.mode == nir_var_function) nir_function_impl_add_variable(impl, var); else nir_shader_add_variable(shader, var); @@ -1454,7 +1454,7 @@ nir_visitor::visit(ir_expression *ir) * sense, we'll just turn it into a load which will probably * eventually end up as an SSA definition. */ - assert(this->deref->mode == nir_var_global); + assert(this->deref->mode == nir_var_private); op = nir_intrinsic_load_deref; } -- cgit v1.2.3