On Fri Nov 18 03:59:32 2022 +0000, Nikolay Sivov wrote:
What I would expect this to do is to use convert WIC format guid to dxgi format, and then use CheckFormatSupport(). For example does this list of supported formats change if device is created without D3D10_CREATE_DEVICE_BGRA_SUPPORT?
CheckFormatSupport() does check DXGI_FORMAT. But what about alpha mode? See what's in the first commit. Take GUID_WICPixelFormat8bppAlpha for example. GUID_WICPixelFormat8bppAlpha can be converted to DXGI_FORMAT_A8_UNORM. However, (DXGI_FORMAT_A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED), (DXGI_FORMAT_A8_UNORM, D2D1_ALPHA_MODE_STRAIGHT) and (DXGI_FORMAT_A8_UNORM, D2D1_ALPHA_MODE_UNKNOWN) are supported. (DXGI_FORMAT_A8_UNORM, D2D1_ALPHA_MODE_IGNORE) is unsupported. So a (wic_guid, dxgi_format, alpha mode) map is still needed, which makes CheckFormatSupport() seem redundant.