-
Notifications
You must be signed in to change notification settings - Fork 345
Closed
Description
Recently I am working on validation rules for resource usage tracking. Basically, multiple reads upon the same resource (buffer/texture) is allowed, but read and write, or multiple writes upon the same resource is not allowed. But a few issues/details need to be clarified:
- overwritten bindings, unused/invisible bindings, see the discussion at Should various unused resource usages be counted toward usage scopes? #657
- usage tracking for buffer should be done per the entire buffer, and usage tracking for texture should be done per each subresource. So reading from one part of a buffer and write into another part of the buffer is not allowed, while reading from a level/layer of a texture and write into another level/layer of the texture is allowed.
- Resource usage tracking for render should be done per each pass, while resource usage tracking for compute should be done per each dispatch call. This means that write into one buffer/texture in one draw, and then read from that buffer/texture in another draw in the same pass is not allowed in render. But it is allowed between dispatch calls in compute.
- Multiple writes upon the same resource is not allowed, but there are exceptions: race condition about multiple writes for storage buffer/texture is allowed for render. Further question is: how about race condition about multiple writes for storage buffer/texture for compute?
- All validation rules should work on corresponding APIs (SetBindGroup, SetVertexBuffer, DrawIndirect, etc) via both direct commands and commands in bundle.
Rules 2 - 4 are somehow discussed at [Usage Validation Rules] (https://github.com/gpuweb/gpuweb/blob/master/design/UsageValidationRules.md) . But that document was written 2 year ago. I'd like to clarify all these details, and maybe write some text in spec if needed.
Metadata
Metadata
Assignees
Labels
No labels