From f0c29c9b716fd3fd072fc94cc1108c92a44d1c78 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Fri, 5 Jan 2024 22:19:57 -0800 Subject: [PATCH] intel/brw: Use VEC for FS outputs This writes the whole destination register in a single builder call. Eventually, VEC will write the whole destination register in one go, allowing better visibility into how it is defined. Reviewed-by: Ian Romanick Part-of: --- src/intel/compiler/brw_fs_nir.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp index 8078770c307..ff0fbfe3285 100644 --- a/src/intel/compiler/brw_fs_nir.cpp +++ b/src/intel/compiler/brw_fs_nir.cpp @@ -3917,10 +3917,12 @@ fs_nir_emit_fs_intrinsic(nir_to_brw_state &ntb, const fs_reg new_dest = retype(alloc_frag_output(ntb, location), src.type); - for (unsigned j = 0; j < instr->num_components; j++) - bld.MOV(offset(new_dest, bld, nir_intrinsic_component(instr) + j), - offset(src, bld, j)); - + fs_reg comps[instr->num_components]; + for (unsigned i = 0; i < instr->num_components; i++) { + comps[i] = offset(src, bld, i); + } + bld.VEC(offset(new_dest, bld, nir_intrinsic_component(instr)), + comps, instr->num_components); break; }