Explorar o código

check if WEBGL_depth_texture is supported

Alexander Rose %!s(int64=3) %!d(string=hai) anos
pai
achega
d602415e98
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      src/mol-gl/webgl/texture.ts

+ 4 - 0
src/mol-gl/webgl/texture.ts

@@ -238,6 +238,10 @@ export function createTexture(gl: GLRenderingContext, extensions: WebGLExtension
         throw new Error(`texture kind '${kind}' and type '${_type}' are incompatible`);
     }
 
+    if (!extensions.depthTexture && _format === 'depth') {
+        throw new Error(`extension 'WEBGL_depth_texture' needed for 'depth' texture format`);
+    }
+
     const target = getTarget(gl, kind);
     const filter = getFilter(gl, _filter);
     const format = getFormat(gl, _format, _type);