From 1eef08771f861625c0e181a69ae98b4486babfec Mon Sep 17 00:00:00 2001 From: Aleksi Sapon Date: Tue, 26 Aug 2025 10:34:43 -0400 Subject: [PATCH] draw: fix missing line viewport transformation Fixes: 00627b4f ("aux/draw: add guardband clipping for lines") Reviewed-by: Erik Faye-Lund Reviewed-by: Roland Scheidegger Part-of: --- src/gallium/auxiliary/draw/draw_cliptest_tmp.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gallium/auxiliary/draw/draw_cliptest_tmp.h b/src/gallium/auxiliary/draw/draw_cliptest_tmp.h index 1a7b378116b..6471820b584 100644 --- a/src/gallium/auxiliary/draw/draw_cliptest_tmp.h +++ b/src/gallium/auxiliary/draw/draw_cliptest_tmp.h @@ -159,6 +159,14 @@ TAG(do_cliptest)(struct pt_post_vs *pvs, need_pipeline |= out->clipmask; } + /* For the window transformation, the first 4 (xy) clip planes should + * normally be handled by guardband clipping in clip_line_guard_xy, but + * it hasn't been fully implemented yet, so we'll have to do it here. + * Otherwise we'd skip it for being redundant. + */ + if (flags & DO_CLIP_XY_GUARD_BAND) + mask &= 0xfffffff0; + /* * Transform the vertex position from clip coords to window coords, * if the vertex is unclipped.