From 9e9644666e9ba226edf22ab652c05fb148643f79 Mon Sep 17 00:00:00 2001 From: Axel Davy Date: Sat, 20 Mar 2021 13:50:45 +0100 Subject: [PATCH] st/nine: Refuse depth buffers as rendertargets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If we allow them, some apps try to use them as rendertargets. Signed-off-by: Axel Davy Acked-by: Timur Kristóf Part-of: --- src/gallium/frontends/nine/adapter9.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gallium/frontends/nine/adapter9.c b/src/gallium/frontends/nine/adapter9.c index 3d339d982f2..85031ef4584 100644 --- a/src/gallium/frontends/nine/adapter9.c +++ b/src/gallium/frontends/nine/adapter9.c @@ -328,7 +328,11 @@ NineAdapter9_CheckDeviceFormat( struct NineAdapter9 *This, } bind = 0; - if (Usage & D3DUSAGE_RENDERTARGET) bind |= PIPE_BIND_RENDER_TARGET; + if (Usage & D3DUSAGE_RENDERTARGET) { + if (depth_stencil_format(CheckFormat)) + return D3DERR_NOTAVAILABLE; + bind |= PIPE_BIND_RENDER_TARGET; + } if (Usage & D3DUSAGE_DEPTHSTENCIL) { if (!depth_stencil_format(CheckFormat)) return D3DERR_NOTAVAILABLE;