summaryrefslogtreecommitdiff
path: root/src/gallium
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/gallium
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/gallium')
-rw-r--r--src/gallium/auxiliary/nir/tgsi_to_nir.c2
-rw-r--r--src/gallium/drivers/v3d/v3d_program.c2
-rw-r--r--src/gallium/drivers/vc4/vc4_program.c4
3 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c
index 0f365d9ebe0..d4b9d293695 100644
--- a/src/gallium/auxiliary/nir/tgsi_to_nir.c
+++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c
@@ -182,7 +182,7 @@ ttn_emit_declaration(struct ttn_compile *c)
nir_variable *var = rzalloc(b->shader, nir_variable);
var->type = glsl_array_type(glsl_vec4_type(), array_size, 0);
- var->data.mode = nir_var_global;
+ var->data.mode = nir_var_private;
var->name = ralloc_asprintf(var, "arr_%d", decl->Array.ArrayID);
exec_list_push_tail(&b->shader->globals, &var->node);
diff --git a/src/gallium/drivers/v3d/v3d_program.c b/src/gallium/drivers/v3d/v3d_program.c
index 03c45fffbdb..de9cc9ad5c8 100644
--- a/src/gallium/drivers/v3d/v3d_program.c
+++ b/src/gallium/drivers/v3d/v3d_program.c
@@ -296,7 +296,7 @@ v3d_shader_state_create(struct pipe_context *pctx,
v3d_optimize_nir(s);
- NIR_PASS_V(s, nir_remove_dead_variables, nir_var_local);
+ NIR_PASS_V(s, nir_remove_dead_variables, nir_var_function);
/* Garbage collect dead instructions */
nir_sweep(s);
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c
index fb75c07e266..a0c009f424c 100644
--- a/src/gallium/drivers/vc4/vc4_program.c
+++ b/src/gallium/drivers/vc4/vc4_program.c
@@ -1598,7 +1598,7 @@ vc4_optimize_nir(struct nir_shader *s)
NIR_PASS(progress, s, nir_opt_loop_unroll,
nir_var_shader_in |
nir_var_shader_out |
- nir_var_local);
+ nir_var_function);
} while (progress);
}
@@ -2517,7 +2517,7 @@ vc4_shader_state_create(struct pipe_context *pctx,
vc4_optimize_nir(s);
- NIR_PASS_V(s, nir_remove_dead_variables, nir_var_local);
+ NIR_PASS_V(s, nir_remove_dead_variables, nir_var_function);
/* Garbage collect dead instructions */
nir_sweep(s);