Validate VertexBufferLayout::array_stride
#6799
Labels
area: validation
Issues related to validation, diagnostics, and error handling
VertexBufferLayout::array_stride
#6799
Context
The WebGPU spec constraints what the array stride of a
VertexBufferLayout
might be. In particular, it forbids it to be smaller or equal than themax(offset + size)
over all attributes:One might be tempted to use a stride smaller than the attributes to implement some kind of "sliding window" over a vertex buffer (I certainly was). This is however non-compliant as per above, and may variously lead to at least:
Issue
Currently, wgpu doesn't warn/error on non-compliant stride values. Since 23.0.0, it also silently generate erroneous metal shader when provided with non-compliant stride.
Desired change
wgpu should error (or warn loudly) with a reference to the spec whenever a non-compliant stride is detected.
Reference
The text was updated successfully, but these errors were encountered: