From db11611d7d8d997fa34c3903ed28402654d6654a Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 17 Jan 2024 16:13:34 -0500 Subject: [PATCH] add logging of gl max_texture_image_units errors to multi-image test --- src/webgldrawer.js | 5 +++++ test/modules/multi-image.js | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/webgldrawer.js b/src/webgldrawer.js index 8fbd3bed..cf051ad3 100644 --- a/src/webgldrawer.js +++ b/src/webgldrawer.js @@ -89,6 +89,10 @@ this._setupRenderer(); this.context = this._outputContext; // API required by tests + + // for use with qunit tests + this._numGlMaxTextureErrors = 0; + } // Public API required by all Drawer implementations @@ -274,6 +278,7 @@ let maxTextures = this._gl.getParameter(this._gl.MAX_TEXTURE_IMAGE_UNITS); if(maxTextures <= 0){ + this._numGlMaxTextureErrors += 1; $.console.error(`There was a WebGL problem: bad value for MAX_TEXTURE_IMAGE_UNITS (${maxTextures})`); return; } diff --git a/test/modules/multi-image.js b/test/modules/multi-image.js index 7edf894f..25fa5528 100644 --- a/test/modules/multi-image.js +++ b/test/modules/multi-image.js @@ -7,7 +7,7 @@ function runDrawerTests(drawerType){ - QUnit.module( 'Multi-Image-'+drawerType, { + QUnit.module.only( 'Multi-Image-'+drawerType, { beforeEach: function() { $( '
' ).appendTo( "#qunit-fixture" ); @@ -22,6 +22,10 @@ }, afterEach: function() { if (viewer){ + let errors = viewer.drawer._numGlMaxTextureErrors; + if(errors > 0){ + console.log('Number of times MAX_TEXTURE_IMAGE_UNITS had a bad value:', errors); + } viewer.destroy(); }