Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions spec/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -703,12 +703,20 @@ This specification defines the following [=usage scopes=]:
2. an individual command on a {{GPUComputePassEncoder}}, such as {{GPUProgrammablePassEncoder/setBindGroup(index, bindGroup, dynamicOffsets)|GPUProgrammablePassEncoder.setBindGroup}}.
3. the whole {{GPURenderPassEncoder}}.

Note: calling {{GPUProgrammablePassEncoder/setBindGroup(index, bindGroup, dynamicOffsets)|GPUProgrammablePassEncoder.setBindGroup}}
adds the {{GPUBindGroup/[[usedResources]]}} to the [=usage scope=]
regardless of whether the shader or {{GPUPipelineLayout}} actually depends on these bindings.
Similarly {{GPURenderEncoderBase/setIndexBuffer()|GPURenderEncoderBase.setIndexBuffer}}
add the index buffer to the usage scope (as [=internal usage/input=])
regardless of whether the indexed draw calls are used afterwards.
<div class=note>
Resources that are used in state setting calls are always added as used resources in the containing [=usage scope=].
This means the following example resource usages **are** included in usage scope validation:

- Resources used in every {{GPUProgrammablePassEncoder/setBindGroup(index, bindGroup, dynamicOffsets)|GPUProgrammablePassEncoder.setBindGroup}}
regardless of whether the shader or {{GPUPipelineLayout}} actually depends on these bindings, or the bind group is shadowed by another 'set' call.
- Vertex buffer used in every {{GPURenderEncoderBase/setVertexBuffer()|GPURenderEncoderBase.setVertexBuffer}}
regardless of whether draw call depends on this buffer, or this buffer is shadowed by another 'set' call.
- Index buffer used in every {{GPURenderEncoderBase/setIndexBuffer()|GPURenderEncoderBase.setIndexBuffer}}
regardless of whether draw call depends on this buffer, or this buffer is shadowed by another 'set' call.
- Textures used as color attachments, resolve attachments or depth/stencil attachment in {{GPURenderPassDescriptor}} by {{GPUCommandEncoder/beginRenderPass()|GPUCommandEncoder.beginRenderPass()}}
regardless of whether the shader actually depends on these attachments.
- Resources used in bind group entries with visibility 0, or visible only to the the compute stage but used in a render pass or vice versa.
</div>

The [=usage scopes=] are validated at {{GPUCommandEncoder/finish()|GPUCommandEncoder.finish}} time.
The implementation performs the <dfn dfn>usage scope validation</dfn> by composing
Expand Down