Add WebGPU backend to support the record/submit draw calls on render textures#94
Add WebGPU backend to support the record/submit draw calls on render textures#94
Conversation
There was a problem hiding this comment.
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")) |
There was a problem hiding this comment.
Missing equality comparison operator in the second strcmp call. Should be strcmp(disableStencilClearStr, "disable") == 0 to properly check if the string equals "disable".
| strcmp(disableStencilClearStr, "disable")) | |
| strcmp(disableStencilClearStr, "disable") == 0) |
| GL_TEXTURE_INTERNAL_FORMAT, | ||
| &attachment_object->texture_internal_format_); | ||
| GLenum textarget = attachment_object->texture_target_; | ||
| glGetIntegerv(textarget, ¤t_texture_binding); |
There was a problem hiding this comment.
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.
| glGetIntegerv(textarget, ¤t_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, ¤t_texture_binding); |
| return *contentRenderer; | ||
| } | ||
|
|
||
| bool ContextGLApp::shouleExecuteDrawOnCurrent(GLsizei count) |
There was a problem hiding this comment.
Typo in method name: 'shouleExecuteDrawOnCurrent' should be 'shouldExecuteDrawOnCurrent'.
| bool ContextGLApp::shouleExecuteDrawOnCurrent(GLsizei count) | |
| bool ContextGLApp::shouldExecuteDrawOnCurrent(GLsizei count) |
No description provided.