From ec8518d123181a9203e516e47966672ef6fa2a0c Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Tue, 4 Nov 2025 16:34:33 +0200 Subject: [PATCH] brw: avoid invalid URB messages Some new CTS tests have geometry shader looking like this : void main() { gl_Position = gl_in[0].gl_Position; EmitVertex(); EndPrimitive(); // <-- some storage buffer write } The generate shader has : - a message to write the position - a message to write to the storage buffer - a final message to end the thread This generates an empty EOT URB messages which is apparently not legal (simulation complains, HW hangs) : send(8) nullUD g126UD nullUD 0x04088007 0x00000000 urb MsgDesc: offset 0 SIMD8 write masked mlen 2 ex_mlen 0 rlen 0 { align1 1Q A@1 EOT }; Instead emit a write with actual data and the mask set at 0 to discard the effect : mov(8) g127<1>UD 0x00000000UD { align1 WE_all 1Q }; mov(8) g125<1>UD 0x00000000UD { align1 1Q }; send(8) nullUD g126UD g125UD 0x04088007 0x00000040 urb MsgDesc: offset 0 SIMD8 write masked mlen 2 ex_mlen 1 rlen 0 { align1 1Q A@1 EOT }; Signed-off-by: Lionel Landwerlin Cc: mesa-stable Reviewed-by: Ian Romanick (cherry picked from commit ff57c316964a73a7f763e2ff3ddfda99542813e1) Part-of: --- .pick_status.json | 2 +- src/intel/compiler/brw/brw_compile_gs.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 83dbcb1ce39..e2d014a8df8 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1334,7 +1334,7 @@ "description": "brw: avoid invalid URB messages", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/intel/compiler/brw/brw_compile_gs.cpp b/src/intel/compiler/brw/brw_compile_gs.cpp index 366f522fc01..a24a9767a49 100644 --- a/src/intel/compiler/brw/brw_compile_gs.cpp +++ b/src/intel/compiler/brw/brw_compile_gs.cpp @@ -52,8 +52,10 @@ brw_emit_gs_thread_end(brw_shader &s) brw_reg srcs[URB_LOGICAL_NUM_SRCS]; srcs[URB_LOGICAL_SRC_HANDLE] = s.gs_payload().urb_handles; + srcs[URB_LOGICAL_SRC_DATA] = brw_imm_ud(0); + srcs[URB_LOGICAL_SRC_CHANNEL_MASK] = brw_imm_ud(0); urb = abld.URB_WRITE(srcs, ARRAY_SIZE(srcs)); - urb->components = 0; + urb->components = 1; } else { brw_reg srcs[URB_LOGICAL_NUM_SRCS]; srcs[URB_LOGICAL_SRC_HANDLE] = s.gs_payload().urb_handles;