-
-
Notifications
You must be signed in to change notification settings - Fork 828
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wgpu: Allow unaligned writes to IndexBuffer3D
wgpu requires buffer copy sizes and offsets to be 4-byte aligned. Unfortunately, ActionScript can perform 2-byte aligned uploads into an IndexBuffer3D. To support this, we now keep a copy of the IndexBuffer3D on the CPU. When performing an upload to the buffer, we round the offset down and the size up to the nearest 4-byte aligned value. The cpu buffer is used to fill out the write with existing data, so that we don't corrupt the contents of the GPU buffer. To avoid introducing a new RefCell, I've changed IndexBuffer3D to use a `Box` instead of an `Rc` to store the trait object. This allows us to pass a mutable reference down to the backend.
- Loading branch information
Showing
12 changed files
with
1,027 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.