Skip to content

Commit

Permalink
update for wgpu 0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Dec 22, 2021
1 parent 412ef30 commit c28ae4f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion crates/bevy_pbr/src/light.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ pub struct DirectionalLightShadowMap {

impl Default for DirectionalLightShadowMap {
fn default() -> Self {
Self { size: 4096 }
#[cfg(feature = "webgl2")]
return Self { size: 4096 };
#[cfg(not(feature = "webgl2"))]
return Self { size: 2048 };
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_render/src/mesh/mesh/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ impl RenderAsset for Mesh {

let index_info = mesh.get_index_buffer_bytes().map(|data| GpuIndexInfo {
buffer: render_device.create_buffer_with_data(&BufferInitDescriptor {
usage: BufferUsages::INDEX | BufferUsages::MAP_WRITE,
usage: BufferUsages::INDEX,
contents: data,
label: Some("Mesh Index Buffer"),
}),
Expand Down
8 changes: 7 additions & 1 deletion crates/bevy_render/src/view/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,18 @@ pub struct Msaa {
/// smoother edges. Note that WGPU currently only supports 1 or 4 samples.
/// Ultimately we plan on supporting whatever is natively supported on a given device.
/// Check out this issue for more info: <https://github.com/gfx-rs/wgpu/issues/1832>
/// It defaults to 1 in wasm - https://github.com/gfx-rs/wgpu/issues/2149
pub samples: u32,
}

impl Default for Msaa {
fn default() -> Self {
Self { samples: 4 }
Self {
#[cfg(feature = "webgl")]
samples: 1,
#[cfg(not(feature = "webgl"))]
samples: 4,
}
}
}

Expand Down

0 comments on commit c28ae4f

Please sign in to comment.