Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions crates/bevy_pbr/src/render/mesh_view_bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,8 @@ pub fn layout_entries(
));

// Prepass
if cfg!(any(not(feature = "webgl"), not(target_arch = "wasm32")))
|| (cfg!(all(feature = "webgl", target_arch = "wasm32"))
&& !layout_key.contains(MeshPipelineViewLayoutKey::MULTISAMPLED))
if cfg!(any(feature = "webgpu", not(target_arch = "wasm32")))
|| !layout_key.contains(MeshPipelineViewLayoutKey::MULTISAMPLED)
{
for (entry, binding) in prepass::get_bind_group_layout_entries(layout_key)
.iter()
Expand Down Expand Up @@ -742,10 +741,10 @@ pub fn prepare_mesh_view_bind_groups(
get_lut_bindings(&images, &tonemapping_luts, tonemapping, &fallback_image);
entries = entries.extend_with_indices(((19, lut_bindings.0), (20, lut_bindings.1)));

// When using WebGL, we can't have a depth texture with multisampling
// When using WebGL, we can't have a multisampled texture with `TEXTURE_BINDING`
// See https://github.com/gfx-rs/wgpu/issues/5263
let prepass_bindings;
if cfg!(any(not(feature = "webgl"), not(target_arch = "wasm32"))) || msaa.samples() == 1
{
if cfg!(any(feature = "webgpu", not(target_arch = "wasm32"))) || msaa.samples() == 1 {
prepass_bindings = prepass::get_bindings(prepass_textures);
for (binding, index) in prepass_bindings
.iter()
Expand Down
5 changes: 0 additions & 5 deletions examples/3d/decal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
//! Note: On Wasm, this example only runs on WebGPU

use bevy::{
anti_alias::fxaa::Fxaa,
camera_controller::free_camera::{FreeCamera, FreeCameraPlugin},
core_pipeline::prepass::DepthPrepass,
pbr::decal::{ForwardDecal, ForwardDecalMaterial, ForwardDecalMaterialExt},
Expand Down Expand Up @@ -47,10 +46,6 @@ fn setup(
FreeCamera::default(),
// Must enable the depth prepass to render forward decals
DepthPrepass,
// Must disable MSAA to use decals on WebGPU
Msaa::Off,
// FXAA is a fine alternative to MSAA for anti-aliasing
Fxaa::default(),
Transform::from_xyz(2.0, 9.5, 2.5).looking_at(Vec3::ZERO, Vec3::Y),
));

Expand Down