Skip to content
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

2d_gizmos and 3d_gizmos are broke in WebGPU #8908

Closed
ameknite opened this issue Jun 21, 2023 · 2 comments · Fixed by #8910
Closed

2d_gizmos and 3d_gizmos are broke in WebGPU #8908

ameknite opened this issue Jun 21, 2023 · 2 comments · Fixed by #8910
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior O-Web Specific to web (WASM) builds
Milestone

Comments

@ameknite
Copy link
Contributor

Bevy version

main 910f984

Relevant system information

cargo 1.70.0 (ec8a8a0ca 2023-04-25)

SystemInfo { os: "MacOS 13.4 ", kernel: "22.5.0", cpu: "Apple M1", core_count: "8", memory: "8.0 GiB" }
AdapterInfo { name: "", vendor: 0, device: 0, device_type: Other, driver: "", driver_info: "", backend: BrowserWebGpu }

Chrome: Version 114.0.5735.133 (Official Build) (arm64)

What you did

I run the examples 2d_gizmos and 3d_gizmos with WebGPU in Chrome

What went wrong

The example don't show, only a black screen
Screenshot 2023-06-20 at 19 42 50

Additional information

127.0.0.1/:1 Attribute offset (12) with format VertexFormat::Float32x3 (size: 12) doesn't fit in the vertex buffer stride (12).
 - While validating attributes[1].
 - While validating buffers[0].
 - While validating vertex state.
 - While calling [Device].CreateRenderPipeline([RenderPipelineDescriptor "LineGizmo Pipeline 2D"]).
[Invalid RenderPipeline "LineGizmo Pipeline 2D"] is invalid.
 - While encoding [RenderPassEncoder "main_pass_2d"].SetPipeline([Invalid RenderPipeline "LineGizmo Pipeline 2D"]).
[Invalid RenderPipeline "LineGizmo Pipeline"] is invalid.
 - While encoding [RenderPassEncoder "main_transparent_pass_3d"].SetPipeline([Invalid RenderPipeline "LineGizmo Pipeline"]).
@ameknite ameknite added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jun 21, 2023
@mockersf mockersf added A-Rendering Drawing game state to the screen O-Web Specific to web (WASM) builds and removed S-Needs-Triage This issue needs to be labelled labels Jun 21, 2023
@mockersf
Copy link
Member

Could be related to #8427. @devil-ira any idea?

@mockersf mockersf added this to the 0.11 milestone Jun 21, 2023
@tim-blackbird
Copy link
Contributor

Yes, this was introduced in #8427.
Seems this limitation is specific to metal (gpuweb/gpuweb#693 (comment)).
Maybe it's one of those 'works in practice' things and the validation only happens on WebGPU?

I'll try out the workarounds mentioned in gpuweb/gpuweb#1357.

github-merge-queue bot pushed a commit that referenced this issue Jun 22, 2023
# Objective

Fix #8908.

## Solution

Assign the vertex buffers twice with a single item offset instead of
setting the array_stride lower than the vertex layout's size for
linestrips.
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 C-Bug An unexpected or incorrect behavior O-Web Specific to web (WASM) builds
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants