Skip to content

Commit

Permalink
Add WebGL Fixes by @mrk-its
Browse files Browse the repository at this point in the history
  • Loading branch information
zicklag committed Oct 2, 2021
1 parent 68597df commit c4550e0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wgpu-hal/src/gles/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ impl crate::Device<super::Api> for super::Device {
gl.bind_buffer(buffer.target, Some(buffer.raw));

if let Some(buf) = buffer.emulate_map_allocation.lock().unwrap().take() {
gl.buffer_sub_data_u8_slice(buffer.target, 0, &buf);
drop(buf);
} else {
gl.unmap_buffer(buffer.target);
Expand Down Expand Up @@ -1078,7 +1079,7 @@ impl crate::Device<super::Api> for super::Device {
wait_value: crate::FenceValue,
timeout_ms: u32,
) -> Result<bool, crate::DeviceError> {
if fence.last_completed < wait_value {
if cfg!(not(target_arch = "wasm32")) && fence.last_completed < wait_value {
let gl = &self.shared.context.lock();
let timeout_ns = (timeout_ms as u64 * 1_000_000).min(!0u32 as u64);
let &(_, sync) = fence
Expand Down

0 comments on commit c4550e0

Please sign in to comment.