I'm writing a DirectX 11 OpenXR app. OpenXR creates the DX11 swapchain with a format of DXGI_FORMAT_R8G8B8A8_UNORM_SRGB
(the device doesn't support non sRGB formats).
The problem I have is that I need to render a video texture. And IMFMediaEngine::TransferVideoFrame()
won't work unless the texture is in a non sRGB format like DXGI_FORMAT_R8G8B8A8_UNORM
. So if I use the UNORM texture format for the video frame it works.
The problem is that in the headset the colors of the texture are off. They are too bright. I suspect converting them from sRGB->Linear inside the pixel shader would make them look like they are supposed to. But I'm not sure what is happening.
I'm a bit confused about how to handle this situation where the swapchain (sRGB) is created by OpenXR and it does the presenting but I have to sample from UNORM textures.
Can anyone provide guidance?