From 6db7dd64b61d47ade6a967d3ba49ddf3dc981182 Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Mon, 25 Apr 2022 13:38:40 -0700 Subject: [PATCH] d3d12: Don't block DISPLAY based on format for non-Windows On platforms where we're not using DXGI swapchains, there's no reason to disallow DISPLAY for formats like B5G6R5. In fact, on Android, we need to support this format as BIND_DISPLAY. Reviewed-by: Bill Kristiansen Part-of: --- src/gallium/drivers/d3d12/d3d12_screen.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/drivers/d3d12/d3d12_screen.cpp b/src/gallium/drivers/d3d12/d3d12_screen.cpp index 63655ea1aa4..53b8f6b5f1a 100644 --- a/src/gallium/drivers/d3d12/d3d12_screen.cpp +++ b/src/gallium/drivers/d3d12/d3d12_screen.cpp @@ -654,6 +654,7 @@ d3d12_is_format_supported(struct pipe_screen *pscreen, } else fmt_info_sv = fmt_info; +#ifdef _WIN32 if (bind & PIPE_BIND_DISPLAY_TARGET && (!(fmt_info.Support1 & D3D12_FORMAT_SUPPORT1_DISPLAY) || // Disable formats that don't support flip model @@ -662,6 +663,7 @@ d3d12_is_format_supported(struct pipe_screen *pscreen, dxgi_format == DXGI_FORMAT_B5G6R5_UNORM || dxgi_format == DXGI_FORMAT_B4G4R4A4_UNORM)) return false; +#endif if (bind & PIPE_BIND_DEPTH_STENCIL && !(fmt_info.Support1 & D3D12_FORMAT_SUPPORT1_DEPTH_STENCIL))