Sitelet https://github.com/gpuweb/gpuweb/pull/469/files
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
41 changes: 28 additions & 13 deletions spec/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,7 @@ dictionary GPURenderPipelineDescriptor : GPUPipelineDescriptorBase {
GPURasterizationStateDescriptor rasterizationState = {};
required sequence<GPUColorStateDescriptor> colorStates;
GPUDepthStencilStateDescriptor depthStencilState;
GPUVertexInputDescriptor vertexInput = {};
GPUVertexStateDescriptor vertexState = {};

unsigned long sampleCount = 1;
unsigned long sampleMask = 0xFFFFFFFF;
Expand Down Expand Up @@ -1424,7 +1424,7 @@ dictionary GPUStencilStateFaceDescriptor {
};
</script>

### Vertex Input ### {#vertex-input}
### Vertex State ### {#vertex-state}

<script type=idl>
enum GPUIndexFormat {
Expand Down Expand Up @@ -1494,29 +1494,42 @@ enum GPUInputStepMode {
</script>

<script type=idl>
dictionary GPUVertexAttributeDescriptor {
GPUBufferSize offset = 0;
required GPUVertexFormat format;
required unsigned long shaderLocation;
dictionary GPUVertexStateDescriptor {
GPUIndexFormat indexFormat = "uint32";
sequence<GPUVertexBufferLayoutDescriptor?> vertexBuffers = [];
};
</script>

A <dfn dfn>vertex buffer</dfn> is, conceptually, a view into buffer memory as an *array of structures*.
{{GPUVertexBufferLayoutDescriptor/arrayStride}} is the stride, in bytes, between *elements* of that array.
Each element of a vertex buffer is like a *structure* with a memory layout defined by its
{{GPUVertexBufferLayoutDescriptor/attributes}}, which describe the *members* of the structure.

Each {{GPUVertexAttributeDescriptor}} describes its
{{GPUVertexAttributeDescriptor/format}} and its
{{GPUVertexAttributeDescriptor/offset}}, in bytes, within the structure.

Each attribute appears as a separate input in a vertex shader, each bound by a numeric *location*,
which is specified by {{GPUVertexAttributeDescriptor/shaderLocation}}.
Every location must be unique within the {{GPUVertexStateDescriptor}}.

<script type=idl>
dictionary GPUVertexBufferDescriptor {
required GPUBufferSize stride;
dictionary GPUVertexBufferLayoutDescriptor {
required GPUBufferSize arrayStride;
GPUInputStepMode stepMode = "vertex";
required sequence<GPUVertexAttributeDescriptor> attributeSet;
required sequence<GPUVertexAttributeDescriptor> attributes;
};
</script>

<script type=idl>
dictionary GPUVertexInputDescriptor {
GPUIndexFormat indexFormat = "uint32";
sequence<GPUVertexBufferDescriptor?> vertexBuffers = [];
dictionary GPUVertexAttributeDescriptor {
required GPUVertexFormat format;
required GPUBufferSize offset;

required unsigned long shaderLocation;
};
</script>


Command Buffers {#command-buffers}
==================================

Expand Down Expand Up @@ -1959,3 +1972,5 @@ partial interface GPUDevice {
# Temporary usages of non-exported dfns ## {#temp-dfn-usages}

Eventually all of these should disappear but they are useful to avoid warning while building the specification.

[=vertex buffer=]