From 421d3e3c8e88d94fccb7883e41bb1d2c87e4981c Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Fri, 2 Dec 2022 03:48:16 +0100 Subject: [PATCH] nine: add fallback for D3DFMT_D16 in d3d9_to_pipe_format_checked Helps with avoing crash in winetests on crocus. Cc: mesa-stable Reviewed-by: Axel Davy Part-of: --- src/gallium/frontends/nine/nine_pipe.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gallium/frontends/nine/nine_pipe.h b/src/gallium/frontends/nine/nine_pipe.h index f237a8b..0040136 100644 --- a/src/gallium/frontends/nine/nine_pipe.h +++ b/src/gallium/frontends/nine/nine_pipe.h @@ -346,6 +346,14 @@ d3d9_to_pipe_format_checked(struct pipe_screen *screen, * is precised in the name), so it is ok to match to another similar * format. In all cases, if the app reads the texture with a shader, * it gets depth on r and doesn't get stencil.*/ + case D3DFMT_D16: + /* D16 support is a requirement, but as it cannot be locked, + * it is ok to revert to D24 */ + if (format_check_internal(PIPE_FORMAT_Z24X8_UNORM)) + return PIPE_FORMAT_Z24X8_UNORM; + if (format_check_internal(PIPE_FORMAT_X8Z24_UNORM)) + return PIPE_FORMAT_X8Z24_UNORM; + break; case D3DFMT_INTZ: case D3DFMT_D24S8: if (format_check_internal(PIPE_FORMAT_Z24_UNORM_S8_UINT)) -- 2.7.4