anv: avoid hardcoding instruction VA constant in shaders

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22847>
This commit is contained in:
Lionel Landwerlin 2023-02-23 09:50:02 +02:00
parent 53b77a8102
commit bb8e31b7ed
2 changed files with 5 additions and 1 deletions

View file

@ -1033,7 +1033,7 @@ lower_load_constant(nir_builder *b, nir_intrinsic_instr *intrin,
nir_iadd(b,
nir_load_reloc_const_intel(b, BRW_SHADER_RELOC_CONST_DATA_ADDR_LOW),
offset),
nir_imm_int(b, INSTRUCTION_STATE_POOL_MIN_ADDRESS >> 32));
nir_load_reloc_const_intel(b, BRW_SHADER_RELOC_CONST_DATA_ADDR_HIGH));
nir_ssa_def *data =
nir_load_global_constant(b, const_data_addr,

View file

@ -126,6 +126,10 @@ anv_shader_bin_create(struct anv_device *device,
.value = shader_data_addr,
};
assert(shader_data_addr >> 32 == INSTRUCTION_STATE_POOL_MIN_ADDRESS >> 32);
reloc_values[rv_count++] = (struct brw_shader_reloc_value) {
.id = BRW_SHADER_RELOC_CONST_DATA_ADDR_HIGH,
.value = INSTRUCTION_STATE_POOL_MIN_ADDRESS >> 32
};
reloc_values[rv_count++] = (struct brw_shader_reloc_value) {
.id = BRW_SHADER_RELOC_SHADER_START_OFFSET,
.value = shader->kernel.offset,