summaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorKarol Herbst <[email protected]>2018-10-23 23:26:22 +0200
committerKarol Herbst <[email protected]>2019-01-08 18:51:46 +0100
commitd0c6ef2793370a943a21c1d5e47e397c96b183f6 (patch)
treef30c52c50239a16d7a4f5b4fbd28991e581d06ea /src/amd
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 <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/common/ac_nir_to_llvm.c6
-rw-r--r--src/amd/vulkan/radv_shader.c8
2 files changed, 7 insertions, 7 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 5bf91b51710..89c76175291 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -1925,7 +1925,7 @@ static LLVMValueRef visit_load_var(struct ac_nir_context *ctx,
values[chan] = ctx->abi->inputs[idx + chan + const_index * stride];
}
break;
- case nir_var_local:
+ case nir_var_function:
for (unsigned chan = 0; chan < ve; chan++) {
if (indir_index) {
unsigned count = glsl_count_attribute_slots(
@@ -2057,7 +2057,7 @@ visit_store_var(struct ac_nir_context *ctx,
}
}
break;
- case nir_var_local:
+ case nir_var_function:
for (unsigned chan = 0; chan < 8; chan++) {
if (!(writemask & (1 << chan)))
continue;
@@ -4072,7 +4072,7 @@ ac_lower_indirect_derefs(struct nir_shader *nir, enum chip_class chip_class)
* See the following thread for more details of the problem:
* https://lists.freedesktop.org/archives/mesa-dev/2017-July/162106.html
*/
- indirect_mask |= nir_var_local;
+ indirect_mask |= nir_var_function;
nir_lower_indirect_derefs(nir, indirect_mask);
}
diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index 9ca586486c4..7d78f62c2c4 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -126,8 +126,8 @@ radv_optimize_nir(struct nir_shader *shader, bool optimize_conservatively,
do {
progress = false;
- NIR_PASS(progress, shader, nir_split_array_vars, nir_var_local);
- NIR_PASS(progress, shader, nir_shrink_vec_array_vars, nir_var_local);
+ NIR_PASS(progress, shader, nir_split_array_vars, nir_var_function);
+ NIR_PASS(progress, shader, nir_shrink_vec_array_vars, nir_var_function);
NIR_PASS_V(shader, nir_lower_vars_to_ssa);
NIR_PASS_V(shader, nir_lower_pack);
@@ -267,7 +267,7 @@ radv_shader_compile_to_nir(struct radv_device *device,
* 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);
@@ -329,7 +329,7 @@ radv_shader_compile_to_nir(struct radv_device *device,
nir_split_var_copies(nir);
nir_lower_global_vars_to_local(nir);
- nir_remove_dead_variables(nir, nir_var_local);
+ nir_remove_dead_variables(nir, nir_var_function);
nir_lower_subgroups(nir, &(struct nir_lower_subgroups_options) {
.subgroup_size = 64,
.ballot_bit_size = 64,