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

Skip to content
Merged
Changes from 3 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
40 changes: 20 additions & 20 deletions spec/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1950,6 +1950,9 @@ dictionary GPUBindGroupLayoutEntry {
// Used for uniform buffer and storage buffer bindings.
boolean hasDynamicOffset = false;

// Used for uniform buffer and storage buffer bindings.
GPUSize64 minBufferBindingSize = 0;

// Used for sampled texture and storage texture bindings.
GPUTextureViewDimension viewDimension;

Expand All @@ -1962,6 +1965,8 @@ dictionary GPUBindGroupLayoutEntry {
};
</script>

Issue(https://github.com/gpuweb/gpuweb/issues/851): consider making `textureComponentType` and `storageTextureFormat` truly optional.

<dl dfn-type=dict-member dfn-for=GPUBindGroupLayoutEntry>
: <dfn>binding</dfn>
::
Expand Down Expand Up @@ -2105,8 +2110,8 @@ A {{GPUBindGroupLayout}} object has the following internal slots:
{{GPUBindingType/"storage-buffer"}}, or
{{GPUBindingType/"readonly-storage-buffer"}},
ensure
|bindingDescriptor|.{{GPUBindGroupLayoutEntry/hasDynamicOffset}}
is `false`.
|bindingDescriptor|.{{GPUBindGroupLayoutEntry/hasDynamicOffset}} is `false`,
and |bindingDescriptor|.{{GPUBindGroupLayoutEntry/minBufferBindingSize}} is zero.
1. If |bindingDescriptor|.{{GPUBindGroupLayoutEntry/type}} is **not**
{{GPUBindingType/"sampled-texture"}},
{{GPUBindingType/"readonly-storage-texture"}}, or
Expand Down Expand Up @@ -2188,24 +2193,7 @@ A {{GPUBindGroupLayout}} object has the following internal slots:
Two {{GPUBindGroupLayout}} objects |a| and |b| are considered <dfn dfn>group-equivalent</dfn>
if and only if, for any binding number |binding|, one of the following is true:
- it's missing from both |a|.{{GPUBindGroupLayout/[[entryMap]]}} and |b|.{{GPUBindGroupLayout/[[entryMap]]}}.
- |a|.{{GPUBindGroupLayout/[[entryMap]]}}[|binding|] is [=entry-equivalent=] to |b|.{{GPUBindGroupLayout/[[entryMap]]}}[|binding|]
</div>

<div algorithm>
Two {{GPUBindGroupLayoutEntry}} entries |a| and |b| are considered <dfn dfn>entry-equivalent</dfn> if all of the conditions are true:

1. |a|.{{GPUBindGroupLayoutEntry/binding}} == |b|.{{GPUBindGroupLayoutEntry/binding}}
1. |a|.{{GPUBindGroupLayoutEntry/visibility}} == |b|.{{GPUBindGroupLayoutEntry/visibility}}
1. |a|.{{GPUBindGroupLayoutEntry/type}} == |b|.{{GPUBindGroupLayoutEntry/type}}
1. if |a|.{{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/"uniform-buffer"}}, {{GPUBindingType/"storage-buffer"}}, or {{GPUBindingType/"readonly-storage-buffer"}}, then:
- |a|.{{GPUBindGroupLayoutEntry/hasDynamicOffset}} == |b|.{{GPUBindGroupLayoutEntry/hasDynamicOffset}}
1. if |a|.{{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/"sampled-texture"}}, then:
- |a|.{{GPUBindGroupLayoutEntry/viewDimension}} == |b|.{{GPUBindGroupLayoutEntry/viewDimension}}
- |a|.{{GPUBindGroupLayoutEntry/textureComponentType}} == |b|.{{GPUBindGroupLayoutEntry/textureComponentType}}
- |a|.{{GPUBindGroupLayoutEntry/multisampled}} == |b|.{{GPUBindGroupLayoutEntry/multisampled}}
1. if |a|.{{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/"readonly-storage-texture"}} or {{GPUBindingType/"writeonly-storage-texture"}}, then:
- |a|.{{GPUBindGroupLayoutEntry/viewDimension}} == |b|.{{GPUBindGroupLayoutEntry/viewDimension}}
- |a|.{{GPUBindGroupLayoutEntry/storageTextureFormat}} == |b|.{{GPUBindGroupLayoutEntry/storageTextureFormat}}
- |a|.{{GPUBindGroupLayout/[[entryMap]]}}[|binding|] == |b|.{{GPUBindGroupLayout/[[entryMap]]}}[|binding|]
</div>

If bind groups layouts are [=group-equivalent=] they can be interchangeably used in all contents.
Expand Down Expand Up @@ -2379,9 +2367,14 @@ A {{GPUBindGroup}} object has the following internal slots:
with {{GPUBufferUsage/STORAGE}} flag.
1. The bound part designated by |bufferBinding|.{{GPUBufferBinding/offset}} and
|bufferBinding|.{{GPUBufferBinding/size}} must reside inside the buffer.
1. The effective binding size, that is either explict in |bufferBinding|.{{GPUBufferBinding/size}}
or derived from |bufferBinding|.{{GPUBufferBinding/offset}} and the full size of the buffer,
is greater or equal to |layoutBinding|.{{GPUBindGroupLayoutEntry/minBufferBindingSize|GPUBindGroupLayoutEntry.minBufferBindingSize}}.
</div>
</div>

Issue: define the "effective buffer binding size" separately.

## GPUPipelineLayout ## {#pipeline-layout}

A {{GPUPipelineLayout}} defines the mapping between resources of all {{GPUBindGroup}} objects set up during command encoding in {{GPUProgrammablePassEncoder/setBindGroup(index, bindGroup, dynamicOffsets)|setBindGroup}}, and the shaders of the pipeline set by {{GPURenderEncoderBase/setPipeline(pipeline)|GPURenderEncoderBase.setPipeline}} or {{GPUComputePassEncoder/setPipeline(pipeline)|GPUComputePassEncoder.setPipeline}}.
Expand Down Expand Up @@ -2757,6 +2750,13 @@ A {{GPUProgrammableStageDescriptor}} describes the entry point in the user-provi
the |binding| has to be a read-only storage buffer.
1. If |entry|.{{GPUBindGroupLayoutEntry/type}} is {{GPUBindingType/"sampled-texture"}}, {{GPUBindingType/"readonly-storage-texture"}}, or {{GPUBindingType/"writeonly-storage-texture"}},
the shader view dimension of the texture has to match |entry|.{{GPUBindGroupLayoutEntry/viewDimension}}.
1. If |entry|.{{GPUBindGroupLayoutEntry/minBufferBindingSize}} is not zero:
- if the corresponding structure defined in the shader has the last field being an unbound array type,
then the value of |entry|.{{GPUBindGroupLayoutEntry/minBufferBindingSize}} must be greater or equal to the
byte offset of that field plus the stride of the unbound array.
- if the corresponding shader structure doesn't end with an unbound array type,
then the value of |entry|.{{GPUBindGroupLayoutEntry/minBufferBindingSize}} must be greater or equal to the
size of the structure.
</div>

Issue: is there a match/switch statement in bikeshed?
Expand Down