Browse Source

glgsg: Allow use of sized internal formats in WebGL 2.0

Part of fix for #1296
rdb 3 years ago
parent
commit
a3f2a30f40
1 changed files with 4 additions and 2 deletions
  1. 4 2
      panda/src/glstuff/glGraphicsStateGuardian_src.cxx

+ 4 - 2
panda/src/glstuff/glGraphicsStateGuardian_src.cxx

@@ -10648,8 +10648,10 @@ get_internal_image_format(Texture *tex, bool force_sized) const {
   }
 
 #if defined(__EMSCRIPTEN__) && defined(OPENGLES)
-  // WebGL has no sized formats, it would seem.
-  return get_external_image_format(tex);
+  // WebGL 1 has no sized formats, it would seem.
+  if (!is_at_least_gles_version(3, 0)) {
+    return get_external_image_format(tex);
+  }
 #endif
 
   switch (format) {