You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Draw calls are the hottest operation in the API tight loops. It's highly desirable for WebGPU to minimize the overhead associated with them. Here are the things we either have to validate, or may need to validate, per draw:
ensure that there is an active pipeline
ensure the active bind groups have compatible layouts with the pipeline layout of the active pipeline
check that vertex/instance range is within all of the relevant vertex buffer slices (some are per-vertex, some are per-instance).
check the minimum binding sizes for buffer bindings, which weren't specified in bind group layout - Make minBufferBindingSize optional #874. For each such binding, we need to consider the size passed to bind group creation (for the active bind groups) and compare it with the shader requirements, reflected by the active pipeline.
This list is kind of concerning. 4) 5) 6) and 7) are all variable-length checks too and much more expensive than 1-3 (dirty bits can help for 1) and 2)). 5) can be mitigated by the application, but 4) is always a variable-length computation with overflow checks etc and makes me sad. That's also part of why 6) and 7) look unattractive.
Meeting: Moving this meta bug to post-V1, but if there are particular validations that we want to discuss moving for V1 we should file them separately.
Activity
Kangz commentedon Jul 7, 2021
This list is kind of concerning. 4) 5) 6) and 7) are all variable-length checks too and much more expensive than 1-3 (dirty bits can help for 1) and 2)). 5) can be mitigated by the application, but 4) is always a variable-length computation with overflow checks etc and makes me sad. That's also part of why 6) and 7) look unattractive.
litherum commentedon Jul 12, 2021
I’d really love to see measured costs here.
kainino0x commentedon Jan 20, 2022
Meeting: Moving this meta bug to post-V1, but if there are particular validations that we want to discuss moving for V1 we should file them separately.
kdashg commentedon Jan 22, 2022
WGSL meeting minutes 2022-01-19