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

fix example mesh2d_manual in wasm/webgl2 #12753

Merged
merged 1 commit into from Mar 28, 2024

Conversation

mockersf
Copy link
Member

Objective

wgpu error: Validation Error

Caused by:
    In a RenderPass
      note: encoder = `<CommandBuffer-(0, 1, Gl)>`
    In a set_push_constant command
    Provided push constant is for stage(s) ShaderStages(VERTEX), however the pipeline layout has no push constant range for the stage(s) ShaderStages(VERTEX)

Solution

  • Properly declare the push constant as in
    let mut push_constant_ranges = Vec::with_capacity(1);
    if cfg!(all(
    feature = "webgl",
    target_arch = "wasm32",
    not(feature = "webgpu")
    )) {
    push_constant_ranges.push(PushConstantRange {
    stages: ShaderStages::VERTEX,
    range: 0..4,
    });
    }

@mockersf mockersf added C-Examples An addition or correction to our examples O-WebGL2 Specific to the WebGL2 render API labels Mar 27, 2024
@mockersf mockersf added this to the 0.13.2 milestone Mar 27, 2024
@james7132 james7132 added this pull request to the merge queue Mar 28, 2024
Merged via the queue into bevyengine:main with commit ece6249 Mar 28, 2024
30 checks passed
mockersf added a commit that referenced this pull request Apr 1, 2024
# Objective

- Example `mesh2d_manual` crashes in wasm/webgl2, as reported in
bevyengine/bevy-website#1123 (comment)
```
wgpu error: Validation Error

Caused by:
    In a RenderPass
      note: encoder = `<CommandBuffer-(0, 1, Gl)>`
    In a set_push_constant command
    Provided push constant is for stage(s) ShaderStages(VERTEX), however the pipeline layout has no push constant range for the stage(s) ShaderStages(VERTEX)
```

## Solution

- Properly declare the push constant as in
https://github.com/bevyengine/bevy/blob/4508077297a92295d8b6fb6b07a63b547deac1e0/crates/bevy_sprite/src/mesh2d/mesh.rs#L514-L524
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Examples An addition or correction to our examples O-WebGL2 Specific to the WebGL2 render API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants