Nikolay Sivov (@nsivov) commented about dlls/d2d1/wic_render_target.c:
{&GUID_WICPixelFormat64bppRGBHalf, {DXGI_FORMAT_R16G16B16A16_FLOAT, D2D1_ALPHA_MODE_IGNORE}},
{&GUID_WICPixelFormat32bppRGBA1010102, {DXGI_FORMAT_R10G10B10A2_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED}},
{&GUID_WICPixelFormat8bppY, {DXGI_FORMAT_R8_UNORM, D2D1_ALPHA_MODE_IGNORE}},
{&GUID_WICPixelFormat16bppCbCr, {DXGI_FORMAT_R8G8_UNORM, D2D1_ALPHA_MODE_IGNORE}},
- };
- found = FALSE;
- for (i = 0; i < ARRAY_SIZE(wic_pixel_formats); ++i)
- {
if (IsEqualGUID(wic_format, wic_pixel_formats[i].wic_format))
{
wic_pixel_format = wic_pixel_formats[i].pixel_format;
found = TRUE;
break;
}
- }
How does it work for entries with same "wic_format" value in wic_pixel_formats? I understand the intent, to compare target format with bitmap format, but maybe we can do that unambiguously by converting d2d pixel format to wic format instead, and compare guids? Maybe that will solve this huge condition to allow SRGB variants.