aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv/vtn_variables.c
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/compiler/spirv/vtn_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 <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler/spirv/vtn_variables.c')
-rw-r--r--src/compiler/spirv/vtn_variables.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index 90fcc605a45..50cd1b42c69 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -1691,12 +1691,12 @@ vtn_storage_class_to_mode(struct vtn_builder *b,
nir_mode = nir_var_shader_out;
break;
case SpvStorageClassPrivate:
- mode = vtn_variable_mode_global;
- nir_mode = nir_var_global;
+ mode = vtn_variable_mode_private;
+ nir_mode = nir_var_private;
break;
case SpvStorageClassFunction:
- mode = vtn_variable_mode_local;
- nir_mode = nir_var_local;
+ mode = vtn_variable_mode_function;
+ nir_mode = nir_var_function;
break;
case SpvStorageClassWorkgroup:
mode = vtn_variable_mode_workgroup;
@@ -1922,8 +1922,8 @@ vtn_create_variable(struct vtn_builder *b, struct vtn_value *val,
val->pointer = vtn_pointer_for_variable(b, var, ptr_type);
switch (var->mode) {
- case vtn_variable_mode_local:
- case vtn_variable_mode_global:
+ case vtn_variable_mode_function:
+ case vtn_variable_mode_private:
case vtn_variable_mode_uniform:
/* For these, we create the variable normally */
var->var = rzalloc(b->shader, nir_variable);
@@ -2068,7 +2068,7 @@ vtn_create_variable(struct vtn_builder *b, struct vtn_value *val,
var->var->data.image.format = without_array->image_format;
}
- if (var->mode == vtn_variable_mode_local) {
+ if (var->mode == vtn_variable_mode_function) {
vtn_assert(var->var != NULL && var->var->members == NULL);
nir_function_impl_add_variable(b->nb.impl, var->var);
} else if (var->var) {