summaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/spirv')
-rw-r--r--src/compiler/spirv/vtn_private.h11
-rw-r--r--src/compiler/spirv/vtn_variables.c12
2 files changed, 15 insertions, 8 deletions
diff --git a/src/compiler/spirv/vtn_private.h b/src/compiler/spirv/vtn_private.h
index 9fb508734a2..55cd0c2786c 100644
--- a/src/compiler/spirv/vtn_private.h
+++ b/src/compiler/spirv/vtn_private.h
@@ -473,8 +473,15 @@ struct vtn_pointer {
enum gl_access_qualifier access;
};
-bool vtn_pointer_uses_ssa_offset(struct vtn_builder *b,
- struct vtn_pointer *ptr);
+bool vtn_mode_uses_ssa_offset(struct vtn_builder *b,
+ enum vtn_variable_mode mode);
+
+static inline bool vtn_pointer_uses_ssa_offset(struct vtn_builder *b,
+ struct vtn_pointer *ptr)
+{
+ return vtn_mode_uses_ssa_offset(b, ptr->mode);
+}
+
struct vtn_variable {
enum vtn_variable_mode mode;
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index bc6b0ebedcc..0d7a6b54766 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -45,14 +45,14 @@ vtn_access_chain_create(struct vtn_builder *b, unsigned length)
}
bool
-vtn_pointer_uses_ssa_offset(struct vtn_builder *b,
- struct vtn_pointer *ptr)
+vtn_mode_uses_ssa_offset(struct vtn_builder *b,
+ enum vtn_variable_mode mode)
{
- return ((ptr->mode == vtn_variable_mode_ubo ||
- ptr->mode == vtn_variable_mode_ssbo) &&
+ return ((mode == vtn_variable_mode_ubo ||
+ mode == vtn_variable_mode_ssbo) &&
b->options->lower_ubo_ssbo_access_to_offsets) ||
- ptr->mode == vtn_variable_mode_push_constant ||
- (ptr->mode == vtn_variable_mode_workgroup &&
+ mode == vtn_variable_mode_push_constant ||
+ (mode == vtn_variable_mode_workgroup &&
b->options->lower_workgroup_access_to_offsets);
}