diff options
author | Karol Herbst <[email protected]> | 2018-10-23 23:26:22 +0200 |
---|---|---|
committer | Karol Herbst <[email protected]> | 2019-01-08 18:51:46 +0100 |
commit | d0c6ef2793370a943a21c1d5e47e397c96b183f6 (patch) | |
tree | f30c52c50239a16d7a4f5b4fbd28991e581d06ea /src/mesa | |
parent | 401dca1c73cad4e6ac3137fdd5513e350d060f25 (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 <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/glspirv.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_nir.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/main/glspirv.c b/src/mesa/main/glspirv.c index 5ff7ac0495e..acad6f42fc7 100644 --- a/src/mesa/main/glspirv.c +++ b/src/mesa/main/glspirv.c @@ -243,7 +243,7 @@ _mesa_spirv_to_nir(struct gl_context *ctx, * inline functions. That way they get properly initialized at the top * of the function and not at the top of its caller. */ - NIR_PASS_V(nir, nir_lower_constant_initializers, nir_var_local); + NIR_PASS_V(nir, nir_lower_constant_initializers, nir_var_function); NIR_PASS_V(nir, nir_lower_returns); NIR_PASS_V(nir, nir_inline_functions); NIR_PASS_V(nir, nir_opt_deref); diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index 5d74524be79..87e4a37a9d9 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -103,7 +103,7 @@ st_nir_assign_vs_in_locations(nir_shader *nir) * set. */ exec_node_remove(&var->node); - var->data.mode = nir_var_global; + var->data.mode = nir_var_private; exec_list_push_tail(&nir->globals, &var->node); } } @@ -616,7 +616,7 @@ st_nir_link_shaders(nir_shader **producer, nir_shader **consumer, bool scalar) * See the following thread for more details of the problem: * https://lists.freedesktop.org/archives/mesa-dev/2017-July/162106.html */ - nir_variable_mode indirect_mask = nir_var_local; + nir_variable_mode indirect_mask = nir_var_function; NIR_PASS_V(*producer, nir_lower_indirect_derefs, indirect_mask); NIR_PASS_V(*consumer, nir_lower_indirect_derefs, indirect_mask); |