st/nine: Do not allow depth buffer render targets

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 <davyaxel0@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9177>
This commit is contained in:
Axel Davy 2020-08-04 22:09:56 +02:00
parent 3dbc542f97
commit f85f025a05

View file

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