From f4260b15cfbda10310aa4d4747afebdc1ef44f04 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 19 Mar 2026 14:42:29 -0700 Subject: [PATCH] brw: Fix URB read length for tessellation evaluation shaders Calculate the end of our read as a byte offset and divide by the 32B unit of URB reads. We were calculating 1 byte beyond the start offset and dividing by 8 (the number of 4 byte DWords in 1 unit of URB read). Cc: mesa-stable Reviewed-by: Alyssa Rosenzweig Part-of: --- src/intel/compiler/brw/brw_from_nir.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/intel/compiler/brw/brw_from_nir.cpp b/src/intel/compiler/brw/brw_from_nir.cpp index b0b91b046be..1dac6aea037 100644 --- a/src/intel/compiler/brw/brw_from_nir.cpp +++ b/src/intel/compiler/brw/brw_from_nir.cpp @@ -2955,9 +2955,11 @@ brw_from_nir_emit_tes_intrinsic(nir_to_brw_state &ntb, break; case nir_intrinsic_load_attribute_payload_intel: + assert(instr->def.bit_size == 32); tes_prog_data->base.urb_read_length = MAX2(tes_prog_data->base.urb_read_length, - DIV_ROUND_UP(nir_src_as_uint(instr->src[0]) + 1, 8)); + DIV_ROUND_UP(nir_src_as_uint(instr->src[0]) + + 4 * instr->def.num_components, 32)); brw_from_nir_emit_intrinsic(ntb, bld, instr); break;