From 959ec01ac88a6e540def67efef75499ab11aef3d Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Thu, 11 Dec 2025 12:39:28 -0500 Subject: [PATCH] brw/nir_lower_fs_load_output: optimize pixel coord this saves a conversion or two. Signed-off-by: Alyssa Rosenzweig Reviewed-by: Lionel Landwerlin Reviewed-by: Ian Romanick Part-of: --- src/intel/compiler/brw/brw_nir_lower_fs_load_output.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/intel/compiler/brw/brw_nir_lower_fs_load_output.c b/src/intel/compiler/brw/brw_nir_lower_fs_load_output.c index 6c70123863b..a56204e8e08 100644 --- a/src/intel/compiler/brw/brw_nir_lower_fs_load_output.c +++ b/src/intel/compiler/brw/brw_nir_lower_fs_load_output.c @@ -36,10 +36,11 @@ brw_nir_lower_fs_load_output_instr(nir_builder *b, * images. */ nir_def *size = nir_txs(b, .dim = GLSL_SAMPLER_DIM_3D, .texture_index = target); + nir_def *pixel_coords = nir_load_pixel_coord(b); nir_def *coords[3] = { - nir_f2u32(b, nir_channel(b, nir_load_frag_coord(b), 0)), - nir_f2u32(b, nir_channel(b, nir_load_frag_coord(b), 1)), + nir_u2u32(b, nir_channel(b, pixel_coords, 0)), + nir_u2u32(b, nir_channel(b, pixel_coords, 1)), nir_load_layer_id(b), };