mcst-linux-kernel/patches-2024.06.26/gl4es-1.1.4/0198-Don-t-upgrade-depth-to...

29 lines
984 B
Diff

From 13bc5b8c13ab8ec9ee9bd8aef90408f51ffa430c Mon Sep 17 00:00:00 2001
From: Le Philousophe <lephilousophe@users.noreply.github.com>
Date: Sat, 2 Apr 2022 19:37:09 +0200
Subject: [PATCH 198/233] Don't upgrade depth to GL_UNSIGNED_INT when
GL_UNSIGNED_SHORT is given
---
src/gl/texture.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/gl/texture.c b/src/gl/texture.c
index 2f598e36..83391cb4 100644
--- a/src/gl/texture.c
+++ b/src/gl/texture.c
@@ -159,7 +159,9 @@ void internal2format_type(GLenum internalformat, GLenum *format, GLenum *type)
break;
case GL_DEPTH_COMPONENT:
*format = GL_DEPTH_COMPONENT;
- *type = (hardext.depth24)?GL_UNSIGNED_INT:GL_UNSIGNED_SHORT;
+ if (*type != GL_UNSIGNED_SHORT) {
+ *type = (hardext.depth24)?GL_UNSIGNED_INT:GL_UNSIGNED_SHORT;
+ }
break;
case GL_DEPTH_STENCIL:
case GL_DEPTH24_STENCIL8:
--
2.11.0