diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py index 4d6246476fe..99ba9fc6f99 100644 --- a/src/compiler/nir/nir_intrinsics.py +++ b/src/compiler/nir/nir_intrinsics.py @@ -2094,7 +2094,7 @@ system_value("simd_width_intel", 1) # Load a relocatable 32-bit value intrinsic("load_reloc_const_intel", dest_comp=1, bit_sizes=[32], - indices=[PARAM_IDX], flags=[CAN_ELIMINATE, CAN_REORDER]) + indices=[PARAM_IDX, BASE], flags=[CAN_ELIMINATE, CAN_REORDER]) # 1 component 32bit surface index that can be used for bindless or BTI heaps # diff --git a/src/intel/compiler/brw_eu.h b/src/intel/compiler/brw_eu.h index 8ee3f4a690c..99b54814a9a 100644 --- a/src/intel/compiler/brw_eu.h +++ b/src/intel/compiler/brw_eu.h @@ -1566,7 +1566,7 @@ void brw_MOV_reloc_imm(struct brw_codegen *p, struct brw_reg dst, enum brw_reg_type src_type, - uint32_t id); + uint32_t id, uint32_t base); unsigned brw_num_sources_from_inst(const struct brw_isa_info *isa, diff --git a/src/intel/compiler/brw_eu_emit.c b/src/intel/compiler/brw_eu_emit.c index 0d9c7678888..fb394938c3b 100644 --- a/src/intel/compiler/brw_eu_emit.c +++ b/src/intel/compiler/brw_eu_emit.c @@ -2117,13 +2117,14 @@ void brw_MOV_reloc_imm(struct brw_codegen *p, struct brw_reg dst, enum brw_reg_type src_type, - uint32_t id) + uint32_t id, + uint32_t base) { assert(brw_type_size_bytes(src_type) == 4); assert(brw_type_size_bytes(dst.type) == 4); brw_add_reloc(p, id, BRW_SHADER_RELOC_TYPE_MOV_IMM, - p->next_insn_offset, 0); + p->next_insn_offset, base); brw_MOV(p, dst, retype(brw_imm_ud(DEFAULT_PATCH_IMM), src_type)); } diff --git a/src/intel/compiler/brw_fs_generator.cpp b/src/intel/compiler/brw_fs_generator.cpp index f7209f49e42..1cf70fd5707 100644 --- a/src/intel/compiler/brw_fs_generator.cpp +++ b/src/intel/compiler/brw_fs_generator.cpp @@ -1168,7 +1168,8 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width, case SHADER_OPCODE_MOV_RELOC_IMM: assert(src[0].file == BRW_IMMEDIATE_VALUE); - brw_MOV_reloc_imm(p, dst, dst.type, src[0].ud); + assert(src[1].file == BRW_IMMEDIATE_VALUE); + brw_MOV_reloc_imm(p, dst, dst.type, src[0].ud, src[1].ud); break; case BRW_OPCODE_HALT: diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp index dad87ccb80f..19845f68d15 100644 --- a/src/intel/compiler/brw_fs_nir.cpp +++ b/src/intel/compiler/brw_fs_nir.cpp @@ -6040,13 +6040,14 @@ fs_nir_emit_intrinsic(nir_to_brw_state &ntb, case nir_intrinsic_load_reloc_const_intel: { uint32_t id = nir_intrinsic_param_idx(instr); + uint32_t base = nir_intrinsic_base(instr); /* Emit the reloc in the smallest SIMD size to limit register usage. */ const fs_builder ubld = bld.exec_all().group(1, 0); fs_reg small_dest = ubld.vgrf(dest.type); ubld.UNDEF(small_dest); - ubld.exec_all().group(1, 0).emit(SHADER_OPCODE_MOV_RELOC_IMM, - small_dest, brw_imm_ud(id)); + ubld.exec_all().group(1, 0).emit(SHADER_OPCODE_MOV_RELOC_IMM, small_dest, + brw_imm_ud(id), brw_imm_ud(base)); /* Copy propagation will get rid of this MOV. */ bld.MOV(dest, component(small_dest, 0));