Skip to content
This repository was archived by the owner on Jun 18, 2021. It is now read-only.

Unwrap errors from transfer API #430

Merged
merged 1 commit into from
Jul 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion examples/boids/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion examples/cube/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion examples/hello-compute/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions examples/mipmap/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions examples/shadow/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion examples/skybox/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions examples/texture-arrays/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions examples/water/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 5 additions & 1 deletion src/backend/direct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ impl crate::Context for Context {
&bm::BindGroupDescriptor {
label: desc.label,
layout: desc.layout.id,
bindings: &bindings,
entries: &bindings,
},
PhantomData
))
Expand Down Expand Up @@ -898,6 +898,7 @@ impl crate::Context for Context {
destination_offset,
copy_size
))
.unwrap()
}

fn command_encoder_copy_buffer_to_texture(
Expand All @@ -913,6 +914,7 @@ impl crate::Context for Context {
&map_texture_copy_view(destination),
&copy_size
))
.unwrap()
}

fn command_encoder_copy_texture_to_buffer(
Expand All @@ -928,6 +930,7 @@ impl crate::Context for Context {
&map_buffer_copy_view(destination),
&copy_size
))
.unwrap()
}

fn command_encoder_copy_texture_to_texture(
Expand All @@ -943,6 +946,7 @@ impl crate::Context for Context {
&map_texture_copy_view(destination),
&copy_size
))
.unwrap()
}

fn command_encoder_begin_compute_pass(
Expand Down
2 changes: 1 addition & 1 deletion src/backend/web.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down