From f85f025a05cb7267b5f2c0932b46218f21576819 Mon Sep 17 00:00:00 2001 From: Axel Davy Date: Tue, 4 Aug 2020 22:09:56 +0200 Subject: [PATCH] st/nine: Do not allow depth buffer render targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without the proposed check, some apps will decide to use depth buffers as render targets. Bug found investigating: https://github.com/iXit/wine-nine-standalone/issues/82 Signed-off-by: Axel Davy Acked-by: Timur Kristóf Part-of: --- src/gallium/frontends/nine/nine_pipe.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gallium/frontends/nine/nine_pipe.h b/src/gallium/frontends/nine/nine_pipe.h index 6a85c042db7..b5c4f0a3474 100644 --- a/src/gallium/frontends/nine/nine_pipe.h +++ b/src/gallium/frontends/nine/nine_pipe.h @@ -301,6 +301,10 @@ d3d9_to_pipe_format_checked(struct pipe_screen *screen, { enum pipe_format result; + /* We cannot render to depth textures as a render target */ + if (depth_stencil_format(format) && (bindings & PIPE_BIND_RENDER_TARGET)) + return PIPE_FORMAT_NONE; + result = d3d9_to_pipe_format_internal(format); if (result == PIPE_FORMAT_NONE) return PIPE_FORMAT_NONE;