summaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv/vtn_variables.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-11-13 09:45:03 -0600
committerJason Ekstrand <[email protected]>2018-11-15 19:59:42 -0600
commitd34fd81e7668b14158d63ade844a0e260b6f9152 (patch)
tree369c2a2d80630c70bd899485e7c7df3624c7db43 /src/compiler/spirv/vtn_variables.c
parentfb127f77295fb9409e089b9267fff32b5f51a0a2 (diff)
nir: Add alignment parameters to SSBO, UBO, and shared access
This also changes spirv_to_nir and glsl_to_nir to set them. The one place that doesn't set them is shared memory access lowering in nir_lower_io. That will have to be updated before any consumers of it can effectively use these new alignments. Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Acked-by: Karol Herbst <[email protected]>
Diffstat (limited to 'src/compiler/spirv/vtn_variables.c')
-rw-r--r--src/compiler/spirv/vtn_variables.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index e1e2c8c26ba..53f52255dc3 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -646,6 +646,12 @@ _vtn_load_store_tail(struct vtn_builder *b, nir_intrinsic_op op, bool load,
nir_intrinsic_set_access(instr, access);
}
+ /* With extensions like relaxed_block_layout, we really can't guarantee
+ * much more than scalar alignment.
+ */
+ if (op != nir_intrinsic_load_push_constant)
+ nir_intrinsic_set_align(instr, data_bit_size / 8, 0);
+
if (index)
instr->src[src++] = nir_src_for_ssa(index);