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.
GpuUniformBufferPipe
syncGPU
toBuffer.setDataWithSize
馃 Generated by Copilot at 6601827
Summary
馃殌馃敡馃悰
This pull request refactors and optimizes the WebGPU renderer and the buffer class, and updates the related modules and tests accordingly. It removes the
GpuUniformBufferPipe
class and its usage, and adds asyncGPU
parameter to theBuffer
class and thesetDataWithSize
methods to control the GPU buffer updates. It also fixes a bug in theBuffer
class that could cause the update size to be zero.Walkthrough
syncGPU
parameter to thesetDataWithSize
methods of theBuffer
andBatcherPipe
classes, which controls whether the buffer data should be updated on the GPU immediately or deferred until the next render call (link, link, link, link, link)Buffer
class that prevented the buffer from being updated when the update size was zero, by using the nullish coalescing operator instead of the logical OR operator to assign the_updateSize
property (link)true
to thesyncGPU
parameter of the setter for thedata
property of theBuffer
class, to maintain the previous behavior of the buffer class and update the buffer data on the GPU by default (link)Buffer
andBatcherPipe
classes to the new API, by passing the appropriate value for thesyncGPU
parameter depending on the context and the rendering requirements (link, link, link, link, link, link, link)Buffer
class that cover the behavior of thesetDataWithSize
method when thesyncGPU
parameter isfalse
, and expect the buffer data to not be updated on the GPU immediately and theupdate
event to not be emitted (link)GpuUniformBufferPipe
class and its references from theWebGPURenderer
andLayerSystem
modules (link, link, link, link)