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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compute passes with shared usage scope #2659

Open
fintelia opened this issue May 15, 2022 · 1 comment
Open

Compute passes with shared usage scope #2659

fintelia opened this issue May 15, 2022 · 1 comment
Labels
area: performance How fast things go help required We need community help to make this happen. type: enhancement New feature or request

Comments

@fintelia
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Right now, wgpu automatically inserts barriers between any two compute shader dispatches that write to the same buffer. This is necessary in the general case because the programmer may be relying on the dispatches happening sequentially. However, if it is safe to run the dispatches in parallel (say because they write to different regions of the buffer, or use atomics to avoid conflicting with one another) then this can be very wasteful.

Describe the solution you'd like
A field on ComputePassDescriptor to indicate whether the whole pass should be one usage scope, instead of the current statregy of a usage scope per dispatch.

Describe alternatives you've considered
The user can accept reduced performance or devise potentially complicated schemes to merge all their dispatches into one.

@fintelia fintelia changed the title Compute passes with singe usage scope Compute passes with shared usage scope May 15, 2022
@cwfitzgerald
Copy link
Member

cwfitzgerald commented May 15, 2022

For information:

We will likely implement this using a member of the compute pass descriptor:

enum ComputePassType {
    // One usage scope per dispatch
    Serial,
    // One usage scope per pass
    Concurrent,
}

This would manifest as wgpu keeping track of a compute pass as a single usage scope. On metal we would supply https://developer.apple.com/documentation/metal/mtldispatchtype to the compute pass arugments.

@cwfitzgerald cwfitzgerald added type: enhancement New feature or request help required We need community help to make this happen. area: performance How fast things go labels May 15, 2022
@jimblandy jimblandy moved this to Todo in wgpu for bevy Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: performance How fast things go help required We need community help to make this happen. type: enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

2 participants