629: Update wgpu, work around surface validation r=straightforward a=kvark

Works around https://github.com/gfx-rs/wgpu/issues/1030
Includes https://github.com/zakarumych/gpu-alloc/pull/24

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
This commit is contained in:
bors[bot]
2020-11-18 15:07:30 +00:00
committed by GitHub
4 changed files with 15 additions and 7 deletions

View File

@@ -26,14 +26,14 @@ vulkan-portability = ["wgc/gfx-backend-vulkan", "gfx-backend-vulkan"]
package = "wgpu-core"
#version = "0.6"
git = "https://github.com/gfx-rs/wgpu"
rev = "af9713b249cc158276aeb643900f095e7699167a"
rev = "5e1226995c368f9b4cfde2da7f5d6c12d22e1bf2"
features = ["raw-window-handle"]
[dependencies.wgt]
package = "wgpu-types"
#version = "0.6"
git = "https://github.com/gfx-rs/wgpu"
rev = "af9713b249cc158276aeb643900f095e7699167a"
rev = "5e1226995c368f9b4cfde2da7f5d6c12d22e1bf2"
[dependencies]
arrayvec = "0.5"
@@ -85,7 +85,9 @@ test = true
[patch."https://github.com/gfx-rs/gfx-extras"]
#gfx-descriptor = { version = "0.2", path = "../gfx-extras/gfx-descriptor" }
#gfx-memory = { version = "0.2", path = "../gfx-extras/gfx-memory" }
[patch."https://github.com/zakarumych/gpu-alloc"]
#gpu-alloc = { path = "../gpu-alloc/gpu-alloc" }
[patch.crates-io]
#gfx-hal = { version = "0.6", path = "../gfx/src/hal" }

View File

@@ -66,7 +66,9 @@ impl framework::Example for Example {
visibility: wgpu::ShaderStage::COMPUTE,
ty: wgpu::BindingType::UniformBuffer {
dynamic: false,
min_binding_size: wgpu::BufferSize::new((sim_param_data.len()*std::mem::size_of::<f32>()) as _),
min_binding_size: wgpu::BufferSize::new(
(sim_param_data.len() * std::mem::size_of::<f32>()) as _,
),
},
count: None,
},

View File

@@ -1216,8 +1216,9 @@ impl crate::Context for Context {
)
}
fn surface_drop(&self, surface: &Self::SurfaceId) {
self.0.surface_drop(*surface)
fn surface_drop(&self, _surface: &Self::SurfaceId) {
//TODO: swapchain needs to hold the surface alive
//self.0.surface_drop(*surface)
}
fn adapter_drop(&self, adapter: &Self::AdapterId) {

View File

@@ -57,7 +57,10 @@ impl Context {
}
let buffer = device.0.create_buffer(&buffer_desc);
let data = js_sys::Uint8Array::from(contents).buffer();
device.0.default_queue().write_buffer_with_u32(&buffer, 0, &data);
device
.0
.default_queue()
.write_buffer_with_u32(&buffer, 0, &data);
Sendable(buffer)
}
}