From f6c42406cd18c83d222c4263868b2caeab655b8f Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 24 Feb 2024 20:02:11 -0800 Subject: [PATCH] SDL_COLORSPACE_HDR10 is the default colorspace for SDL_PIXELFORMAT_P010 surfaces --- src/video/SDL_pixels.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index 297255d57f..64b40abae0 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -704,7 +704,11 @@ void SDL_DestroyPixelFormat(SDL_PixelFormat *format) SDL_Colorspace SDL_GetDefaultColorspaceForFormat(Uint32 format) { if (SDL_ISPIXELFORMAT_FOURCC(format)) { - return SDL_COLORSPACE_YUV_DEFAULT; + if (format == SDL_PIXELFORMAT_P010) { + return SDL_COLORSPACE_HDR10; + } else { + return SDL_COLORSPACE_YUV_DEFAULT; + } } else if (SDL_ISPIXELFORMAT_FLOAT(format)) { return SDL_COLORSPACE_SRGB_LINEAR; } else if (SDL_ISPIXELFORMAT_10BIT(format)) {