From 7eb1e2a690bf0b94e6343271d58fbd04b7d1c43b Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Tue, 13 Jun 2023 20:37:22 +0300 Subject: [PATCH] intel/fs: avoid reusing the VGRF for uniform load_ubo Only found 3 shaders affected in Red Dead Redemption : Totals from 3 (0.05% of 5969) affected shaders: Instrs: 2246 -> 2230 (-0.71%) Cycles: 156506 -> 148402 (-5.18%); split: -5.23%, +0.05% This will have a larger effect when we add the load_ubo_uniform_block_intel intrinsic where we will have larger blocks (vec8/vec16 vs vec4 only now). Signed-off-by: Lionel Landwerlin Reviewed-by: Kenneth Graunke Part-of: --- src/intel/compiler/brw_fs_nir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp index 12590a0..0846104 100644 --- a/src/intel/compiler/brw_fs_nir.cpp +++ b/src/intel/compiler/brw_fs_nir.cpp @@ -4896,7 +4896,6 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr const unsigned block_sz = 64; /* Fetch one cacheline at a time. */ const fs_builder ubld = bld.exec_all().group(block_sz / 4, 0); - const fs_reg packed_consts = ubld.vgrf(BRW_REGISTER_TYPE_UD); for (unsigned c = 0; c < instr->num_components;) { const unsigned base = load_offset + c * type_size; @@ -4904,6 +4903,7 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr const unsigned count = MIN2(instr->num_components - c, (block_sz - base % block_sz) / type_size); + const fs_reg packed_consts = ubld.vgrf(BRW_REGISTER_TYPE_UD); fs_reg srcs[PULL_UNIFORM_CONSTANT_SRCS]; srcs[PULL_UNIFORM_CONSTANT_SRC_SURFACE] = surface; srcs[PULL_UNIFORM_CONSTANT_SRC_SURFACE_HANDLE] = surface_handle; -- 2.7.4