430: Unwrap errors from transfer API r=kvark a=GabrielMajeri

`wgpu-rs` part of https://github.com/gfx-rs/wgpu/pull/773

Co-authored-by: Gabriel Majeri <gabriel.majeri6@gmail.com>
This commit is contained in:
bors[bot]
2020-07-13 14:03:50 +00:00
committed by GitHub
11 changed files with 21 additions and 17 deletions

View File

@@ -27,14 +27,14 @@ vulkan = ["wgc/gfx-backend-vulkan"]
package = "wgpu-core"
version = "0.5"
git = "https://github.com/gfx-rs/wgpu"
rev = "01cf22c25adef14ee296af8d827fad3760a70a45"
rev = "8a038ba66e70f47dac87ae767588d433eb22d0d0"
features = ["raw-window-handle"]
[dependencies.wgt]
package = "wgpu-types"
version = "0.5"
git = "https://github.com/gfx-rs/wgpu"
rev = "01cf22c25adef14ee296af8d827fad3760a70a45"
rev = "8a038ba66e70f47dac87ae767588d433eb22d0d0"
[dependencies]
arrayvec = "0.5"

View File

@@ -57,7 +57,7 @@ impl framework::Example for Example {
let compute_bind_group_layout =
device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
bindings: &[
entries: &[
wgpu::BindGroupLayoutEntry::new(
0,
wgpu::ShaderStage::COMPUTE,

View File

@@ -134,7 +134,7 @@ impl framework::Example for Example {
// Create pipeline layout
let bind_group_layout = device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
label: None,
bindings: &[
entries: &[
wgpu::BindGroupLayoutEntry::new(
0,
wgpu::ShaderStage::VERTEX,

View File

@@ -59,7 +59,7 @@ async fn execute_gpu(numbers: Vec<u32>) -> Vec<u32> {
let bind_group_layout = device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
label: None,
bindings: &[wgpu::BindGroupLayoutEntry::new(
entries: &[wgpu::BindGroupLayoutEntry::new(
0,
wgpu::ShaderStage::COMPUTE,
wgpu::BindingType::StorageBuffer {

View File

@@ -81,7 +81,7 @@ impl Example {
mip_count: u32,
) {
let bind_group_layout = device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
bindings: &[
entries: &[
wgpu::BindGroupLayoutEntry::new(
0,
wgpu::ShaderStage::FRAGMENT,
@@ -221,7 +221,7 @@ impl framework::Example for Example {
// Create pipeline layout
let bind_group_layout = device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
bindings: &[
entries: &[
wgpu::BindGroupLayoutEntry::new(
0,
wgpu::ShaderStage::VERTEX,

View File

@@ -242,7 +242,7 @@ impl framework::Example for Example {
let local_bind_group_layout =
device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
bindings: &[wgpu::BindGroupLayoutEntry::new(
entries: &[wgpu::BindGroupLayoutEntry::new(
0,
wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT,
wgpu::BindingType::UniformBuffer {
@@ -430,7 +430,7 @@ impl framework::Example for Example {
// Create pipeline layout
let bind_group_layout =
device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
bindings: &[wgpu::BindGroupLayoutEntry::new(
entries: &[wgpu::BindGroupLayoutEntry::new(
0, // global
wgpu::ShaderStage::VERTEX,
wgpu::BindingType::UniformBuffer {
@@ -513,7 +513,7 @@ impl framework::Example for Example {
// Create pipeline layout
let bind_group_layout =
device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
bindings: &[
entries: &[
wgpu::BindGroupLayoutEntry::new(
0, // global
wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT,

View File

@@ -44,7 +44,7 @@ impl framework::Example for Skybox {
queue: &wgpu::Queue,
) -> Self {
let bind_group_layout = device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
bindings: &[
entries: &[
wgpu::BindGroupLayoutEntry::new(
0,
wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT,

View File

@@ -143,7 +143,7 @@ impl framework::Example for Example {
let bind_group_layout =
device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
bindings: &[wgpu::BindGroupLayoutEntry::new(
entries: &[wgpu::BindGroupLayoutEntry::new(
0,
wgpu::ShaderStage::FRAGMENT,
wgpu::BindingType::UniformBuffer {
@@ -250,7 +250,7 @@ impl framework::Example for Example {
let bind_group_layout = device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
label: Some("bind group layout"),
bindings: &[
entries: &[
wgpu::BindGroupLayoutEntry {
count: Some(2),
..wgpu::BindGroupLayoutEntry::new(

View File

@@ -351,7 +351,7 @@ impl framework::Example for Example {
let water_bind_group_layout =
device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
label: Some("Water Bind Group Layout"),
bindings: &[
entries: &[
// Uniform variables such as projection/view.
wgpu::BindGroupLayoutEntry::new(
0,
@@ -395,7 +395,7 @@ impl framework::Example for Example {
let terrain_bind_group_layout =
device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
label: Some("Terrain Bind Group Layout"),
bindings: &[
entries: &[
// Regular uniform variables like view/projection.
wgpu::BindGroupLayoutEntry::new(
0,

View File

@@ -570,7 +570,7 @@ impl crate::Context for Context {
&bm::BindGroupDescriptor {
label: desc.label,
layout: desc.layout.id,
bindings: &bindings,
entries: &bindings,
},
PhantomData
))
@@ -898,6 +898,7 @@ impl crate::Context for Context {
destination_offset,
copy_size
))
.unwrap()
}
fn command_encoder_copy_buffer_to_texture(
@@ -913,6 +914,7 @@ impl crate::Context for Context {
&map_texture_copy_view(destination),
&copy_size
))
.unwrap()
}
fn command_encoder_copy_texture_to_buffer(
@@ -928,6 +930,7 @@ impl crate::Context for Context {
&map_buffer_copy_view(destination),
&copy_size
))
.unwrap()
}
fn command_encoder_copy_texture_to_texture(
@@ -943,6 +946,7 @@ impl crate::Context for Context {
&map_texture_copy_view(destination),
&copy_size
))
.unwrap()
}
fn command_encoder_begin_compute_pass(

View File

@@ -827,7 +827,7 @@ impl crate::Context for Context {
use web_sys::GpuBindingType as bt;
let mapped_bindings = desc
.bindings
.entries
.iter()
.map(|bind| {
let mapped_type = match bind.ty {