summaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv/vtn_private.h
diff options
context:
space:
mode:
authorCaio Marcelo de Oliveira Filho <[email protected]>2019-05-02 22:11:31 -0700
committerCaio Marcelo de Oliveira Filho <[email protected]>2019-05-20 10:53:38 -0700
commit192daf68a4358a3a24767d1f6733e8ed8e8d8390 (patch)
tree68ffbbc8763feab5abc30242ab5dbfb93f71e299 /src/compiler/spirv/vtn_private.h
parentf9336751bc0c0977b26a58faa13ce37fd0bd5b08 (diff)
spirv: Add vtn_mode_uses_ssa_offset()
Just the mode is needed to decide whether SSA offsets are needed, so make a function that takes that and reuse it for vtn_pointer_uses_ssa_offset(). This will be used for constant null pointers, that won't have a vtn_pointer handy. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/compiler/spirv/vtn_private.h')
-rw-r--r--src/compiler/spirv/vtn_private.h11
1 files changed, 9 insertions, 2 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;