Replies: 2 comments
-
Can you modify some existing example to create repo for this issue? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Sure, here's a patch to hello world:
With that patch, just run it and press F8 to turn MSAA on. For me it errors as soon as I press F8. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I think bgfx might be making an illegal API call which happens to work on some hardware. I use bgfx to save myself from having learn DirectX, though, so I'm not 100% sure.
The issue happens when using
BGFX_RESET_SRGB_BACKBUFFER
and multisampling.The DirectX 11 renderer is creating the backbuffer in a non-SRGB format and the MSAA render target in an sRGB format and expecting ResolveSubresource to do the gamma correction, which according to my reading of MS docs is illegal, and it fails on one of my test machines.
Full details
Non-sRGB backbuffer
In RendererContextD3D11::init, We set m_scd.format to a non-sRGB format regardless of whether BGFX_RESET_SRGB_BACKBUFFER is set. There's a comment explaining why this is OK:
sRGB MSAA render target
Also in init, if we're doing multisampling, we create m_msaaRt, this time with an sRGB format, and there's another comment saying why this is OK:
Call to ResolveSubresource
Finally, in RendererContextD3D11::submit, we call
This will receive:
This seems to be illegal according to MS docs for ResolveSubResource:
I have one test machine on which this call works anyway, and one (with a GeForce 425 M) which errors out on this call with:
Beta Was this translation helpful? Give feedback.
All reactions