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

Commit 7b15e24

Browse files
bors[bot]aloucks
andauthored
Merge #210
210: Update WGPU deps to rev 08e8d40 r=kvark a=aloucks I also moved the `path` chunks in `Cargo.toml` to a single `[patch]` section so that it's one block to commment/uncomment for local development. Co-authored-by: Aaron Loucks <[email protected]>
2 parents aeab013 + 277505e commit 7b15e24

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
},
@@ -606,8 +595,8 @@ impl Device {
606595
self.id,
607596
&bm::BindGroupDescriptor {
608597
layout: desc.layout.id,
609-
bindings: bindings.as_ptr(),
610-
bindings_length: bindings.len(),
598+
entries: bindings.as_ptr(),
599+
entries_length: bindings.len(),
611600
},
612601
),
613602
}
@@ -655,6 +644,11 @@ impl Device {
655644
BindingType::StorageTexture { dimension, .. } => dimension,
656645
_ => TextureViewDimension::D2,
657646
},
647+
texture_component_type: match bind.ty {
648+
BindingType::SampledTexture { component_type, .. } |
649+
BindingType::StorageTexture { component_type, .. } => component_type,
650+
_ => bm::TextureComponentType::Float,
651+
},
658652
storage_texture_format: match bind.ty {
659653
BindingType::StorageTexture { format, .. } => format,
660654
_ => TextureFormat::Rgb10a2Unorm, // doesn't matter
@@ -665,8 +659,8 @@ impl Device {
665659
id: wgn::wgpu_device_create_bind_group_layout(
666660
self.id,
667661
&bm::BindGroupLayoutDescriptor {
668-
bindings: temp_layouts.as_ptr(),
669-
bindings_length: temp_layouts.len(),
662+
entries: temp_layouts.as_ptr(),
663+
entries_length: temp_layouts.len(),
670664
},
671665
),
672666
}

0 commit comments

Comments
 (0)