From d2af77aa6b72da2c9058297784b5238823488486 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Fri, 17 Jan 2025 14:50:32 -0800 Subject: [PATCH] intel/brw: Use urb_read_length instead of nr_attribute_slots to calculate VS first_non_payload_grf. Makes sure the number of registers reserved for the payload matches the size of the URB read, which prevents the VS shared function from writing past the end of the register file on Xe3 with VRT enabled. Reviewed-by: Caio Oliveira Part-of: --- src/intel/compiler/brw_compile_vs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/compiler/brw_compile_vs.cpp b/src/intel/compiler/brw_compile_vs.cpp index b47a3e32a75..3e6e5befefb 100644 --- a/src/intel/compiler/brw_compile_vs.cpp +++ b/src/intel/compiler/brw_compile_vs.cpp @@ -20,7 +20,7 @@ brw_assign_vs_urb_setup(fs_visitor &s) assert(s.stage == MESA_SHADER_VERTEX); /* Each attribute is 4 regs. */ - s.first_non_payload_grf += 4 * vs_prog_data->nr_attribute_slots; + s.first_non_payload_grf += 8 * vs_prog_data->base.urb_read_length; assert(vs_prog_data->base.urb_read_length <= 15);