From 67ad75a282d11f4c284e30ddc8848550f02a6948 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Tue, 9 Jun 2020 21:25:26 +0200 Subject: [PATCH] gallium/hud: do not specify potentially invalid depth-range MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Setting the depth-scale to 1 while leaving the depth-translation at 0 means our near-plane is at -1 in OpenGL semantics, which is out-of-range on some drivers. In particular, Zink has this limitation. But since we'll only pass a zero z in here anyway, we might as well multiply it by zero, and get the same result. This avoids the problem. Reviewed-by: Marek Olšák Part-of: --- src/gallium/auxiliary/hud/hud_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c index a57ac48cd7a..57f577a3a92 100644 --- a/src/gallium/auxiliary/hud/hud_context.c +++ b/src/gallium/auxiliary/hud/hud_context.c @@ -523,7 +523,7 @@ hud_draw_results(struct hud_context *hud, struct pipe_resource *tex) viewport.scale[0] = 0.5f * hud->fb_width; viewport.scale[1] = 0.5f * hud->fb_height; - viewport.scale[2] = 1.0f; + viewport.scale[2] = 0.0f; viewport.translate[0] = 0.5f * hud->fb_width; viewport.translate[1] = 0.5f * hud->fb_height; viewport.translate[2] = 0.0f; -- 2.30.2