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 <kherbst@redhat.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
Karol Herbst
2018-10-23 23:26:22 +02:00
parent 401dca1c73
commit d0c6ef2793
33 changed files with 108 additions and 108 deletions

View File

@@ -527,7 +527,7 @@ brw_nir_no_indirect_mask(const struct brw_compiler *compiler,
if (compiler->glsl_compiler_options[stage].EmitNoIndirectOutput)
indirect_mask |= nir_var_shader_out;
if (compiler->glsl_compiler_options[stage].EmitNoIndirectTemp)
indirect_mask |= nir_var_local;
indirect_mask |= nir_var_function;
return indirect_mask;
}
@@ -542,8 +542,8 @@ brw_nir_optimize(nir_shader *nir, const struct brw_compiler *compiler,
bool progress;
do {
progress = false;
OPT(nir_split_array_vars, nir_var_local);
OPT(nir_shrink_vec_array_vars, nir_var_local);
OPT(nir_split_array_vars, nir_var_function);
OPT(nir_shrink_vec_array_vars, nir_var_function);
OPT(nir_lower_vars_to_ssa);
if (allow_copies) {
/* Only run this pass in the first call to brw_nir_optimize. Later
@@ -627,7 +627,7 @@ brw_nir_optimize(nir_shader *nir, const struct brw_compiler *compiler,
/* Workaround Gfxbench unused local sampler variable which will trigger an
* assert in the opt_large_constants pass.
*/
OPT(nir_remove_dead_variables, nir_var_local);
OPT(nir_remove_dead_variables, nir_var_function);
return nir;
}
@@ -692,7 +692,7 @@ brw_preprocess_nir(const struct brw_compiler *compiler, nir_shader *nir)
OPT(nir_lower_global_vars_to_local);
OPT(nir_split_var_copies);
OPT(nir_split_struct_vars, nir_var_local);
OPT(nir_split_struct_vars, nir_var_function);
/* Run opt_algebraic before int64 lowering so we can hopefully get rid
* of some int64 instructions.