summaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2019-05-27 11:07:52 +1000
committerDave Airlie <[email protected]>2019-05-31 09:57:45 +1000
commit5441d562433a6315ca00c0c69160ff848e5ec34a (patch)
treefcc857e20cdbec0a3337486549d49d17a4df7f2f /src/compiler/spirv
parent372e83b95f9277fe1d09b1c65c70a38918843b6f (diff)
vtn: create cast with type stride.
When creating function parameters, we create pointers from ssa values, this creates nir casts with stride 0, however we have no where else to get this value from. Later passes to lower explicit io need this stride value to do the right thing. Reviewed-by: Karol Herbst <[email protected]>
Diffstat (limited to 'src/compiler/spirv')
-rw-r--r--src/compiler/spirv/vtn_variables.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index 1e888bb8bbe..ee76230768c 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -1945,7 +1945,7 @@ vtn_pointer_from_ssa(struct vtn_builder *b, nir_ssa_def *ssa,
const struct glsl_type *deref_type = ptr_type->deref->type;
if (!vtn_pointer_is_external_block(b, ptr)) {
ptr->deref = nir_build_deref_cast(&b->nb, ssa, nir_mode,
- deref_type, 0);
+ deref_type, ptr_type->stride);
} else if (vtn_type_contains_block(b, ptr->type) &&
ptr->mode != vtn_variable_mode_phys_ssbo) {
/* This is a pointer to somewhere in an array of blocks, not a