From 2a57568ebd29404f1f1f9ebbd500a037120268e6 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 9 Oct 2024 15:19:06 -0700 Subject: [PATCH] brw/build: Add scalar_group() helper Some uses of the old pattern still exist. The use in brw_fs_nir.cpp is deleted by commits !29884. The use in brw_lower_logical_sends.cpp seems different, so I decided to keep it. The next commit wants to use this. Reviewed-by: Kenneth Graunke Part-of: --- src/intel/compiler/brw_fs_builder.h | 9 +++++++++ src/intel/compiler/brw_fs_nir.cpp | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/intel/compiler/brw_fs_builder.h b/src/intel/compiler/brw_fs_builder.h index 52872e6263c..038cb0bab14 100644 --- a/src/intel/compiler/brw_fs_builder.h +++ b/src/intel/compiler/brw_fs_builder.h @@ -151,6 +151,15 @@ namespace brw { return bld; } + /** + * Construct a builder for SIMD8-as-scalar + */ + fs_builder + scalar_group() const + { + return exec_all().group(8 * reg_unit(shader->devinfo), 0); + } + /** * Construct a builder with the given debug annotation info. */ diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp index af0b4f6ca65..373b33e73db 100644 --- a/src/intel/compiler/brw_fs_nir.cpp +++ b/src/intel/compiler/brw_fs_nir.cpp @@ -6027,7 +6027,7 @@ fs_nir_emit_intrinsic(nir_to_brw_state &ntb, /* Since the image size is always uniform, we can just emit a SIMD8 * query instruction and splat the result out. */ - const fs_builder ubld = bld.exec_all().group(8 * reg_unit(devinfo), 0); + const fs_builder ubld = bld.scalar_group(); brw_reg tmp = ubld.vgrf(BRW_TYPE_UD, 4); fs_inst *inst = ubld.emit(SHADER_OPCODE_IMAGE_SIZE_LOGICAL, @@ -6507,7 +6507,7 @@ fs_nir_emit_intrinsic(nir_to_brw_state &ntb, * for SURFTYPE_BUFFER, we can just use the SIMD8 variant regardless of * the dispatch width. */ - const fs_builder ubld = bld.exec_all().group(8 * reg_unit(devinfo), 0); + const fs_builder ubld = bld.scalar_group(); brw_reg ret_payload = ubld.vgrf(BRW_TYPE_UD, 4); /* Set LOD = 0 */