bevy/crates/bevy_core_pipeline/src
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
..
auto_exposure Set the default target exposure to the minimum value, not 0 (#13562) 2024-05-29 22:37:42 +00:00
blit Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
bloom Added a Grey trait, and implementations on baked-in colors. Fixes #13206 (#13237) 2024-05-26 12:53:50 +00:00
contrast_adaptive_sharpening Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
core_2d Implement subpixel morphological antialiasing, or SMAA. (#13423) 2024-06-04 17:07:34 +00:00
core_3d Fix compile failure in WASM without wgpu backend (#14081) 2024-07-02 07:18:20 +02:00
deferred Allow phase items not associated with meshes to be binned. (#14029) 2024-06-27 19:41:42 +02:00
dof Implement opt-in sharp screen-space reflections for the deferred renderer, with improved raymarching code. (#13418) 2024-05-27 13:43:40 +00:00
fullscreen_vertex_shader Bevy Asset V2 (#8624) 2023-09-07 02:07:27 +00:00
fxaa Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
motion_blur Fix: Motion blur should sample onscreen fragments with no depth (#13573) 2024-05-30 13:52:47 +00:00
prepass Allow phase items not associated with meshes to be binned. (#14029) 2024-06-27 19:41:42 +02:00
skybox don't crash without features bevy_pbr, ktx2, zstd (#14020) 2024-06-26 21:55:00 +02:00
smaa don't crash without features bevy_pbr, ktx2, zstd (#14020) 2024-06-26 21:55:00 +02:00
taa Implement motion vectors and TAA for skinned meshes and meshes with morph targets. (#13572) 2024-05-31 17:02:28 +00:00
tonemapping Skip tonemapping in case it is none (#13679) 2024-06-05 11:32:46 +00:00
upscaling Allow mix of hdr and non-hdr cameras to same render target (#13419) 2024-06-06 23:12:32 +02:00
lib.rs Implement subpixel morphological antialiasing, or SMAA. (#13423) 2024-06-04 17:07:34 +00:00
msaa_writeback.rs Clean up 2d render phases (#12982) 2024-05-08 08:13:39 +00:00