-
Notifications
You must be signed in to change notification settings - Fork 3
feat:implement WebGL vertex attribute methods #205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@EndlessJour9527 You can run |
acf34c9 to
dec5b43
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements WebGL vertex attribute methods and buffer clearing operations. The implementation adds support for setting generic vertex attributes with float values (vertexAttrib1f/2f/3f/4f) and integer values (vertexAttribI4i/ui/iv/uiv), as well as selective buffer clearing methods (clearBufferfv/iv/uiv/fi) as specified in the WebGL 2.0 specification.
- Adds command buffer support for vertex attribute operations with proper parameter validation and type checking
- Implements selective buffer clearing operations with command buffer serialization
- Provides both WebGLAttribLocation and index-based attribute setting for compatibility
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/renderer/render_api_opengles.cpp | Added OpenGL ES command handlers for vertex attribute and buffer clearing operations |
| src/common/command_buffers/shared.hpp | Added command buffer type definitions for new vertex attribute and buffer operations |
| src/common/command_buffers/macros.hpp | Added command buffer macro definitions for new operations |
| src/common/command_buffers/details/vertex_attrib.hpp | Implemented command buffer request classes for vertex attribute operations |
| src/common/command_buffers/details/clear.hpp | Implemented command buffer request classes for buffer clearing operations |
| src/client/graphics/webgl_context.hpp | Added method declarations for vertex attribute and buffer operations |
| src/client/graphics/webgl_context.cpp | Implemented WebGL context methods for vertex attributes and buffer clearing |
| src/bindings/webgl/rendering_context.hpp | Added JavaScript binding declarations for new WebGL methods |
| src/bindings/webgl/rendering_context.cpp | Implemented JavaScript bindings for WebGL2 methods |
| src/bindings/webgl/rendering_context-inl.hpp | Added template implementations for base WebGL vertex attribute methods |
| fixtures/html/clearbufferfv-test.html | Added test HTML file for clearBufferfv functionality |
| docs/manual/references/webgl.md | Updated documentation to remove "not implemented" markers |
…e argument The 4th argument (stride) of vertexAttribIPointer should be validated as a number, not a boolean. This fixes the incorrect type checking that was causing validation errors.
src/renderer/render_api_opengles.cpp
Outdated
| GLint drawbuffer = req->drawbuffer; | ||
| const GLfloat *value = req->values.data(); | ||
| glClearBufferfv(buffer, drawbuffer, value); | ||
| GLenum error = glGetError(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't check the GL error here.
implement WebGL vertex attribute methods
Add vertexAttrib1f/2f/3f/4f methods for setting vertex attributes
Add vertexAttribI4i/4ui/4iv/4uiv methods for integer vertex attributes
Implement command buffer support for vertex attribute operations
Add proper parameter validation and type checking
Support both WebGLAttribLocation and index-based attribute setting"
implement WebGL buffer operations
Add clearBufferfv/iv/uiv/fi methods for selective buffer clearing
Add command buffer support for buffer operations
Improve command buffer response handling with timeout detection
Add proper serialization for pixel data transfer"
test case
gl-bindAttribLocation-aliasing-inactive
clearbufferfv-with-alpha-false