Instead of not reporting support for the pixel format at all, just
disable swapchain creation.
Some apps want to create off-screen contexts targeting these formats,
but since WGL doesn't really have "off-screen," the pixel format
enumeration should return support for these.
Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18326>
} 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
- dxgi_format == DXGI_FORMAT_B8G8R8X8_UNORM ||
- dxgi_format == DXGI_FORMAT_B5G5R5A1_UNORM ||
- 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))
return false;
(pfi->pfd.dwFlags & PFD_SUPPORT_GDI))
return NULL;
+ if (pfi->stvis.color_format != PIPE_FORMAT_B8G8R8A8_UNORM &&
+ pfi->stvis.color_format != PIPE_FORMAT_R8G8B8A8_UNORM &&
+ pfi->stvis.color_format != PIPE_FORMAT_R10G10B10A2_UNORM &&
+ pfi->stvis.color_format != PIPE_FORMAT_R16G16B16A16_FLOAT)
+ return NULL;
+
struct d3d12_wgl_framebuffer *fb = CALLOC_STRUCT(d3d12_wgl_framebuffer);
if (!fb)
return NULL;