Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

v8 Batcher optimisation #9824

Merged
merged 1 commit into from
Nov 1, 2023
Merged

v8 Batcher optimisation #9824

merged 1 commit into from
Nov 1, 2023

Conversation

GoodBoyDigital
Copy link
Member

@GoodBoyDigital GoodBoyDigital commented Nov 1, 2023

  • removed old file GpuUniformBufferPipe
  • added syncGPU to Buffer.setDataWithSize
  • optimised batcher
  • added tests

馃 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 a syncGPU parameter to the Buffer class and the setDataWithSize methods to control the GPU buffer updates. It also fixes a bug in the Buffer class that could cause the update size to be zero.

To optimize the WebGPU renderer
They refactored the Buffer and Batcher
They added syncGPU to setDataWithSize
And removed some code that was not wise
Now the graphics are faster and much snazzier

Walkthrough

  • Optimize buffer updates and reduce GPU data transfers by adding a syncGPU parameter to the setDataWithSize methods of the Buffer and BatcherPipe 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)
  • Fix a bug in the 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)
  • Add a default value of true to the syncGPU parameter of the setter for the data property of the Buffer class, to maintain the previous behavior of the buffer class and update the buffer data on the GPU by default (link)
  • Adapt the existing code that uses the Buffer and BatcherPipe classes to the new API, by passing the appropriate value for the syncGPU parameter depending on the context and the rendering requirements (link, link, link, link, link, link, link)
  • Add new test cases for the Buffer class that cover the behavior of the setDataWithSize method when the syncGPU parameter is false, and expect the buffer data to not be updated on the GPU immediately and the update event to not be emitted (link)
  • Refactor the WebGPU rendering pipeline and remove unused code by deleting the GpuUniformBufferPipe class and its references from the WebGPURenderer and LayerSystem modules (link, link, link, link)

- added `syncGPU` to  `Buffer.setDataWithSize`
- optimised batcher
- added tests
Copy link

codesandbox-ci bot commented Nov 1, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 6601827:

Sandbox Source
pixi.js-sandbox Configuration

@Zyie Zyie merged commit 42f95c7 into next-v8 Nov 1, 2023
4 checks passed
@Zyie Zyie deleted the chore/v8/buffer-optimisation branch November 1, 2023 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants