diff --git a/spec/index.bs b/spec/index.bs index 1abdac2585..26d529bf48 100644 --- a/spec/index.bs +++ b/spec/index.bs @@ -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; @@ -1962,6 +1965,8 @@ dictionary GPUBindGroupLayoutEntry { }; +Issue(https://github.com/gpuweb/gpuweb/issues/851): consider making `textureComponentType` and `storageTextureFormat` truly optional. +
: binding :: @@ -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 @@ -2188,24 +2193,7 @@ A {{GPUBindGroupLayout}} object has the following internal slots: Two {{GPUBindGroupLayout}} objects |a| and |b| are considered group-equivalent 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|] - - -
-Two {{GPUBindGroupLayoutEntry}} entries |a| and |b| are considered entry-equivalent 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|]
If bind groups layouts are [=group-equivalent=] they can be interchangeably used in all contents. @@ -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 than or equal to |layoutBinding|.{{GPUBindGroupLayoutEntry/minBufferBindingSize|GPUBindGroupLayoutEntry.minBufferBindingSize}}. +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}}. @@ -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 last field of the corresponding structure defined in the shader has an unbounded array type, + then the value of |entry|.{{GPUBindGroupLayoutEntry/minBufferBindingSize}} must be greater than or equal to the + byte offset of that field plus the stride of the unbounded array. + - If the corresponding shader structure doesn't end with an unbounded array type, + then the value of |entry|.{{GPUBindGroupLayoutEntry/minBufferBindingSize}} must be greater than or equal to the + size of the structure. Issue: is there a match/switch statement in bikeshed?