Skip to content

VertexAttributeValues supports all wgpu VertexFormat#22796

Merged
alice-i-cecile merged 8 commits intobevyengine:mainfrom
beicause:vertex-attribute-values-match-wgpu-vertex-format
Mar 16, 2026
Merged

VertexAttributeValues supports all wgpu VertexFormat#22796
alice-i-cecile merged 8 commits intobevyengine:mainfrom
beicause:vertex-attribute-values-match-wgpu-vertex-format

Conversation

@beicause
Copy link
Copy Markdown
Contributor

@beicause beicause commented Feb 3, 2026

Objective

Some wgpu VertexFormats are not supported by VertexAttributeValues.

Solution

Add them to VertexAttributeValues.

Float64 is not supported by any wgpu backends but I added them anyway because wgpu has them.

May require #22187 to be fixed because for vertex formats less than 32 bits the MeshBufferSlice::range is incorrect. But generally vertex attributes are not affected by that issue if indices isn't u16.

Note that wgpu requires vertex strides to be 4 bytes aligned. Some vertex attribute is smaller than 4 bytes. It is user's responsibility to make sure the strides of custom vertex attributes is a multiple of 4.

Testing

None

@kfc35 kfc35 added A-Rendering Drawing game state to the screen D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Feb 3, 2026
@cart cart added this to Rendering Feb 12, 2026
@github-project-automation github-project-automation bot moved this to Needs SME Triage in Rendering Feb 12, 2026
@beicause beicause changed the title VertexAttributeValues supports more VertexFormat VertexAttributeValues supports all wgpu VertexFormat Mar 13, 2026
@kfc35 kfc35 added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Mar 15, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Mar 16, 2026
Merged via the queue into bevyengine:main with commit fccb3f1 Mar 16, 2026
42 checks passed
@github-project-automation github-project-automation bot moved this from Needs SME Triage to Done in Rendering Mar 16, 2026
@beicause beicause deleted the vertex-attribute-values-match-wgpu-vertex-format branch March 17, 2026 00:46
splo pushed a commit to splo/bevy that referenced this pull request Mar 31, 2026
…22796)

# Objective

Some wgpu `VertexFormat`s are not supported by `VertexAttributeValues`.

## Solution

Add them to `VertexAttributeValues`.

Float64 is not supported by any wgpu backends but I added them anyway
because wgpu has them.

~May require bevyengine#22187 to be fixed because for vertex formats less than 32
bits the `MeshBufferSlice::range` is incorrect. But generally vertex
attributes are not affected by that issue if indices isn't u16.~

Note that wgpu requires vertex strides to be [4 bytes
aligned](https://docs.rs/wgpu/latest/wgpu/constant.VERTEX_ALIGNMENT.html).
Some vertex attribute is smaller than 4 bytes. It is user's
responsibility to make sure the strides of custom vertex attributes is a
multiple of 4.

## Testing

None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Done
Status: No status

Development

Successfully merging this pull request may close these issues.

5 participants