summaryrefslogtreecommitdiff
path: root/src/compiler/nir/nir_opt_large_constants.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_opt_large_constants.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_opt_large_constants.c')
-rw-r--r--src/compiler/nir/nir_opt_large_constants.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/compiler/nir/nir_opt_large_constants.c b/src/compiler/nir/nir_opt_large_constants.c
index aa22f05d809..282c73a40bd 100644
--- a/src/compiler/nir/nir_opt_large_constants.c
+++ b/src/compiler/nir/nir_opt_large_constants.c
@@ -196,9 +196,9 @@ nir_opt_large_constants(nir_shader *shader,
continue;
}
- if (dst_deref && dst_deref->mode == nir_var_local) {
+ if (dst_deref && dst_deref->mode == nir_var_function) {
nir_variable *var = nir_deref_instr_get_variable(dst_deref);
- assert(var->data.mode == nir_var_local);
+ assert(var->data.mode == nir_var_function);
/* We only consider variables constant if they only have constant
* stores, all the stores come before any reads, and all stores
@@ -210,9 +210,9 @@ nir_opt_large_constants(nir_shader *shader,
info->is_constant = false;
}
- if (src_deref && src_deref->mode == nir_var_local) {
+ if (src_deref && src_deref->mode == nir_var_function) {
nir_variable *var = nir_deref_instr_get_variable(src_deref);
- assert(var->data.mode == nir_var_local);
+ assert(var->data.mode == nir_var_function);
var_infos[var->data.index].found_read = true;
}
@@ -258,7 +258,7 @@ nir_opt_large_constants(nir_shader *shader,
switch (intrin->intrinsic) {
case nir_intrinsic_load_deref: {
nir_deref_instr *deref = nir_src_as_deref(intrin->src[0]);
- if (deref->mode != nir_var_local)
+ if (deref->mode != nir_var_function)
continue;
nir_variable *var = nir_deref_instr_get_variable(deref);
@@ -276,7 +276,7 @@ nir_opt_large_constants(nir_shader *shader,
case nir_intrinsic_store_deref: {
nir_deref_instr *deref = nir_src_as_deref(intrin->src[0]);
- if (deref->mode != nir_var_local)
+ if (deref->mode != nir_var_function)
continue;
nir_variable *var = nir_deref_instr_get_variable(deref);
@@ -292,7 +292,7 @@ nir_opt_large_constants(nir_shader *shader,
case nir_intrinsic_copy_deref: {
nir_deref_instr *deref = nir_src_as_deref(intrin->src[1]);
- if (deref->mode != nir_var_local)
+ if (deref->mode != nir_var_function)
continue;
nir_variable *var = nir_deref_instr_get_variable(deref);