Skip to content

wgpu needs vertex buffers and shaders to match #7568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
magcius opened this issue Apr 17, 2025 · 0 comments · Fixed by #7600
Closed

wgpu needs vertex buffers and shaders to match #7568

magcius opened this issue Apr 17, 2025 · 0 comments · Fixed by #7600
Labels
area: validation Issues related to validation, diagnostics, and error handling type: bug Something isn't working

Comments

@magcius
Copy link
Collaborator

magcius commented Apr 17, 2025

Description
I recently ran into this error when trying to enable a WebGPU application in Firefox:

Error matching ShaderStages(VERTEX) shader requirements against the pipeline, caused by: Location[6] Float32x4 interpolated as Some(Perspective) with sampling Some(Center) is not provided by the previous stage outputs, caused by: Input type is not compatible with the provided Float32

The WebGPU spec does not require that the input vertex buffer matches component count with the buffer, only that the type (float, uint, sint) matches. When the component count doesn't match, the implementation should fill in the remaining component values with (0, 0, 0, 1); see the Vertex Processing section of the WebGPU spec. https://gpuweb.github.io/gpuweb/#vertex-processing

Repro steps
The original example is found here: https://noclip.website/#oot3d/spot04 ; this works fine in Chrome.

A CTS test is also found here:
https://gpuweb.github.io/cts/standalone/?q=webgpu:api,operation,vertex_state,correctness:vertex_format_to_shader_format_conversion:*

Platform
This was tested on Windows 10 with Firefox 139.0a1.

magcius added a commit to magcius/wgpu that referenced this issue Apr 23, 2025
The old is_compatible_with handled scalar/scalar, scalar/vector, vector/vector, but was missing vector/scalar.

Since is_compatible_with is only used by vertex shader inputs, and vertex shader inputs can't be matrices (only scalars and vectors), we can actually simplify this by removing the other match and just only checking the kind.

Fixes gfx-rs#7568
magcius added a commit to magcius/wgpu that referenced this issue Apr 23, 2025
The old is_compatible_with handled scalar/scalar, scalar/vector, vector/vector, but was missing vector/scalar.

Since is_compatible_with is only used by vertex shader inputs, and vertex shader inputs can't be matrices (only scalars and vectors), we can actually simplify this by removing the other match and just only checking the kind.

Fixes gfx-rs#7568
@cwfitzgerald cwfitzgerald added type: bug Something isn't working area: validation Issues related to validation, diagnostics, and error handling labels Apr 23, 2025
@teoxoy teoxoy closed this as completed in 38b6663 Apr 25, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in WebGPU for Firefox Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: validation Issues related to validation, diagnostics, and error handling type: bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants