Problem
Some calls to context.getParameter() in the WebGL2 context in JSAR are returning the wrong JS type or an invalid value in critical conformance cases. For example:
- getParameter(context.RASTERIZER_DISCARD) should return a
boolean (false by default), but is undefined
- getParameter(context.SAMPLE_ALPHA_TO_COVERAGE) and getParameter(context.SAMPLE_COVERAGE) should return booleans
- getParameter(context.MAX_3D_TEXTURE_SIZE), getParameter(context.UNIFORM_BUFFER_OFFSET_ALIGNMENT), and similar should be non-undefined numbers (integer >= minimum)
- Certain parameters are NOT being returned as instances of Number or Boolean as required, but are
undefined or wrong type
Notable FAIL cases
- context.getParameter(context.MAX_3D_TEXTURE_SIZE) should be >= 256. Was undefined
- context.getParameter(context.MAX_3D_TEXTURE_SIZE) is not an instance of Number
- context.getParameter(context.UNIFORM_BUFFER_OFFSET_ALIGNMENT) should be >= 1. Was undefined
- context.getParameter(context.UNIFORM_BUFFER_OFFSET_ALIGNMENT) is not an instance of Number
- context.getParameter(context.RASTERIZER_DISCARD) should be false (boolean) Was undefined
- Similar errors on other boolean/numeric parameters
Expected Behavior
All type checks per WebGL2 and WebGL1 spec should pass: the returned value should always be of the correct type (Boolean, Number) and value as defined. Never undefined.
Impact
- Fails conformance and type safety tests
- Might break application logic depending on typeof/value checks
References
Suggested Actions
- Audit
getParameter implementation for value and type safety
- Match Chromium mapping for Number and Boolean return values
- Expand regression tests for typeof/instance conformance
Category: WebGL2 API type & value conformance
Problem
Some calls to
context.getParameter()in the WebGL2 context in JSAR are returning the wrong JS type or an invalid value in critical conformance cases. For example:boolean(false by default), but isundefinedundefinedor wrong typeNotable FAIL cases
Expected Behavior
All type checks per WebGL2 and WebGL1 spec should pass: the returned value should always be of the correct type (Boolean, Number) and value as defined. Never
undefined.Impact
References
Suggested Actions
getParameterimplementation for value and type safetyCategory: WebGL2 API type & value conformance