Skip to content

Commit c95f743

Browse files
committed
Fix sRGB backbuffers on the SDL_GPU backend
1 parent a44b7e1 commit c95f743

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/FNA3D_Driver_SDL.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -2651,7 +2651,12 @@ static void SDLGPU_ResetBackbuffer(
26512651
presentationParameters
26522652
);
26532653

2654-
swapchainComposition = SDL_GPU_SWAPCHAINCOMPOSITION_SDR;
2654+
swapchainComposition = (
2655+
(presentationParameters->backBufferFormat == FNA3D_SURFACEFORMAT_COLORSRGB_EXT) ||
2656+
(presentationParameters->backBufferFormat == FNA3D_SURFACEFORMAT_COLORBGRA_EXT)
2657+
)
2658+
? SDL_GPU_SWAPCHAINCOMPOSITION_SDR_LINEAR
2659+
: SDL_GPU_SWAPCHAINCOMPOSITION_SDR;
26552660

26562661
if (SDL_GetHintBoolean("FNA3D_ENABLE_HDR_COLORSPACE", false))
26572662
{

0 commit comments

Comments
 (0)