Skip to content

Commit

Permalink
Merge pull request #947 from OpenGeoscience/improve-gl-debug
Browse files Browse the repository at this point in the history
Record the unmasked renderer used with webgl.
  • Loading branch information
manthey authored Nov 2, 2018
2 parents 2d2a07e + bffe01e commit ea96ab1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/gl/vglRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,14 @@ vglRenderer.supported = function () {
canvas = document.createElement('canvas');
ctx = (canvas.getContext('webgl') ||
canvas.getContext('experimental-webgl'));
exts = ctx.getSupportedExtensions(); // used for side effects
/* getSupportExtensions will throw an exception if the context isn't
* really supported. */
exts = ctx.getSupportedExtensions();
/* If available, store the unmasked renderer to aid in debugging. */
if (exts.indexOf('WEBGL_debug_renderer_info') >= 0) {
vglRenderer._unmaskedRenderer = ctx.getParameter(ctx.getExtension(
'WEBGL_debug_renderer_info').UNMASKED_RENDERER_WEBGL);
}
checkedWebGL = true;
} catch (e) {
console.warn('No webGL support');
Expand Down
4 changes: 4 additions & 0 deletions src/util/mockVGL.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ module.exports.mockVGLRenderer = function mockVGLRenderer(supported) {
return true;
}
},
getSupportedExtensions: function () {
count('getSupportedExtensions');
return [];
},
getUniformLocation: incID('getUniformLocation'),
isEnabled: function (key) {
count('isEnabled');
Expand Down

0 comments on commit ea96ab1

Please sign in to comment.