Skip to content

Conversation

@EndlessJour9527
Copy link
Collaborator

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

@yorkie
Copy link
Member

yorkie commented Aug 12, 2025

@EndlessJour9527 You can run sh ./tools/clang-format-fix.sh to fix the lint errors.

@EndlessJour9527 EndlessJour9527 force-pushed the feat/imp-vertex-attributes branch from acf34c9 to dec5b43 Compare August 13, 2025 05:58
@yorkie yorkie requested review from Copilot and yorkie August 13, 2025 08:45
Copy link
Contributor

Copilot AI left a 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

Yjh added 3 commits August 14, 2025 16:46
…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.
GLint drawbuffer = req->drawbuffer;
const GLfloat *value = req->values.data();
glClearBufferfv(buffer, drawbuffer, value);
GLenum error = glGetError();
Copy link
Member

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.

@yorkie yorkie merged commit 7f2afee into main Aug 20, 2025
2 checks passed
@yorkie yorkie deleted the feat/imp-vertex-attributes branch August 20, 2025 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants