From 90597aeaef8030a0caf08127f38065c679643a4e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 1 Feb 2024 10:41:15 -0800 Subject: [PATCH] HDR10 colorspace isn't currently supported You can't do blending directly in PQ space, which means you have to create a scene render target in linear space and use shaders to convert PQ texture data to linear, etc. All of this is out of scope for the SDL 2D renderer at the moment. --- src/render/direct3d11/SDL_render_d3d11.c | 4 ++-- src/render/direct3d12/SDL_render_d3d12.c | 4 ++-- test/testcolorspace.c | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c index 45e5fcb76..58df1a235 100644 --- a/src/render/direct3d11/SDL_render_d3d11.c +++ b/src/render/direct3d11/SDL_render_d3d11.c @@ -2516,8 +2516,8 @@ SDL_Renderer *D3D11_CreateRenderer(SDL_Window *window, SDL_PropertiesID create_p SDL_SetupRendererColorspace(renderer, create_props); if (renderer->output_colorspace != SDL_COLORSPACE_SRGB && - renderer->output_colorspace != SDL_COLORSPACE_SCRGB && - renderer->output_colorspace != SDL_COLORSPACE_HDR10) { + renderer->output_colorspace != SDL_COLORSPACE_SCRGB + /*&& renderer->output_colorspace != SDL_COLORSPACE_HDR10*/) { SDL_SetError("Unsupported output colorspace"); SDL_free(renderer); return NULL; diff --git a/src/render/direct3d12/SDL_render_d3d12.c b/src/render/direct3d12/SDL_render_d3d12.c index e2999b1ac..44470f0ea 100644 --- a/src/render/direct3d12/SDL_render_d3d12.c +++ b/src/render/direct3d12/SDL_render_d3d12.c @@ -3041,8 +3041,8 @@ SDL_Renderer *D3D12_CreateRenderer(SDL_Window *window, SDL_PropertiesID create_p SDL_SetupRendererColorspace(renderer, create_props); if (renderer->output_colorspace != SDL_COLORSPACE_SRGB && - renderer->output_colorspace != SDL_COLORSPACE_SCRGB && - renderer->output_colorspace != SDL_COLORSPACE_HDR10) { + renderer->output_colorspace != SDL_COLORSPACE_SCRGB + /*&& renderer->output_colorspace != SDL_COLORSPACE_HDR10*/) { SDL_SetError("Unsupported output colorspace"); SDL_free(renderer); return NULL; diff --git a/test/testcolorspace.c b/test/testcolorspace.c index 56b78eeff..07ce0d17d 100644 --- a/test/testcolorspace.c +++ b/test/testcolorspace.c @@ -403,8 +403,10 @@ int main(int argc, char *argv[]) colorspace = SDL_COLORSPACE_SRGB; } else if (SDL_strcasecmp(colorspace_name, "scRGB") == 0) { colorspace = SDL_COLORSPACE_SCRGB; +/* Not currently supported } else if (SDL_strcasecmp(colorspace_name, "HDR10") == 0) { colorspace = SDL_COLORSPACE_HDR10; +*/ } else { SDL_Log("Unknown colorspace %s\n", argv[i + 1]); goto quit;