SDL: SDL_CreateWindowTexture() shouldn't use 10-bit or float textures

From 35785d135449c3383c3f6b27b8a047995fbef063 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 26 Mar 2024 10:17:47 -0700
Subject: [PATCH] SDL_CreateWindowTexture() shouldn't use 10-bit or float
 textures

---
 src/video/SDL_video.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index 6dd672e64a18f..6dd44fc2d1149 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -314,9 +314,12 @@ static int SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, S
     *format = info.texture_formats[0];
 
     for (i = 0; i < info.num_texture_formats; ++i) {
-        if (!SDL_ISPIXELFORMAT_FOURCC(info.texture_formats[i]) &&
-            transparent == SDL_ISPIXELFORMAT_ALPHA(info.texture_formats[i])) {
-            *format = info.texture_formats[i];
+        SDL_PixelFormatEnum texture_format = info.texture_formats[i];
+        if (!SDL_ISPIXELFORMAT_FOURCC(texture_format) &&
+            !SDL_ISPIXELFORMAT_10BIT(texture_format) &&
+            !SDL_ISPIXELFORMAT_FLOAT(texture_format) &&
+            transparent == SDL_ISPIXELFORMAT_ALPHA(texture_format)) {
+            *format = texture_format;
             break;
         }
     }