SDL: Fixed SDL_COLORSPACE_SRGB_LINEAR being used for RGBA32 textures

From 33c70af2f86fac33c464e458d862e8e3d20ed809 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 10 Nov 2025 13:25:42 -0800
Subject: [PATCH] Fixed SDL_COLORSPACE_SRGB_LINEAR being used for RGBA32
 textures

---
 src/render/SDL_render.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c
index 590e5ce9e1c87..a3c063215cc54 100644
--- a/src/render/SDL_render.c
+++ b/src/render/SDL_render.c
@@ -1587,7 +1587,8 @@ SDL_Texture *SDL_CreateTextureWithProperties(SDL_Renderer *renderer, SDL_Propert
             SDL_SetNumberProperty(native_props, SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER, SDL_COLORSPACE_JPEG);
         } else {
             default_colorspace = SDL_GetDefaultColorspaceForFormat(closest_format);
-            if (SDL_COLORSPACETYPE(texture->colorspace) == SDL_COLORSPACETYPE(default_colorspace)) {
+            if (SDL_COLORSPACETYPE(texture->colorspace) == SDL_COLORSPACETYPE(default_colorspace) &&
+                SDL_COLORSPACETRANSFER(texture->colorspace) == SDL_COLORSPACETRANSFER(default_colorspace)) {
                 SDL_SetNumberProperty(native_props, SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER, texture->colorspace);
             } else {
                 SDL_SetNumberProperty(native_props, SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER, default_colorspace);