diff --git a/Cargo.toml b/Cargo.toml index 9500683d33..d501e1fdd6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,22 +27,19 @@ vulkan = ["wgn/vulkan-portability"] package = "wgpu-native" version = "0.4" git = "https://github.com/gfx-rs/wgpu" -rev = "39f17e50754aba6beeeabdd868ddfd700f9710c5" -#path = "../wgpu/wgpu-native" +rev = "08e8d406c175579da5ef18c1abf4d6c00e2a9726" [dependencies.wgc] package = "wgpu-core" version = "0.1" git = "https://github.com/gfx-rs/wgpu" -rev = "39f17e50754aba6beeeabdd868ddfd700f9710c5" -#path = "../wgpu/wgpu-core" +rev = "08e8d406c175579da5ef18c1abf4d6c00e2a9726" [dependencies.wgt] package = "wgpu-types" version = "0.1" git = "https://github.com/gfx-rs/wgpu" -rev = "39f17e50754aba6beeeabdd868ddfd700f9710c5" -#path = "../wgpu/wgpu-types" +rev = "08e8d406c175579da5ef18c1abf4d6c00e2a9726" [dependencies] arrayvec = "0.5" @@ -59,3 +56,8 @@ winit = "0.22" rand = "0.7.2" zerocopy = "0.2" futures = "0.3" + +#[patch."https://github.com/gfx-rs/wgpu"] +#wgc = { version = "0.1.0", package = "wgpu-core", path = "../wgpu/wgpu-core" } +#wgt = { version = "0.1.0", package = "wgpu-types", path = "../wgpu/wgpu-types" } +#wgn = { version = "0.4.0", package = "wgpu-native", path = "../wgpu/wgpu-native" } \ No newline at end of file diff --git a/examples/cube/main.rs b/examples/cube/main.rs index d9ddeb1134..4d78131af1 100644 --- a/examples/cube/main.rs +++ b/examples/cube/main.rs @@ -141,6 +141,7 @@ impl framework::Example for Example { visibility: wgpu::ShaderStage::FRAGMENT, ty: wgpu::BindingType::SampledTexture { multisampled: false, + component_type: wgpu::TextureComponentType::Float, dimension: wgpu::TextureViewDimension::D2, }, }, diff --git a/examples/mipmap/main.rs b/examples/mipmap/main.rs index 1427f323fe..0c2581104d 100644 --- a/examples/mipmap/main.rs +++ b/examples/mipmap/main.rs @@ -86,6 +86,7 @@ impl Example { visibility: wgpu::ShaderStage::FRAGMENT, ty: wgpu::BindingType::SampledTexture { multisampled: false, + component_type: wgpu::TextureComponentType::Float, dimension: wgpu::TextureViewDimension::D2, }, }, @@ -225,6 +226,7 @@ impl framework::Example for Example { binding: 1, visibility: wgpu::ShaderStage::FRAGMENT, ty: wgpu::BindingType::SampledTexture { + component_type: wgpu::TextureComponentType::Float, multisampled: false, dimension: wgpu::TextureViewDimension::D2, }, diff --git a/examples/shadow/main.rs b/examples/shadow/main.rs index 05f0272d80..8cf497a52e 100644 --- a/examples/shadow/main.rs +++ b/examples/shadow/main.rs @@ -501,6 +501,7 @@ impl framework::Example for Example { visibility: wgpu::ShaderStage::FRAGMENT, ty: wgpu::BindingType::SampledTexture { multisampled: false, + component_type: wgpu::TextureComponentType::Float, dimension: wgpu::TextureViewDimension::D2Array, }, }, diff --git a/examples/skybox/main.rs b/examples/skybox/main.rs index 9a2fae457b..e68076f55d 100644 --- a/examples/skybox/main.rs +++ b/examples/skybox/main.rs @@ -65,6 +65,7 @@ impl framework::Example for Skybox { binding: 1, visibility: wgpu::ShaderStage::FRAGMENT, ty: wgpu::BindingType::SampledTexture { + component_type: wgpu::TextureComponentType::Float, multisampled: false, dimension: wgpu::TextureViewDimension::Cube, }, diff --git a/src/lib.rs b/src/lib.rs index 7f62eefd22..d55734eac2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -20,11 +20,7 @@ use std::{ pub use wgt::*; pub use wgc::{ - Extent3d, - Origin3d, - command::{ - CommandBufferDescriptor, - }, + binding_model::TextureComponentType, device::{ BIND_BUFFER_ALIGNMENT, }, @@ -32,15 +28,6 @@ pub use wgc::{ AdapterInfo, DeviceType, }, - resource::{ - AddressMode, - FilterMode, - SamplerDescriptor, - TextureAspect, - TextureDescriptor, - TextureDimension, - TextureViewDescriptor, - }, }; //TODO: avoid heap allocating vectors during resource creation. @@ -262,10 +249,12 @@ pub enum BindingType { }, SampledTexture { dimension: TextureViewDimension, + component_type: TextureComponentType, multisampled: bool, }, StorageTexture { dimension: TextureViewDimension, + component_type: TextureComponentType, format: TextureFormat, readonly: bool, }, @@ -606,8 +595,8 @@ impl Device { self.id, &bm::BindGroupDescriptor { layout: desc.layout.id, - bindings: bindings.as_ptr(), - bindings_length: bindings.len(), + entries: bindings.as_ptr(), + entries_length: bindings.len(), }, ), } @@ -655,6 +644,11 @@ impl Device { BindingType::StorageTexture { dimension, .. } => dimension, _ => TextureViewDimension::D2, }, + texture_component_type: match bind.ty { + BindingType::SampledTexture { component_type, .. } | + BindingType::StorageTexture { component_type, .. } => component_type, + _ => bm::TextureComponentType::Float, + }, storage_texture_format: match bind.ty { BindingType::StorageTexture { format, .. } => format, _ => TextureFormat::Rgb10a2Unorm, // doesn't matter @@ -665,8 +659,8 @@ impl Device { id: wgn::wgpu_device_create_bind_group_layout( self.id, &bm::BindGroupLayoutDescriptor { - bindings: temp_layouts.as_ptr(), - bindings_length: temp_layouts.len(), + entries: temp_layouts.as_ptr(), + entries_length: temp_layouts.len(), }, ), }