Skip to content
Snippets Groups Projects
Commit d602415e authored by Alexander Rose's avatar Alexander Rose
Browse files

check if WEBGL_depth_texture is supported

parent 2c49a423
No related branches found
No related tags found
No related merge requests found
...@@ -238,6 +238,10 @@ export function createTexture(gl: GLRenderingContext, extensions: WebGLExtension ...@@ -238,6 +238,10 @@ export function createTexture(gl: GLRenderingContext, extensions: WebGLExtension
throw new Error(`texture kind '${kind}' and type '${_type}' are incompatible`); 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 target = getTarget(gl, kind);
const filter = getFilter(gl, _filter); const filter = getFilter(gl, _filter);
const format = getFormat(gl, _format, _type); const format = getFormat(gl, _format, _type);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment