bevy/crates
Aevyrie fda2e4b59c
Fix compile failure in WASM without wgpu backend (#14081)
# Objective

- When no wgpu backend is selected, there should be a clear explanation.
- Fix a regression in 0.14 when not using default features. I hit this
compile failure when trying to build bevy_framepace for 0.14.0-rc.4
```
error[E0432]: unresolved import `crate::core_3d::DEPTH_TEXTURE_SAMPLING_SUPPORTED`
  --> /Users/aevyrie/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_core_pipeline-0.14.0-rc.4/src/dof/mod.rs:59:19
   |
59 |         Camera3d, DEPTH_TEXTURE_SAMPLING_SUPPORTED,
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `DEPTH_TEXTURE_SAMPLING_SUPPORTED` in `core_3d`
   |
note: found an item that was configured out
  --> /Users/aevyrie/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_core_pipeline-0.14.0-rc.4/src/core_3d/mod.rs:53:11
   |
53 | pub const DEPTH_TEXTURE_SAMPLING_SUPPORTED: bool = false;
   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: found an item that was configured out
  --> /Users/aevyrie/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_core_pipeline-0.14.0-rc.4/src/core_3d/mod.rs:63:11
   |
63 | pub const DEPTH_TEXTURE_SAMPLING_SUPPORTED: bool = true;
   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

## Solution

- Ensure that `DEPTH_TEXTURE_SAMPLING_SUPPORTED` is either `true` or
`false`, it shouldn't be completely missing.

## Testing

- Building on WASM without default features, which now seemingly no
longer includes webgl, will panic on startup with a message saying that
no wgpu backend was selected. This is much more helpful than the compile
time failure:
```
No wgpu backend feature that is implemented for the target platform was enabled
```
- I can see an argument for making this a compile time failure, however
the current failure mode is very confusing for novice users, and
provides no clues for how to fix it. If we want this to fail at compile
time, we should do it in a way that fails with a helpful message,
similar to what this PR acheives.
2024-07-02 07:18:20 +02:00
..
bevy_a11y Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_animation Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_app Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_asset Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_audio Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_color Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_core Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_core_pipeline Fix compile failure in WASM without wgpu backend (#14081) 2024-07-02 07:18:20 +02:00
bevy_derive Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_dev_tools Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_diagnostic Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_dylib Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_dynamic_plugin Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_ecs Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_encase_derive Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_gilrs Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_gizmos Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_gltf Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_hierarchy Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_input Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_internal Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_log Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_macro_utils Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_math Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_mikktspace Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_pbr don't put previous skin/morph in the morphed_skinned_mesh_layout (#14065) 2024-06-29 03:29:45 +02:00
bevy_ptr Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_reflect Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_render Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_scene Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_sprite Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_state Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_tasks Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_text Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_time Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_transform Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_ui Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_utils Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_window Release Candidate 0.14.0-rc.4 2024-06-27 23:29:08 +02:00
bevy_winit only run one update per frame drawn (#14023) 2024-06-30 10:01:10 +02:00