Skip to content

Commit

Permalink
GLES 3.0 fix (gfx-rs#2078)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlunch authored and kvark committed Oct 22, 2021
1 parent 7e9d525 commit e9c06da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 4 additions & 0 deletions wgpu-hal/src/gles/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,10 @@ impl crate::Device<super::Api> for super::Device {
.shared
.workarounds
.contains(super::Workarounds::EMULATE_BUFFER_MAP)
|| !self
.shared
.private_caps
.contains(super::PrivateCapabilities::BUFFER_ALLOCATION)
{
let mut buf = vec![0; buffer.size as usize];
let ptr = buf.as_mut_ptr();
Expand Down
10 changes: 2 additions & 8 deletions wgpu-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -699,8 +699,7 @@ impl Limits {

/// These default limits are guarenteed to be compatible with GLES3, and D3D11, and WebGL2
pub fn downlevel_webgl2_defaults() -> Self {
#[cfg(target_arch = "wasm32")]
let defaults = Self {
Self {
max_storage_buffers_per_shader_stage: 0,
max_storage_textures_per_shader_stage: 0,
max_dynamic_storage_buffers_per_pipeline_layout: 0,
Expand All @@ -709,12 +708,7 @@ impl Limits {

// Most of the values should be the same as the downlevel defaults
..Self::downlevel_defaults()
};

#[cfg(not(target_arch = "wasm32"))]
let defaults = Self::downlevel_defaults();

defaults
}
}

/// Modify the current limits to use the resolution limits of the other.
Expand Down

0 comments on commit e9c06da

Please sign in to comment.