summaryrefslogtreecommitdiff
path: root/src/compiler/nir/nir_remove_dead_variables.c
diff options
context:
space:
mode:
authorKarol Herbst <kherbst@redhat.com>2018-10-23 23:26:22 +0200
committerKarol Herbst <kherbst@redhat.com>2019-01-08 18:51:46 +0100
commitd0c6ef2793370a943a21c1d5e47e397c96b183f6 (patch)
treef30c52c50239a16d7a4f5b4fbd28991e581d06ea /src/compiler/nir/nir_remove_dead_variables.c
parent401dca1c73cad4e6ac3137fdd5513e350d060f25 (diff)
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>
Diffstat (limited to 'src/compiler/nir/nir_remove_dead_variables.c')
-rw-r--r--src/compiler/nir/nir_remove_dead_variables.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/nir/nir_remove_dead_variables.c b/src/compiler/nir/nir_remove_dead_variables.c
index 5e972491a1c..a8a347b6a67 100644
--- a/src/compiler/nir/nir_remove_dead_variables.c
+++ b/src/compiler/nir/nir_remove_dead_variables.c
@@ -71,7 +71,7 @@ add_var_use_deref(nir_deref_instr *deref, struct set *live)
* all means we need to keep it alive.
*/
assert(deref->mode == deref->var->data.mode);
- if (!(deref->mode & (nir_var_local | nir_var_global | nir_var_shared)) ||
+ if (!(deref->mode & (nir_var_function | nir_var_private | nir_var_shared)) ||
deref_used_for_not_store(deref))
_mesa_set_add(live, deref->var);
}
@@ -178,7 +178,7 @@ nir_remove_dead_variables(nir_shader *shader, nir_variable_mode modes)
if (modes & nir_var_shader_out)
progress = remove_dead_vars(&shader->outputs, live) || progress;
- if (modes & nir_var_global)
+ if (modes & nir_var_private)
progress = remove_dead_vars(&shader->globals, live) || progress;
if (modes & nir_var_system_value)
@@ -187,7 +187,7 @@ nir_remove_dead_variables(nir_shader *shader, nir_variable_mode modes)
if (modes & nir_var_shared)
progress = remove_dead_vars(&shader->shared, live) || progress;
- if (modes & nir_var_local) {
+ if (modes & nir_var_function) {
nir_foreach_function(function, shader) {
if (function->impl) {
if (remove_dead_vars(&function->impl->locals, live))