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 <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20121>
(cherry picked from commit 421d3e3c8e)
This commit is contained in:
Filip Gawin 2022-12-02 03:48:16 +01:00 committed by Eric Engestrom
parent 32c5980e63
commit 6f9c1af4a0
2 changed files with 9 additions and 1 deletions

View file

@ -364,7 +364,7 @@
"description": "nine: add fallback for D3DFMT_D16 in d3d9_to_pipe_format_checked",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View file

@ -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))