From 73f365e208e4375b352c1d23d0c6cef8513ece15 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 16 Jul 2024 10:42:10 -0700 Subject: [PATCH] intel/brw: load_offset cannot be constant on this path Literally inside an if-statement (about 26 lines before this hunk) that checks for !nir_src_is_const(instr->src[1]). No shader-db or fossil-db changes on any Intel platform. Reviewed-by: Kenneth Graunke Reviewed-by: Caio Oliveira Part-of: --- src/intel/compiler/brw_fs_nir.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp index ef57d5850ca..7d50a34e6af 100644 --- a/src/intel/compiler/brw_fs_nir.cpp +++ b/src/intel/compiler/brw_fs_nir.cpp @@ -6606,16 +6606,8 @@ fs_nir_emit_intrinsic(nir_to_brw_state &ntb, srcs[SURFACE_LOGICAL_SRC_SURFACE] = surface; srcs[SURFACE_LOGICAL_SRC_SURFACE_HANDLE] = surface_handle; - - const nir_src load_offset = instr->src[1]; - if (nir_src_is_const(load_offset)) { - brw_reg addr = - ubld8.MOV(brw_imm_ud(nir_src_as_uint(load_offset))); - srcs[SURFACE_LOGICAL_SRC_ADDRESS] = component(addr, 0); - } else { - srcs[SURFACE_LOGICAL_SRC_ADDRESS] = - bld.emit_uniformize(get_nir_src(ntb, load_offset)); - } + srcs[SURFACE_LOGICAL_SRC_ADDRESS] = + bld.emit_uniformize(get_nir_src(ntb, instr->src[1])); const unsigned total_dwords = ALIGN(instr->num_components, REG_SIZE * reg_unit(devinfo) / 4);