forked from google/skia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[graphite] BufferManager: support pre-zeroed storage buffer creation
It is sometimes desirable for a GPU-private buffer to have its contents pre-initialized to well-defined values before being consumed by a compute program. A common example are atomic counters that live in device memory (e.g. bump allocator counters or indirect command buffer fields) that a compute shader cannot reasonably initialize to 0 itself when cross-workgroup synchronization primitives aren't available (notably both Metal and WebGPU lack a device-scope barrier instruction). This change introduces the `ClearBuffer` flag parameter to the `DrawBufferManager::getStorage()` method. When set to `ClearBuffer::kYes`, DrawBufferManager schedules a sub-allocated buffer region to be set to zero. These requests are accummulated in a list and batched into a single `ClearBuffersTask` when buffers get transferred to a recording. Bug: b/243721614 Change-Id: I66c27c42624728f08f56e2db93413410795c4187 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/665582 Reviewed-by: Jim Van Verth <[email protected]> Commit-Queue: Arman Uguray <[email protected]> Reviewed-by: Michael Ludwig <[email protected]>
- Loading branch information
Showing
7 changed files
with
163 additions
and
26 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
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