From 82946e6969329b76f53568298a8c957a23e1435c Mon Sep 17 00:00:00 2001 From: SlateyDev Date: Sun, 18 Jan 2026 15:53:29 +1100 Subject: [PATCH] Fix condition for WebGL depth texture support Condition looks to be incorrect. If texDepthWebGL is available, it should be using GL_DEPTH_COMPONENT16/24/32 but currently in WebGL always uses GL_DEPTH_COMPONENT which can fail especially in WebGL2. --- src/rlgl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rlgl.h b/src/rlgl.h index 8b264343a..41421c1dd 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -3425,7 +3425,7 @@ unsigned int rlLoadTextureDepth(int width, int height, bool useRenderBuffer) #if (defined(GRAPHICS_API_OPENGL_ES2) || defined(GRAPHICS_API_OPENGL_ES3)) // WARNING: WebGL platform requires unsized internal format definition (GL_DEPTH_COMPONENT) // while other platforms using OpenGL ES 2.0 require/support sized internal formats depending on the GPU capabilities - if (!RLGL.ExtSupported.texDepthWebGL || useRenderBuffer) + if (RLGL.ExtSupported.texDepthWebGL || useRenderBuffer) { if (RLGL.ExtSupported.maxDepthBits == 32) glInternalFormat = GL_DEPTH_COMPONENT32_OES; else if (RLGL.ExtSupported.maxDepthBits == 24) glInternalFormat = GL_DEPTH_COMPONENT24_OES;