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 <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41821>
This commit is contained in:
Kenneth Graunke 2026-03-19 14:42:29 -07:00 committed by Marge Bot
parent 887c04239f
commit f4260b15cf

View file

@ -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;