-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix sRGB backbuffers on the SDL_GPU and D3D11 backends #240
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One tiny thing and one slightly less tiny but still pretty small thing - otherwise lgtm
@@ -2699,6 +2706,10 @@ static void D3D11_INTERNAL_CreateSwapChain( | |||
{ | |||
colorSpace = DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709; | |||
} | |||
else if (sRGB) | |||
{ | |||
colorSpace = DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't the else
cover this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this or the other else are both the correct color space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some more testing and it seems like they're right, but it feels like either the sRGB or non-sRGB arm should be G10 so I'm not sure what's going on.
Co-authored-by: Ethan Lee <[email protected]>
This isn't ready to merge yet, I just noticed that this color space code leaks a reference to the swapchain EDIT: Fixed EDIT 2: Sort of. I think we need to release swapchain3 instead of swapchain, because it's technically legal for queryinterface to return a separate object... |
sRGB textures and render targets work but when you request a sRGB backbuffer, you don't get one right now.
On SDL_GPU we aren't flowing the sRGB flag through.
On D3D11, we changed to flip model which doesn't allow sRGB backbuffers, you have to set the colorspace on the swapchain instead.
This PR also fixes a swapchain leak triggered by enabling HDR in D3D11