@@ -24,6 +24,7 @@ const WebGLConstants = [
24
24
'RENDERER' ,
25
25
'SHADING_LANGUAGE_VERSION' ,
26
26
'STENCIL_BITS' ,
27
+ 'VENDOR' ,
27
28
'VERSION'
28
29
]
29
30
@@ -65,10 +66,6 @@ const Categories = {
65
66
'MAX_COMBINED_UNIFORM_BLOCKS' ,
66
67
'MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS' ,
67
68
] ,
68
- 'debugRendererInfo' : [
69
- 'UNMASKED_VENDOR_WEBGL' ,
70
- 'UNMASKED_RENDERER_WEBGL' ,
71
- ] ,
72
69
'fragmentShader' : [
73
70
'MAX_FRAGMENT_UNIFORM_VECTORS' ,
74
71
'MAX_TEXTURE_IMAGE_UNITS' ,
@@ -124,7 +121,11 @@ const Categories = {
124
121
'MAJOR_PERFORMANCE_CAVEAT' ,
125
122
'RENDERER' ,
126
123
'SHADING_LANGUAGE_VERSION' ,
124
+ 'VENDOR' ,
127
125
'VERSION' ,
126
+ 'UNMASKED_VENDOR_WEBGL' ,
127
+ 'UNMASKED_RENDERER_WEBGL' ,
128
+
128
129
] ,
129
130
}
130
131
@@ -194,13 +195,14 @@ const getShaderPrecisionFormat = (context, shaderType) => {
194
195
}
195
196
196
197
// https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_debug_renderer_info
197
- const getUnmasked = ( context , constant ) => {
198
+ const getUnmasked = ( contextType , context , constant ) => {
198
199
try {
199
200
const extension = context . getExtension ( 'WEBGL_debug_renderer_info' )
200
201
const unmasked = context . getParameter ( extension [ constant ] )
201
202
return unmasked
202
- } catch ( error ) {
203
- return undefined
203
+ } catch ( e ) {
204
+ log_error ( 10 , contextType + '_' + constant , e )
205
+ return zErr
204
206
}
205
207
}
206
208
@@ -266,8 +268,8 @@ function getWebGL(contextType) {
266
268
VERTEX_SHADER_BEST_FLOAT_PRECISION : Object . values ( VERTEX_SHADER . HIGH_FLOAT ) ,
267
269
FRAGMENT_SHADER ,
268
270
FRAGMENT_SHADER_BEST_FLOAT_PRECISION : Object . values ( FRAGMENT_SHADER . HIGH_FLOAT ) ,
269
- UNMASKED_VENDOR_WEBGL : getUnmasked ( context , 'UNMASKED_VENDOR_WEBGL' ) ,
270
- UNMASKED_RENDERER_WEBGL : getUnmasked ( context , 'UNMASKED_RENDERER_WEBGL' )
271
+ UNMASKED_VENDOR_WEBGL : getUnmasked ( contextType , context , 'UNMASKED_VENDOR_WEBGL' ) ,
272
+ UNMASKED_RENDERER_WEBGL : getUnmasked ( contextType , context , 'UNMASKED_RENDERER_WEBGL' )
271
273
}
272
274
273
275
const glConstants = [ ...WebGLConstants , ...( supportsWebGL2 ? WebGL2Constants : [ ] ) ]
@@ -299,9 +301,6 @@ function getWebGL(contextType) {
299
301
errors . push ( [ 'parameters' , e + '' ] ) // 'parameters blocked'
300
302
}
301
303
302
- const gpuVendor = parameters . UNMASKED_VENDOR_WEBGL
303
- const gpuRenderer = parameters . UNMASKED_RENDERER_WEBGL
304
-
305
304
// Structure parameter data
306
305
let components = { }
307
306
if ( parameters ) {
@@ -320,16 +319,16 @@ function getWebGL(contextType) {
320
319
}
321
320
322
321
data = {
323
- gpuRenderer,
324
- gpuVendor,
325
322
...components ,
326
323
webGLExtensions
327
324
}
328
325
return [ data , errors ]
329
326
}
330
327
331
328
const outputWebGL = ( ) => new Promise ( resolve => {
332
- //return resolve()
329
+ if ( isFile ) {
330
+ return resolve ( )
331
+ }
333
332
334
333
Promise . all ( [
335
334
getWebGL ( 'webgl' ) ,
0 commit comments