From ff57c316964a73a7f763e2ff3ddfda99542813e1 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 Part-of: --- src/intel/compiler/brw/brw_compile_gs.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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;