*/
.minTexelBufferOffsetAlignment = 16,
.minUniformBufferOffsetAlignment = ANV_UBO_ALIGNMENT,
- .minStorageBufferOffsetAlignment = 4,
+ .minStorageBufferOffsetAlignment = ANV_SSBO_ALIGNMENT,
.minTexelOffset = -8,
.maxTexelOffset = 7,
.minTexelGatherOffset = -32,
const VkDescriptorType desc_type = nir_intrinsic_desc_type(intrin);
+ assert(intrin->dest.is_ssa);
+ nir_foreach_use(src, &intrin->dest.ssa) {
+ if (src->parent_instr->type != nir_instr_type_deref)
+ continue;
+
+ nir_deref_instr *cast = nir_instr_as_deref(src->parent_instr);
+ assert(cast->deref_type == nir_deref_type_cast);
+ switch (desc_type) {
+ case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
+ case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:
+ cast->cast.align_mul = ANV_UBO_ALIGNMENT;
+ cast->cast.align_offset = 0;
+ break;
+
+ case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER:
+ case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:
+ cast->cast.align_mul = ANV_SSBO_ALIGNMENT;
+ cast->cast.align_offset = 0;
+ break;
+
+ default:
+ break;
+ }
+ }
+
assert(intrin->src[0].is_ssa);
nir_ssa_def *index = intrin->src[0].ssa;
* GEM object.
*/
#define ANV_UBO_ALIGNMENT 64
+#define ANV_SSBO_ALIGNMENT 4
#define ANV_SSBO_BOUNDS_CHECK_ALIGNMENT 4
#define MAX_VIEWS_FOR_PRIMITIVE_REPLICATION 16