aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv/vtn_private.h
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-06-29 10:33:33 -0700
committerJason Ekstrand <[email protected]>2017-07-05 15:26:54 -0700
commit604eda3712879ae21c56336fe890092732afebc6 (patch)
treeb3b5ce2ac0a005b584c37bca46bcce33e3126245 /src/compiler/spirv/vtn_private.h
parent4c21e6b7f8956cda80ba173ff2506ddbee13c7af (diff)
nir/spirv: Rework the way pointers get dereferenced
This has the advantage of moving all of the "extend an access chain" code into one place. Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/compiler/spirv/vtn_private.h')
-rw-r--r--src/compiler/spirv/vtn_private.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/compiler/spirv/vtn_private.h b/src/compiler/spirv/vtn_private.h
index 603cfc2b6e3..4426c957c30 100644
--- a/src/compiler/spirv/vtn_private.h
+++ b/src/compiler/spirv/vtn_private.h
@@ -255,8 +255,12 @@ struct vtn_access_link {
struct vtn_access_chain {
uint32_t length;
- /* Struct elements and array offsets */
- struct vtn_access_link link[0];
+ /** Struct elements and array offsets.
+ *
+ * This is an array of 1 so that it can conveniently be created on the
+ * stack but the real length is given by the length field.
+ */
+ struct vtn_access_link link[1];
};
enum vtn_variable_mode {