From 4e80151c5d75bf5d4b67b0791c3eb06515345a83 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 26 Mar 2020 15:46:56 -0500 Subject: [PATCH] anv: Set alignments on descriptor and constant loads Reviewed-by: Kenneth Graunke Part-of: --- src/intel/vulkan/anv_nir_apply_pipeline_layout.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/intel/vulkan/anv_nir_apply_pipeline_layout.c b/src/intel/vulkan/anv_nir_apply_pipeline_layout.c index aafa63ece50..b5b7cd08041 100644 --- a/src/intel/vulkan/anv_nir_apply_pipeline_layout.c +++ b/src/intel/vulkan/anv_nir_apply_pipeline_layout.c @@ -534,6 +534,7 @@ build_ssbo_descriptor_load(const VkDescriptorType desc_type, nir_intrinsic_instr_create(b->shader, nir_intrinsic_load_ubo); desc_load->src[0] = nir_src_for_ssa(desc_buffer_index); desc_load->src[1] = nir_src_for_ssa(desc_offset); + nir_intrinsic_set_align(desc_load, 8, 0); desc_load->num_components = 4; nir_ssa_dest_init(&desc_load->instr, &desc_load->dest, 4, 32, NULL); nir_builder_instr_insert(b, &desc_load->instr); @@ -714,6 +715,7 @@ build_descriptor_load(nir_deref_instr *deref, unsigned offset, nir_intrinsic_instr_create(b->shader, nir_intrinsic_load_ubo); desc_load->src[0] = nir_src_for_ssa(desc_buffer_index); desc_load->src[1] = nir_src_for_ssa(desc_offset); + nir_intrinsic_set_align(desc_load, 8, offset % 8); desc_load->num_components = num_components; nir_ssa_dest_init(&desc_load->instr, &desc_load->dest, num_components, bit_size, NULL); @@ -798,6 +800,7 @@ lower_load_constant(nir_intrinsic_instr *intrin, load_ubo->num_components = intrin->num_components; load_ubo->src[0] = nir_src_for_ssa(index); load_ubo->src[1] = nir_src_for_ssa(offset); + nir_intrinsic_set_align(load_ubo, intrin->dest.ssa.bit_size / 8, 0); nir_ssa_dest_init(&load_ubo->instr, &load_ubo->dest, intrin->dest.ssa.num_components, intrin->dest.ssa.bit_size, NULL); -- 2.30.2