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

Commit 277505e

Browse files
committed
Update WGPU deps to rev 08e8d40
1 parent 04db8c9 commit 277505e

File tree

6 files changed

+25
-24
lines changed

6 files changed

+25
-24
lines changed

Cargo.toml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,19 @@ vulkan = ["wgn/vulkan-portability"]
2727
package = "wgpu-native"
2828
version = "0.4"
2929
git = "https://github.com/gfx-rs/wgpu"
30-
rev = "39f17e50754aba6beeeabdd868ddfd700f9710c5"
31-
#path = "../wgpu/wgpu-native"
30+
rev = "08e8d406c175579da5ef18c1abf4d6c00e2a9726"
3231

3332
[dependencies.wgc]
3433
package = "wgpu-core"
3534
version = "0.1"
3635
git = "https://github.com/gfx-rs/wgpu"
37-
rev = "39f17e50754aba6beeeabdd868ddfd700f9710c5"
38-
#path = "../wgpu/wgpu-core"
36+
rev = "08e8d406c175579da5ef18c1abf4d6c00e2a9726"
3937

4038
[dependencies.wgt]
4139
package = "wgpu-types"
4240
version = "0.1"
4341
git = "https://github.com/gfx-rs/wgpu"
44-
rev = "39f17e50754aba6beeeabdd868ddfd700f9710c5"
45-
#path = "../wgpu/wgpu-types"
42+
rev = "08e8d406c175579da5ef18c1abf4d6c00e2a9726"
4643

4744
[dependencies]
4845
arrayvec = "0.5"
@@ -59,3 +56,8 @@ winit = "0.22"
5956
rand = "0.7.2"
6057
zerocopy = "0.2"
6158
futures = "0.3"
59+
60+
#[patch."https://github.com/gfx-rs/wgpu"]
61+
#wgc = { version = "0.1.0", package = "wgpu-core", path = "../wgpu/wgpu-core" }
62+
#wgt = { version = "0.1.0", package = "wgpu-types", path = "../wgpu/wgpu-types" }
63+
#wgn = { version = "0.4.0", package = "wgpu-native", path = "../wgpu/wgpu-native" }

examples/cube/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ impl framework::Example for Example {
141141
visibility: wgpu::ShaderStage::FRAGMENT,
142142
ty: wgpu::BindingType::SampledTexture {
143143
multisampled: false,
144+
component_type: wgpu::TextureComponentType::Float,
144145
dimension: wgpu::TextureViewDimension::D2,
145146
},
146147
},

examples/mipmap/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ impl Example {
8686
visibility: wgpu::ShaderStage::FRAGMENT,
8787
ty: wgpu::BindingType::SampledTexture {
8888
multisampled: false,
89+
component_type: wgpu::TextureComponentType::Float,
8990
dimension: wgpu::TextureViewDimension::D2,
9091
},
9192
},
@@ -225,6 +226,7 @@ impl framework::Example for Example {
225226
binding: 1,
226227
visibility: wgpu::ShaderStage::FRAGMENT,
227228
ty: wgpu::BindingType::SampledTexture {
229+
component_type: wgpu::TextureComponentType::Float,
228230
multisampled: false,
229231
dimension: wgpu::TextureViewDimension::D2,
230232
},

examples/shadow/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ impl framework::Example for Example {
501501
visibility: wgpu::ShaderStage::FRAGMENT,
502502
ty: wgpu::BindingType::SampledTexture {
503503
multisampled: false,
504+
component_type: wgpu::TextureComponentType::Float,
504505
dimension: wgpu::TextureViewDimension::D2Array,
505506
},
506507
},

examples/skybox/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ impl framework::Example for Skybox {
6565
binding: 1,
6666
visibility: wgpu::ShaderStage::FRAGMENT,
6767
ty: wgpu::BindingType::SampledTexture {
68+
component_type: wgpu::TextureComponentType::Float,
6869
multisampled: false,
6970
dimension: wgpu::TextureViewDimension::Cube,
7071
},

src/lib.rs

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,14 @@ use std::{
2020

2121
pub use wgt::*;
2222
pub use wgc::{
23-
Extent3d,
24-
Origin3d,
25-
command::{
26-
CommandBufferDescriptor,
27-
},
23+
binding_model::TextureComponentType,
2824
device::{
2925
BIND_BUFFER_ALIGNMENT,
3026
},
3127
instance::{
3228
AdapterInfo,
3329
DeviceType,
3430
},
35-
resource::{
36-
AddressMode,
37-
FilterMode,
38-
SamplerDescriptor,
39-
TextureAspect,
40-
TextureDescriptor,
41-
TextureDimension,
42-
TextureViewDescriptor,
43-
},
4431
};
4532

4633
//TODO: avoid heap allocating vectors during resource creation.
@@ -262,10 +249,12 @@ pub enum BindingType {
262249
},
263250
SampledTexture {
264251
dimension: TextureViewDimension,
252+
component_type: TextureComponentType,
265253
multisampled: bool,
266254
},
267255
StorageTexture {
268256
dimension: TextureViewDimension,
257+
component_type: TextureComponentType,
269258
format: TextureFormat,
270259
readonly: bool,
271260
},
@@ -603,8 +592,8 @@ impl Device {
603592
self.id,
604593
&bm::BindGroupDescriptor {
605594
layout: desc.layout.id,
606-
bindings: bindings.as_ptr(),
607-
bindings_length: bindings.len(),
595+
entries: bindings.as_ptr(),
596+
entries_length: bindings.len(),
608597
},
609598
),
610599
}
@@ -652,6 +641,11 @@ impl Device {
652641
BindingType::StorageTexture { dimension, .. } => dimension,
653642
_ => TextureViewDimension::D2,
654643
},
644+
texture_component_type: match bind.ty {
645+
BindingType::SampledTexture { component_type, .. } |
646+
BindingType::StorageTexture { component_type, .. } => component_type,
647+
_ => bm::TextureComponentType::Float,
648+
},
655649
storage_texture_format: match bind.ty {
656650
BindingType::StorageTexture { format, .. } => format,
657651
_ => TextureFormat::Rgb10a2Unorm, // doesn't matter
@@ -662,8 +656,8 @@ impl Device {
662656
id: wgn::wgpu_device_create_bind_group_layout(
663657
self.id,
664658
&bm::BindGroupLayoutDescriptor {
665-
bindings: temp_layouts.as_ptr(),
666-
bindings_length: temp_layouts.len(),
659+
entries: temp_layouts.as_ptr(),
660+
entries_length: temp_layouts.len(),
667661
},
668662
),
669663
}

0 commit comments

Comments
 (0)