diff options
author | Jason Ekstrand <[email protected]> | 2017-06-29 10:33:33 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-07-05 15:26:54 -0700 |
commit | 604eda3712879ae21c56336fe890092732afebc6 (patch) | |
tree | b3b5ce2ac0a005b584c37bca46bcce33e3126245 /src/compiler/spirv/vtn_private.h | |
parent | 4c21e6b7f8956cda80ba173ff2506ddbee13c7af (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.h | 8 |
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 { |