mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 04:20:08 +01:00
intel/fs: reduce register usage for relocated constants
Commit bb8e31b7ed ("anv: avoid hardcoding instruction VA constant in
shaders") had a slight negative impact on shaders (Red Dead Redemption
2 in particular). Dropping a few shaders from SIMD32 to SIMD16.
With this change, it brings back all the dropped SIMD32 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/22872>
This commit is contained in:
parent
1aaf4bf40a
commit
fb13360546
1 changed files with 10 additions and 2 deletions
|
|
@ -4554,8 +4554,16 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
|
|||
|
||||
case nir_intrinsic_load_reloc_const_intel: {
|
||||
uint32_t id = nir_intrinsic_param_idx(instr);
|
||||
bld.emit(SHADER_OPCODE_MOV_RELOC_IMM,
|
||||
dest, brw_imm_ud(id));
|
||||
|
||||
/* 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));
|
||||
|
||||
/* Copy propagation will get rid of this MOV. */
|
||||
bld.MOV(dest, component(small_dest, 0));
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue