Skip to content
Browse files

Fix exception on systems without anisotropic texture filtering.

The problem was that getExtension returns null if the extension is not
found, and the code that followed was only checking it against undefined.
  • Loading branch information...
1 parent 7d2fe43 commit 50a213a51d58a60fda987a1e53d07625cb09d1f6 @kring kring committed
Showing with 4 additions and 3 deletions.
  1. +4 −3 Source/Renderer/Context.js
View
7 Source/Renderer/Context.js
@@ -259,12 +259,13 @@ define([
this._maximumViewportDimensions = gl.getParameter(gl.MAX_VIEWPORT_DIMS);
// Query and initialize extensions
- this._standardDerivatives = gl.getExtension('OES_standard_derivatives');
- this._depthTexture = gl.getExtension('WEBKIT_WEBGL_depth_texture') || gl.getExtension('MOZ_WEBGL_depth_texture');
+ this._standardDerivatives = gl.getExtension('OES_standard_derivatives') || undefined;
+ this._depthTexture = gl.getExtension('WEBKIT_WEBGL_depth_texture') || gl.getExtension('MOZ_WEBGL_depth_texture') || undefined;
var textureFilterAnisotropic = allowTextureFilterAnisotropic ?
gl.getExtension('EXT_texture_filter_anisotropic') ||
gl.getExtension('WEBKIT_EXT_texture_filter_anisotropic') ||
- gl.getExtension('MOZ_EXT_texture_filter_anisotropic') : undefined;
+ gl.getExtension('MOZ_EXT_texture_filter_anisotropic') ||
+ undefined : undefined;
this._textureFilterAnisotropic = textureFilterAnisotropic;
this._maximumTextureFilterAnisotropy = (typeof textureFilterAnisotropic !== 'undefined') ? gl.getParameter(textureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 1.0;

1 comment on commit 50a213a

@pjcozzi
Analytical Graphics, Inc. member

Good catch. Thanks.

Please sign in to comment.
Something went wrong with that request. Please try again.