ValveSoftware / openvr

OpenVR SDK
http://steamvr.com
BSD 3-Clause "New" or "Revised" License
6.01k stars 1.27k forks source link

Submit is triggering a CopySubresourceRegion error. #177

Open LibreVR opened 8 years ago

LibreVR commented 8 years ago

When submitting textures to the compositor of type DXGI_FORMAT_B8G8R8A8_TYPELESS the following error is triggered:

D3D11 ERROR: ID3D11DeviceContext::CopySubresourceRegion: Cannot invoke CopySubresourceRegion when the Formats of each Resource are not the same or at least castable to each other, unless one format is compressed (DXGI_FORMAT_R9G9B9E5_SHAREDEXP, or DXGI_FORMAT_BC[1,2,3,4,5]_* ) and the source format is similar to the dest according to: BC[1|4] ~= R16G16B16A16|R32G32, BC[2|3|5] ~= R32G32B32A32, R9G9B9E5_SHAREDEXP ~= R32. [ RESOURCE_MANIPULATION ERROR #281: COPYSUBRESOURCEREGION_INVALIDSOURCE]

This seems to be caused by a CopySubresourceRegion call that tries to copy a 1 pixel texture into the submitted texture. However this 1 pixel texture has the format DXGI_FORMAT_R8G8B8A8_TYPELESS. Thus the error is likely triggered due to the different color channel ordering.

DougChism commented 6 years ago

I am getting the same error submitting a DXGI_FORMAT_R10G10B10A2_UNORM texture

LukeRoss00 commented 3 years ago

This problem is still around as of February 2021. It's not tied to the TYPELESS format, as it also appears with DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, but as pointed out by @ghost depends on the channel order: using DXGI_FORMAT_R8G8B8A8_UNORM_SRGB gives no errors.

It's a bit annoying to have the debug spew flooded with this error, especially because on Windows presentable surfaces must always be in BGRA order.

TheNewJavaman commented 2 years ago

Bumping this issue in February 2022, I believe DXGI_FORMAT_R10G10B10A2_UNORM is still having issues when attempting to submit to the headset