diff options
author | Jason Ekstrand <[email protected]> | 2017-06-29 10:33:34 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-07-05 15:26:54 -0700 |
commit | 62ebca1fe61d0c93a212be0ec2451053cbb9030c (patch) | |
tree | 37a02efb83c02d8b6c1e4f341e0a8a0e70c4a268 /src/compiler/spirv/vtn_private.h | |
parent | 604eda3712879ae21c56336fe890092732afebc6 (diff) |
nir/spirv: Compute offsets for UBOs and SSBOs up-front
Now that we have a pointer wrapper class, we can create offsets for UBOs
and SSBOs up-front instead of waiting until we have the full access
chain. For push constants, we still use the old mechanism because it
provides us with some nice range information.
Reviewed-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/compiler/spirv/vtn_private.h')
-rw-r--r-- | src/compiler/spirv/vtn_private.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/compiler/spirv/vtn_private.h b/src/compiler/spirv/vtn_private.h index 4426c957c30..84d5f51906f 100644 --- a/src/compiler/spirv/vtn_private.h +++ b/src/compiler/spirv/vtn_private.h @@ -284,14 +284,23 @@ struct vtn_pointer { /** The dereferenced type of this pointer */ struct vtn_type *type; - /** The referenced variable */ + /** The referenced variable, if known + * + * This field may be NULL if the pointer uses a (block_index, offset) pair + * instead of an access chain. + */ struct vtn_variable *var; /** An access chain describing how to get from var to the referenced data * - * This field may be NULL if the pointer references the entire variable. + * This field may be NULL if the pointer references the entire variable or + * if a (block_index, offset) pair is used instead of an access chain. */ struct vtn_access_chain *chain; + + /** A (block_index, offset) pair representing a UBO or SSBO position. */ + struct nir_ssa_def *block_index; + struct nir_ssa_def *offset; }; struct vtn_variable { |