WebGL2: Implement gl.getParameter(gl.UNIFORM_BUFFER_OFFSET_ALIGNMENT)#415
Merged
Conversation
Co-authored-by: EndlessJour9527 <155411404+EndlessJour9527@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix gl.getParameter returning undefined for UNIFORM_BUFFER_OFFSET_ALIGNMENT
WebGL2: Implement gl.getParameter(gl.UNIFORM_BUFFER_OFFSET_ALIGNMENT)
Nov 17, 2025
EndlessJour9527
approved these changes
Nov 18, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements support for gl.getParameter(gl.UNIFORM_BUFFER_OFFSET_ALIGNMENT) in WebGL2 contexts, fixing a conformance issue where the method previously returned undefined instead of the platform-specific alignment value.
- Queries the GL implementation for
GL_UNIFORM_BUFFER_OFFSET_ALIGNMENTduring context initialization - Stores and returns the value through the existing parameter query infrastructure
- Follows the established pattern used by other WebGL2 context parameters
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/renderer/render_api_opengles.cpp | Added glGetIntegerv query for GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT during WebGL2 context initialization |
| src/common/command_buffers/details/webgl_context_init.hpp | Added uniformBufferOffsetAlignment field to copy constructor and response structure |
| src/client/graphics/webgl_context.hpp | Added enum entry kUniformBufferOffsetAlignment and member variable declaration |
| src/client/graphics/webgl_context.cpp | Added initialization from response and return logic in getParameterV2() |
| src/client/script_bindings/webgl/webgl_rendering_context.cpp | Added case handler for WEBGL2_UNIFORM_BUFFER_OFFSET_ALIGNMENT in parameter retrieval |
yorkie
approved these changes
Nov 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
gl.getParameter(gl.UNIFORM_BUFFER_OFFSET_ALIGNMENT)returnsundefinedinstead of the platform-specific alignment value (typically 256/512/1024). This breaks WebGL2 conformance tests and libraries using uniform buffer objects.Changes
Backend (renderer)
GL_UNIFORM_BUFFER_OFFSET_ALIGNMENTviaglGetIntegerv()during WebGL2 context initializationWebGL2ContextInitCommandBufferResponseClient (context)
WebGL2Context::uniformBufferOffsetAlignmentkUniformBufferOffsetAlignmenttoWebGL2IntegerParameterNameenumgetParameterV2()when requestedThe constant was already exported to JavaScript bindings; only the query/storage path was missing.
Example Usage
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.