From 0d462dbee57b9f0f708e61f184db1650d59e1e73 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 21 Feb 2020 10:59:38 -0600 Subject: [PATCH] intel/fs: Add an alignment to VARYING_PULL_CONSTANT_LOAD_LOGICAL Reviewed-by: Kenneth Graunke Part-of: --- src/intel/compiler/brw_fs.cpp | 8 +++++--- src/intel/compiler/brw_fs.h | 3 ++- src/intel/compiler/brw_fs_nir.cpp | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index 5cb50561a32..339f36e8966 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -166,7 +166,8 @@ fs_visitor::VARYING_PULL_CONSTANT_LOAD(const fs_builder &bld, const fs_reg &dst, const fs_reg &surf_index, const fs_reg &varying_offset, - uint32_t const_offset) + uint32_t const_offset, + uint8_t alignment) { /* We have our constant surface use a pitch of 4 bytes, so our index can * be any component of a vector, and then we load 4 contiguous @@ -190,7 +191,8 @@ fs_visitor::VARYING_PULL_CONSTANT_LOAD(const fs_builder &bld, */ fs_reg vec4_result = bld.vgrf(BRW_REGISTER_TYPE_F, 4); fs_inst *inst = bld.emit(FS_OPCODE_VARYING_PULL_CONSTANT_LOAD_LOGICAL, - vec4_result, surf_index, vec4_offset); + vec4_result, surf_index, vec4_offset, + brw_imm_ud(alignment)); inst->size_written = 4 * vec4_result.component_size(inst->exec_size); shuffle_from_32bit_read(bld, dst, vec4_result, @@ -2602,7 +2604,7 @@ fs_visitor::lower_constant_loads() VARYING_PULL_CONSTANT_LOAD(ibld, inst->dst, brw_imm_ud(index), inst->src[1], - pull_index * 4); + pull_index * 4, 4); inst->remove(block); } } diff --git a/src/intel/compiler/brw_fs.h b/src/intel/compiler/brw_fs.h index bf57f8e2f8f..98db40a20cd 100644 --- a/src/intel/compiler/brw_fs.h +++ b/src/intel/compiler/brw_fs.h @@ -117,7 +117,8 @@ public: const fs_reg &dst, const fs_reg &surf_index, const fs_reg &varying_offset, - uint32_t const_offset); + uint32_t const_offset, + uint8_t alignment); void DEP_RESOLVE_MOV(const brw::fs_builder &bld, int grf); bool run_fs(bool allow_spilling, bool do_rep_send); diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp index e7ce2230c03..47063178a48 100644 --- a/src/intel/compiler/brw_fs_nir.cpp +++ b/src/intel/compiler/brw_fs_nir.cpp @@ -4501,7 +4501,8 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr for (int i = 0; i < instr->num_components; i++) VARYING_PULL_CONSTANT_LOAD(bld, offset(dest, bld, i), surf_index, - base_offset, i * type_sz(dest.type)); + base_offset, i * type_sz(dest.type), + nir_dest_bit_size(instr->dest) / 8); prog_data->has_ubo_pull = true; } else {