Fix WebGL2 getParameter() returning undefined for state and pixel store parameters #423
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
30 WebGL2 parameters were missing from the
getParameter()switch statement, causing them to returnundefinedinstead of their OpenGL state values. This breaks conformance tests and application logic that queries pixel store settings, draw buffer bindings, or capability states.Changes
Added to
WebGLBooleanParameterNameenum (3 parameters):SAMPLE_ALPHA_TO_COVERAGE,SAMPLE_COVERAGE- capability statesRASTERIZER_DISCARD- WebGL2 capability stateAdded to
WebGL2IntegerParameterNameenum (27 parameters):PACK_ROW_LENGTH,PACK_SKIP_PIXELS,PACK_SKIP_ROWS,UNPACK_ROW_LENGTH,UNPACK_IMAGE_HEIGHT,UNPACK_SKIP_PIXELS,UNPACK_SKIP_ROWS,UNPACK_SKIP_IMAGESFRAGMENT_SHADER_DERIVATIVE_HINT,READ_BUFFER,DRAW_BUFFER0throughDRAW_BUFFER15,UNIFORM_BUFFER_OFFSET_ALIGNMENTUpdated switch cases in
GetParameter():Example
All constants already existed in
webgl_constants.hpp—they were simply not wired through the parameter query path.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
registry.npmmirror.comnpm ci(dns block)npm install(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.