GLES 3.0 fix (#2078)

This commit is contained in:
Inseok Lee 2021-10-22 01:07:07 +09:00 committed by Dzmitry Malyshau
parent 8e7dee5282
commit c3d9ad4a93
2 changed files with 6 additions and 8 deletions

View File

@ -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();

View File

@ -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,
@ -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.