From 0554de6016dadc824c048e730b6f025b56eb91a4 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 16 Jul 2025 10:37:53 -0400 Subject: [PATCH] gallium/hud: set the framebuffer texture when drawing Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13545 Fixes: 2eb45daa9c8 ("gallium: de-pointerize pipe_surface") Part-of: (cherry picked from commit ce09d80698c1eb7aaaa1263b3971edcc6c5caedf) --- .pick_status.json | 2 +- src/gallium/auxiliary/hud/hud_context.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index fbe90486ac6..0d2cad10c02 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2894,7 +2894,7 @@ "description": "gallium/hud: set the framebuffer texture when drawing", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "2eb45daa9c86f4b8bd602ddef7a67233f56f1edf", "notes": null diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c index 3128a2735cd..49649c5f6a7 100644 --- a/src/gallium/auxiliary/hud/hud_context.c +++ b/src/gallium/auxiliary/hud/hud_context.c @@ -64,6 +64,7 @@ #include "util/u_sampler.h" #include "util/u_simple_shaders.h" #include "util/u_string.h" +#include "util/u_surface.h" #include "util/u_upload_mgr.h" #include "tgsi/tgsi_text.h" #include "tgsi/tgsi_dump.h" @@ -531,8 +532,7 @@ hud_draw_results(struct hud_context *hud, struct pipe_resource *tex) CSO_BIT_RENDER_CONDITION)); /* set states */ - memset(&surf_templ, 0, sizeof(surf_templ)); - surf_templ.format = tex->format; + u_surface_default_template(&surf_templ, tex); /* Without this, AA lines look thinner if they are between 2 pixels * because the alpha is 0.5 on both pixels. (it's ugly)