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

Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Vertex buffer and attribute validation
  • Loading branch information
kvark committed Apr 27, 2020
commit 0803e8b11b1a3955517c26341a96745b5e3c8bf4
59 changes: 56 additions & 3 deletions spec/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2085,7 +2085,10 @@ dictionary GPUPipelineLayoutDescriptor : GPUObjectDescriptorBase {

<dfn>pipeline layout device validation</dfn>: The {{GPUDevice}} must not be lost.

<dfn>pipeline layout entries validation</dfn>: There must be {{GPULimits/maxBindGroups|GPULimits.maxBindGroups}} or fewer elements in |descriptor|.{{GPUPipelineLayoutDescriptor/bindGroupLayouts}}. All these {{GPUBindGroupLayout}} entries have to be valid.
<dfn>pipeline layout entries validation</dfn>:
There must be {{GPULimits/maxBindGroups|GPULimits.maxBindGroups}} or fewer
elements in |descriptor|.{{GPUPipelineLayoutDescriptor/bindGroupLayouts}}.
All these {{GPUBindGroupLayout}} entries have to be valid.
</div>
</div>

Expand Down Expand Up @@ -2402,15 +2405,20 @@ Issue: link to the semantics of SV_SampleIndex and SV_Coverage in WGSL spec.
ensure the [$validating GPUProgrammableStageDescriptor$]({{GPUShaderStage/FRAGMENT}},
|descriptor|.{{GPURenderPipelineDescriptor/fragmentStage}},
|descriptor|.{{GPUPipelineDescriptorBase/layout}}) succeeds.
1. Ensure the |descriptor|.{{GPURenderPipelineDescriptor/colorStates}}.length is less than or equal to 8.
1. Ensure [$validating GPUVertexStateDescriptor$](|descriptor|.{{GPURenderPipelineDescriptor/vertexState}},
|descriptor|.{{GPURenderPipelineDescriptor/vertexStage}}) passes.
1. If |descriptor|.{{GPURenderPipelineDescriptor/alphaToCoverageEnabled}} is true,
ensure |descriptor|.{{GPURenderPipelineDescriptor/sampleCount}} is greater than 1.
2. If the output SV_Coverage semantics is [=statically used=] by |descriptor|.{{GPURenderPipelineDescriptor/fragmentStage}},
ensure |descriptor|.{{GPURenderPipelineDescriptor/alphaToCoverageEnabled}} is false.
</div>

Issue: Need a more detailed validation of the render states.
Issue: need a proper limit for the maximum number of color targets.

Issue: Need description of the render states.
Issue: need a more detailed validation of the render states.

Issue: need description of the render states.

### Primitive Topology ### {#primitive-topology}

Expand Down Expand Up @@ -2658,6 +2666,51 @@ dictionary GPUVertexAttributeDescriptor {
};
</script>

<dl dfn-type="abstract-op">
: <dfn>validating GPUVertexBufferLayoutDescriptor</dfn>(descriptor, vertexStage)
::
<div algorithm="validation GPUVertexBufferLayoutDescriptor(descriptor, vertexStage)">
**Arguments:**
- {{GPUVertexBufferLayoutDescriptor}} |descriptor|
- {{GPUProgrammableStageDescriptor}} |vertexStage|

Return true, if and only if, all of the following conditions are true:

1. |descriptor|.{{GPUVertexBufferLayoutDescriptor/attributes}}.length is less than or equal to 16.
1. |descritor|.{{GPUVertexBufferLayoutDescriptor/arrayStride}} is less then or equal to 2048.
1. Any attribute |at| in the list |descriptor|.{{GPUVertexBufferLayoutDescriptor/attributes}} has
|at|.{{GPUVertexAttributeDescriptor/offset} + sizeOf(|at|.{{GPUVertexAttributeDescriptor/format}} less or equal to
|descritor|.{{GPUVertexBufferLayoutDescriptor/arrayStride}}.
1. For every vertex attribute in the shader reflection of |vertexStage|.{{GPUProgrammableStageDescriptor/module}}
that is know to be [=statically used=] by |vertexStage|.{{GPUProgrammableStageDescriptor/entryPoint}},
there is a corresponding |at| element of |descriptor|.{{GPUVertexBufferLayoutDescriptor/attributes}} that:
1. The shader format is |at|.{{GPUVertexAttributeDescriptor/format}}.
2. The shader location is |at|.{{GPUVertexAttributeDescriptor/shaderLocation}}.
</div>
</dl>

Issue(https://github.com/gpuweb/gpuweb/issues/693): add a limit to the number of vertex attributes

<dl dfn-type="abstract-op">
: <dfn>validating GPUVertexStateDescriptor</dfn>(descriptor, vertexStage)
::
<div algorithm="validation GPUVertexStateDescriptor(descriptor, vertexStage)">
**Arguments:**
- {{GPUVertexStateDescriptor}} |descriptor|
- {{GPUProgrammableStageDescriptor}} |vertexStage|

Return true, if and only if, all of the following conditions are true:

1. |descriptor|.{{GPUVertexStateDescriptor/vertexBuffers}}.length is less than or equal to 8
1. Each |vertexBuffer| layout descriptor in the list |descritor|.{{GPUVertexStateDescriptor/vertexBuffers}}
passes [$validating GPUVertexBufferLayoutDescriptor$](|vertexBuffer|, |vertexStage|)
1. Each |at| in the union of all {{GPUVertexAttributeDescriptor}}
across |descritor|.{{GPUVertexStateDescriptor/vertexBuffers}} has a distinct
|at|.{{GPUVertexAttributeDescriptor/shaderLocation}} value.
</div>
</dl>

Issue(https://github.com/gpuweb/gpuweb/issues/693): add a limit to the number of vertex buffers

# Command Buffers # {#command-buffers}

Expand Down