Skip to content

Conversation

@yorkie
Copy link
Collaborator

@yorkie yorkie commented Jul 4, 2025

No description provided.

@yorkie yorkie requested a review from Copilot July 14, 2025 17:31

This comment was marked as outdated.

@yorkie yorkie requested a review from Copilot July 16, 2025 09:49
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 adds WebGPU backend support to the graphics system by implementing infrastructure for recording and submitting draw calls on render textures. The changes focus on introducing a new RHI abstraction layer, refactoring the existing OpenGL code, and implementing WebGPU command buffer patterns.

Key changes:

  • Introduces TrRenderHardwareInterface (RHI) abstraction to replace the existing RenderAPI system, providing better support for multiple graphics backends including WebGPU
  • Implements GPU command buffer infrastructure with WebGPU-style command encoders, render pass encoders, and command execution patterns
  • Refactors rendering pipeline to support multiple execution passes (default frame, XR frame, offscreen pass) and improved context management

Reviewed Changes

Copilot reviewed 88 out of 89 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/renderer/render_api.hpp/cpp Core RHI abstraction layer replacing RenderAPI with factory pattern
src/renderer/gles/* OpenGL ES implementation of GPU command buffer system
src/renderer/renderer.hpp/cpp Updated renderer to use RHI and support multiple rendering passes
src/renderer/content_renderer.hpp/cpp Enhanced content renderer with offscreen pass support
src/common/command_buffers/gpu/* New WebGPU-style command buffer infrastructure
src/common/command_buffers/details/* Updated command buffer requests with copy constructors
Comments suppressed due to low confidence (1)

if (__system_property_get("jsar.renderer.clear_stencil", disableStencilClearStr) >= 0)
{
if (strcmp(disableStencilClearStr, "no") == 0 ||
strcmp(disableStencilClearStr, "disable"))
Copy link

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing equality comparison operator in the second strcmp call. Should be strcmp(disableStencilClearStr, "disable") == 0 to properly check if the string equals "disable".

Suggested change
strcmp(disableStencilClearStr, "disable"))
strcmp(disableStencilClearStr, "disable") == 0)

Copilot uses AI. Check for mistakes.
GL_TEXTURE_INTERNAL_FORMAT,
&attachment_object->texture_internal_format_);
GLenum textarget = attachment_object->texture_target_;
glGetIntegerv(textarget, &current_texture_binding);
Copy link

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect use of glGetIntegerv with texture target. Should use the appropriate binding constant like GL_TEXTURE_BINDING_2D instead of the texture target enum directly.

Suggested change
glGetIntegerv(textarget, &current_texture_binding);
GLenum binding_constant = 0;
if (textarget == GL_TEXTURE_2D)
binding_constant = GL_TEXTURE_BINDING_2D;
else if (textarget == GL_TEXTURE_2D_ARRAY)
binding_constant = GL_TEXTURE_BINDING_2D_ARRAY;
else if (textarget == GL_TEXTURE_2D_MULTISAMPLE)
binding_constant = GL_TEXTURE_BINDING_2D_MULTISAMPLE;
else
assert(false && "Unsupported texture target.");
glGetIntegerv(binding_constant, &current_texture_binding);

Copilot uses AI. Check for mistakes.
return *contentRenderer;
}

bool ContextGLApp::shouleExecuteDrawOnCurrent(GLsizei count)
Copy link

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in method name: 'shouleExecuteDrawOnCurrent' should be 'shouldExecuteDrawOnCurrent'.

Suggested change
bool ContextGLApp::shouleExecuteDrawOnCurrent(GLsizei count)
bool ContextGLApp::shouldExecuteDrawOnCurrent(GLsizei count)

Copilot uses AI. Check for mistakes.
@yorkie yorkie merged commit 763d100 into main Jul 16, 2025
2 checks passed
@yorkie yorkie deleted the feat/init-webgpu-backend branch July 16, 2025 10:38
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.

2 participants