From beac74c481ac375f78d0fbd5fc21086cef11e011 Mon Sep 17 00:00:00 2001 From: Joshua Groves Date: Wed, 3 Oct 2018 07:31:35 -0600 Subject: [PATCH 1/5] Map texture dimension and size --- wgpu-native/src/conv.rs | 21 ++++++++++++++++++++- wgpu-native/src/lib.rs | 6 +++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/wgpu-native/src/conv.rs b/wgpu-native/src/conv.rs index 3d6c8e312b..7b0c4bfc1b 100644 --- a/wgpu-native/src/conv.rs +++ b/wgpu-native/src/conv.rs @@ -1,6 +1,6 @@ use hal; -use {binding_model, pipeline, resource}; +use {Extent3d, binding_model, pipeline, resource}; pub(crate) fn map_buffer_usage( usage: resource::BufferUsageFlags, @@ -237,3 +237,22 @@ pub(crate) fn map_texture_format(texture_format: resource::TextureFormat) -> hal D32FloatS8Uint => H::D32FloatS8Uint, } } + +fn checked_u32_as_u16(value: u32) -> u16 { + assert!(value <= ::std::u16::MAX as u32); + value as u16 +} + +pub(crate) fn map_texture_dimension_size(dimension: resource::TextureDimension, size: Extent3d) -> hal::image::Kind { + use hal::image::Kind as H; + use resource::TextureDimension::*; + let Extent3d { width, height, depth } = size; + match dimension { + D1 => { + assert_eq!(height, 1); + H::D1(width, checked_u32_as_u16(depth)) + } + D2 => H::D2(width, height, checked_u32_as_u16(depth), 1), // TODO: Samples + D3 => H::D3(width, height, depth), + } +} diff --git a/wgpu-native/src/lib.rs b/wgpu-native/src/lib.rs index be09827a45..68a903fc51 100644 --- a/wgpu-native/src/lib.rs +++ b/wgpu-native/src/lib.rs @@ -76,9 +76,9 @@ pub struct Origin3d { #[repr(C)] #[derive(Clone, Copy, Debug)] pub struct Extent3d { - pub width: f32, - pub height: f32, - pub depth: f32, + pub width: u32, + pub height: u32, + pub depth: u32, } #[repr(C)] From 45c5709b1d5c4b7b3471fb27572e004e6bb28ac2 Mon Sep 17 00:00:00 2001 From: Joshua Groves Date: Wed, 3 Oct 2018 13:08:22 -0600 Subject: [PATCH 2/5] Map usage flags --- wgpu-native/src/conv.rs | 31 +++++++++++++++++++++++++++++++ wgpu-native/src/resource.rs | 28 ++++++++++++++++------------ 2 files changed, 47 insertions(+), 12 deletions(-) diff --git a/wgpu-native/src/conv.rs b/wgpu-native/src/conv.rs index 7b0c4bfc1b..f9b99b4906 100644 --- a/wgpu-native/src/conv.rs +++ b/wgpu-native/src/conv.rs @@ -256,3 +256,34 @@ pub(crate) fn map_texture_dimension_size(dimension: resource::TextureDimension, D3 => H::D3(width, height, depth), } } + +pub(crate) fn map_texture_usage_flags(flags: u32, format: hal::format::Format) -> hal::image::Usage { + use hal::image::Usage as H; + use resource::{ + TextureUsageFlags_TRANSFER_SRC, TextureUsageFlags_TRANSFER_DST, TextureUsageFlags_SAMPLED, + TextureUsageFlags_STORAGE, TextureUsageFlags_OUTPUT_ATTACHMENT, + }; + let mut value = H::empty(); + if 0 != flags & TextureUsageFlags_TRANSFER_SRC { + value |= H::TRANSFER_SRC; + } + if 0 != flags & TextureUsageFlags_TRANSFER_DST { + value |= H::TRANSFER_DST; + } + if 0 != flags & TextureUsageFlags_SAMPLED { + value |= H::SAMPLED; + } + if 0 != flags & TextureUsageFlags_STORAGE { + value |= H::STORAGE; + } + if 0 != flags & TextureUsageFlags_OUTPUT_ATTACHMENT { + if format.surface_desc().aspects.intersects(hal::format::Aspects::DEPTH | hal::format::Aspects::STENCIL) { + value |= H::DEPTH_STENCIL_ATTACHMENT; + } else { + value |= H::COLOR_ATTACHMENT; + } + } + // Note: TextureUsageFlags::Present does not need to be handled explicitly + // TODO: HAL Transient Attachment, HAL Input Attachment + value +} \ No newline at end of file diff --git a/wgpu-native/src/resource.rs b/wgpu-native/src/resource.rs index ac4486aee9..8154ef81ae 100644 --- a/wgpu-native/src/resource.rs +++ b/wgpu-native/src/resource.rs @@ -50,18 +50,22 @@ pub enum TextureFormat { D32FloatS8Uint = 3, } -bitflags! { - #[repr(transparent)] - pub struct TextureUsageFlags: u32 { - const NONE = 0; - const TRANSFER_SRC = 1; - const TRANSFER_DST = 2; - const SAMPLED = 4; - const STORAGE = 8; - const OUTPUT_ATTACHMENT = 16; - const PRESENT = 32; - } -} +// TODO: bitflags +pub type TextureUsageFlags = u32; +#[allow(non_upper_case_globals)] +pub const TextureUsageFlags_NONE: u32 = 0; +#[allow(non_upper_case_globals)] +pub const TextureUsageFlags_TRANSFER_SRC: u32 = 1; +#[allow(non_upper_case_globals)] +pub const TextureUsageFlags_TRANSFER_DST: u32 = 2; +#[allow(non_upper_case_globals)] +pub const TextureUsageFlags_SAMPLED: u32 = 4; +#[allow(non_upper_case_globals)] +pub const TextureUsageFlags_STORAGE: u32 = 8; +#[allow(non_upper_case_globals)] +pub const TextureUsageFlags_OUTPUT_ATTACHMENT: u32 = 16; +#[allow(non_upper_case_globals)] +pub const TextureUsageFlags_PRESENT: u32 = 32; #[repr(C)] pub struct TextureDescriptor { From 6fb3b06303ee9f76fdcc2069439e19444216cbed Mon Sep 17 00:00:00 2001 From: Joshua Groves Date: Sat, 6 Oct 2018 22:25:34 -0600 Subject: [PATCH 3/5] Add rendy and create textures --- Cargo.lock | 331 +++++++++++++++++++++----------- wgpu-native/Cargo.toml | 12 +- wgpu-native/src/conv.rs | 2 +- wgpu-native/src/device.rs | 78 +++++++- wgpu-native/src/lib.rs | 3 +- wgpu-native/src/registry/mod.rs | 2 + wgpu-native/src/resource.rs | 4 +- 7 files changed, 303 insertions(+), 129 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1bbb49c7d9..61de9c0b3f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -29,6 +29,11 @@ dependencies = [ "shared_library 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "atom" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "atty" version = "0.2.11" @@ -77,17 +82,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cbindgen" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -136,28 +141,30 @@ dependencies = [ [[package]] name = "cocoa" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "core-graphics 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)", + "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "core-foundation" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "core-foundation-sys 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "core-foundation-sys" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -166,22 +173,62 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "core-foundation 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "core-graphics" -version = "0.17.1" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "core-foundation 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "crossbeam-deque" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-epoch 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-utils" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "d3d12-rs" +version = "0.1.0" +source = "git+https://github.com/gfx-rs/d3d12-rs.git?rev=124f9fc#124f9fc100c7edc6bc317ee9a7f61e757ec25ecd" +dependencies = [ + "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "derivative" version = "1.0.0" @@ -232,7 +279,7 @@ name = "failure_derive" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -281,38 +328,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "gfx-backend-dx12" version = "0.1.0" -source = "git+https://github.com/gfx-rs/gfx?rev=a435a05#a435a052f604168154c645bb5033bb3f09d95e91" +source = "git+https://github.com/gfx-rs/gfx#c7fd2338fff2dfd95c56adf481801780169bc74d" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "d3d12-rs 0.1.0 (git+https://github.com/gfx-rs/d3d12-rs.git?rev=124f9fc)", "derivative 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx-hal 0.1.0 (git+https://github.com/gfx-rs/gfx?rev=a435a05)", + "gfx-hal 0.1.0 (git+https://github.com/gfx-rs/gfx.git)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", - "spirv_cross 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "spirv_cross 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "winit 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)", - "wio 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "gfx-backend-empty" version = "0.1.0" -source = "git+https://github.com/gfx-rs/gfx?rev=a435a05#a435a052f604168154c645bb5033bb3f09d95e91" +source = "git+https://github.com/gfx-rs/gfx#c7fd2338fff2dfd95c56adf481801780169bc74d" dependencies = [ - "gfx-hal 0.1.0 (git+https://github.com/gfx-rs/gfx?rev=a435a05)", + "gfx-hal 0.1.0 (git+https://github.com/gfx-rs/gfx.git)", ] [[package]] name = "gfx-backend-metal" version = "0.1.0" -source = "git+https://github.com/gfx-rs/gfx?rev=a435a05#a435a052f604168154c645bb5033bb3f09d95e91" +source = "git+https://github.com/gfx-rs/gfx#c7fd2338fff2dfd95c56adf481801780169bc74d" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "cocoa 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", - "core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cocoa 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)", + "core-graphics 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)", "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx-hal 0.1.0 (git+https://github.com/gfx-rs/gfx?rev=a435a05)", + "gfx-hal 0.1.0 (git+https://github.com/gfx-rs/gfx.git)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "metal 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -326,11 +373,11 @@ dependencies = [ [[package]] name = "gfx-backend-vulkan" version = "0.1.0" -source = "git+https://github.com/gfx-rs/gfx?rev=a435a05#a435a052f604168154c645bb5033bb3f09d95e91" +source = "git+https://github.com/gfx-rs/gfx#c7fd2338fff2dfd95c56adf481801780169bc74d" dependencies = [ "ash 0.24.4 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx-hal 0.1.0 (git+https://github.com/gfx-rs/gfx?rev=a435a05)", + "gfx-hal 0.1.0 (git+https://github.com/gfx-rs/gfx.git)", "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -343,7 +390,7 @@ dependencies = [ [[package]] name = "gfx-hal" version = "0.1.0" -source = "git+https://github.com/gfx-rs/gfx?rev=a435a05#a435a052f604168154c645bb5033bb3f09d95e91" +source = "git+https://github.com/gfx-rs/gfx.git#c7fd2338fff2dfd95c56adf481801780169bc74d" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -352,13 +399,12 @@ dependencies = [ ] [[package]] -name = "gfx-memory" -version = "0.1.0" -source = "git+https://github.com/gfx-rs/gfx-memory?rev=483d64d#483d64dba6d3e2acfcd8f77a2baade78f120d49f" +name = "hibitset" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx-hal 0.1.0 (git+https://github.com/gfx-rs/gfx?rev=a435a05)", - "relevant 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "atom 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -435,6 +481,11 @@ dependencies = [ "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "memoffset" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "metal" version = "0.13.0" @@ -442,8 +493,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "cocoa 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", - "core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cocoa 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)", + "core-graphics 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)", "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -469,6 +520,14 @@ name = "nodrop" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "num_cpus" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "objc" version = "0.2.5" @@ -545,7 +604,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "proc-macro2" -version = "0.4.19" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "proc-macro2" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -556,12 +623,20 @@ name = "quote" version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "quote" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "quote" version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -572,14 +647,43 @@ dependencies = [ "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rand_core" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rayon" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon-core 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rayon-core" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "redox_syscall" @@ -596,7 +700,7 @@ dependencies = [ [[package]] name = "relevant" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -607,6 +711,21 @@ dependencies = [ "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rendy-memory" +version = "0.1.0" +source = "git+https://github.com/rustgd/rendy?rev=ce7dd7f#ce7dd7f461a49aa13f8ee1356d4c167b8b33be83" +dependencies = [ + "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "derivative 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "gfx-hal 0.1.0 (git+https://github.com/gfx-rs/gfx.git)", + "hibitset 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "relevant 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "veclist 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rustc-demangle" version = "0.1.9" @@ -648,31 +767,22 @@ name = "serde" version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde_derive 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive" -version = "1.0.21" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive_internals 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "serde_derive_internals" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", - "synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.13.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_json" -version = "1.0.31" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -713,14 +823,6 @@ dependencies = [ "wayland-protocols 0.20.12 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "spirv_cross" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "spirv_cross" version = "0.11.2" @@ -758,12 +860,12 @@ dependencies = [ [[package]] name = "syn" -version = "0.11.11" +version = "0.13.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -771,25 +873,17 @@ name = "syn" version = "0.14.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "synom" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "synstructure" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -828,7 +922,7 @@ dependencies = [ [[package]] name = "toml" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)", @@ -862,6 +956,11 @@ name = "vec_map" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "veclist" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "version_check" version = "0.1.5" @@ -934,7 +1033,7 @@ dependencies = [ name = "wgpu-bindings" version = "0.1.0" dependencies = [ - "cbindgen 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cbindgen 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -942,14 +1041,14 @@ name = "wgpu-native" version = "0.1.0" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "gfx-backend-dx12 0.1.0 (git+https://github.com/gfx-rs/gfx?rev=a435a05)", - "gfx-backend-empty 0.1.0 (git+https://github.com/gfx-rs/gfx?rev=a435a05)", - "gfx-backend-metal 0.1.0 (git+https://github.com/gfx-rs/gfx?rev=a435a05)", - "gfx-backend-vulkan 0.1.0 (git+https://github.com/gfx-rs/gfx?rev=a435a05)", - "gfx-hal 0.1.0 (git+https://github.com/gfx-rs/gfx?rev=a435a05)", - "gfx-memory 0.1.0 (git+https://github.com/gfx-rs/gfx-memory?rev=483d64d)", + "gfx-backend-dx12 0.1.0 (git+https://github.com/gfx-rs/gfx)", + "gfx-backend-empty 0.1.0 (git+https://github.com/gfx-rs/gfx)", + "gfx-backend-metal 0.1.0 (git+https://github.com/gfx-rs/gfx)", + "gfx-backend-vulkan 0.1.0 (git+https://github.com/gfx-rs/gfx)", + "gfx-hal 0.1.0 (git+https://github.com/gfx-rs/gfx.git)", "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rendy-memory 0.1.0 (git+https://github.com/rustgd/rendy?rev=ce7dd7f)", ] [[package]] @@ -978,7 +1077,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "android_glue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "cocoa 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", - "core-foundation 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", @@ -992,14 +1091,6 @@ dependencies = [ "x11-dl 2.18.3 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "wio" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "x11" version = "2.18.1" @@ -1041,23 +1132,28 @@ dependencies = [ "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" "checksum arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef" "checksum ash 0.24.4 (registry+https://github.com/rust-lang/crates.io-index)" = "11f080bc0414ee1b6b959442cb36478d56c6e6b9bb2b04079a5048d9acc91a30" +"checksum atom 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3c86699c3f02778ec07158376991c8f783dd1f2f95c579ffaf0738dc984b2fe2" "checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652" "checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a" "checksum backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c66d56ac8dabd07f6aacdaf633f4b8262f5b3601a810a0dcddffd5c22c69daa0" "checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" "checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" "checksum byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "90492c5858dd7d2e78691cfb89f90d273a2800fc11d98f60786e5d87e2f83781" -"checksum cbindgen 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f1f920442b99c6eb6208905a2b71b055e4c8f170287fbe7c7ceb9b6cd206878d" +"checksum cbindgen 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "33dfad88cda0bab90ef91c4ae338f132ba6934ea59b6e352eb96f558b5a879d7" "checksum cc 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "f159dfd43363c4d08055a07703eb7a3406b0dac4d0584d96965a3262db3c9d16" "checksum cfg-if 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0c4e7bb64a8ebb0d856483e1e682ea3422f883c5f5615a90d51a2c82fe87fdd3" "checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" "checksum cocoa 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f5cd1afb83b2de9c41e5dfedb2bcccb779d433b958404876009ae4b01746ff23" -"checksum cocoa 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "53a840785348e998a1433d1f9d0b350fd83e91711fae8507c76ce510afc77e72" -"checksum core-foundation 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cc3532ec724375c7cb7ff0a097b714fde180bb1f6ed2ab27cfcd99ffca873cd2" -"checksum core-foundation-sys 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a3fb15cdbdd9cf8b82d97d0296bb5cd3631bba58d6e31650a002a8e7fb5721f9" +"checksum cocoa 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3afda30c4d94c3597775891170fc02cae71ed7add6c6f497cc391f6272c62d8a" +"checksum core-foundation 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "58667b9a618a37ea8c4c4cb5298703e5dfadcd3698c79f54fc43e6a2e94733ea" +"checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" "checksum core-graphics 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "92801c908ea6301ae619ed842a72e01098085fc321b9c2f3f833dad555bba055" -"checksum core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)" = "62ceafe1622ffc9a332199096841d0ff9912ec8cf8f9cde01e254a7d5217cd10" +"checksum core-graphics 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)" = "46a1b26242df9c08350ffede6684753773eab42289745f618fc42c2f41486ffa" +"checksum crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f739f8c5363aca78cfb059edf753d8f0d36908c348f3d8d1503f03d8b75d9cf3" +"checksum crossbeam-epoch 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "927121f5407de9956180ff5e936fe3cf4324279280001cd56b669d28ee7e9150" +"checksum crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2760899e32a1d58d5abb31129f8fae5de75220bc2176e77ff7c627ae45c918d9" +"checksum d3d12-rs 0.1.0 (git+https://github.com/gfx-rs/d3d12-rs.git?rev=124f9fc)" = "" "checksum derivative 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "67b3d6d0e84e53a5bdc263cc59340541877bb541706a191d762bfac6a481bdde" "checksum dlib 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "77e51249a9d823a4cb79e3eca6dcd756153e8ed0157b6c04775d04bf1b13b76a" "checksum downcast-rs 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "18df8ce4470c189d18aa926022da57544f31e154631eb4cfe796aea97051fe6c" @@ -1070,12 +1166,12 @@ dependencies = [ "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" "checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" "checksum gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)" = "5e33ec290da0d127825013597dbdfc28bee4964690c7ce1166cbc2a7bd08b1bb" -"checksum gfx-backend-dx12 0.1.0 (git+https://github.com/gfx-rs/gfx?rev=a435a05)" = "" -"checksum gfx-backend-empty 0.1.0 (git+https://github.com/gfx-rs/gfx?rev=a435a05)" = "" -"checksum gfx-backend-metal 0.1.0 (git+https://github.com/gfx-rs/gfx?rev=a435a05)" = "" -"checksum gfx-backend-vulkan 0.1.0 (git+https://github.com/gfx-rs/gfx?rev=a435a05)" = "" -"checksum gfx-hal 0.1.0 (git+https://github.com/gfx-rs/gfx?rev=a435a05)" = "" -"checksum gfx-memory 0.1.0 (git+https://github.com/gfx-rs/gfx-memory?rev=483d64d)" = "" +"checksum gfx-backend-dx12 0.1.0 (git+https://github.com/gfx-rs/gfx)" = "" +"checksum gfx-backend-empty 0.1.0 (git+https://github.com/gfx-rs/gfx)" = "" +"checksum gfx-backend-metal 0.1.0 (git+https://github.com/gfx-rs/gfx)" = "" +"checksum gfx-backend-vulkan 0.1.0 (git+https://github.com/gfx-rs/gfx)" = "" +"checksum gfx-hal 0.1.0 (git+https://github.com/gfx-rs/gfx.git)" = "" +"checksum hibitset 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8875cbf0ea151f7e1267aba4482a9e0f8ef9440f3d2a57f4ca2363ae9b56070e" "checksum itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4833d6978da405305126af4ac88569b5d71ff758581ce5a987dbfa3755f694fc" "checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b" "checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" @@ -1086,9 +1182,11 @@ dependencies = [ "checksum log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fcce5fa49cc693c312001daf1d13411c4a5283796bac1084299ea3e567113f" "checksum malloc_buf 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" "checksum memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff" +"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" "checksum metal 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8411e1b14691a658f4b285f980c98d1af1922dcf037ea4454288dc456ca0d1ed" "checksum nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d37e713a259ff641624b6cb20e3b12b2952313ba36b6823c0f16e6cfd9e5de17" "checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2" +"checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" "checksum objc 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "9833ab0efe5361b1e2122a0544a5d3359576911a42cb098c2e59be8650807367" "checksum objc-foundation 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" "checksum objc_exception 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "098cd29a2fa3c230d3463ae069cecccc3fdfd64c0d2496ab5b96f82dab6a00dc" @@ -1098,15 +1196,21 @@ dependencies = [ "checksum parking_lot_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad7f7e6ebdc79edff6fdcb87a55b620174f7a989e3eb31b65231f4af57f00b8c" "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" "checksum pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c" -"checksum proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)" = "ffe022fb8c8bd254524b0b3305906c1921fa37a84a644e29079a9e62200c3901" +"checksum proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1b06e2f335f48d24442b35a19df506a835fb3547bc3c06ef27340da9acf5cae7" +"checksum proc-macro2 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)" = "3d7b7eaaa90b4a90a932a9ea6666c95a389e424eff347f0f793979289429feee" "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" +"checksum quote 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9949cfe66888ffe1d53e6ec9d9f3b70714083854be20fd5e271b232a017401e8" "checksum quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dd636425967c33af890042c483632d33fa7a18f19ad1d7ea72e8998c6ef8dea5" "checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c" -"checksum rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "edecf0f94da5551fc9b492093e30b041a891657db7940ee221f9d2f66e82eef2" +"checksum rand_core 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1961a422c4d189dfb50ffa9320bf1f2a9bd54ecb92792fb9477f99a1045f3372" +"checksum rand_core 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db" +"checksum rayon 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "df7a791f788cb4c516f0e091301a29c2b71ef680db5e644a7d68835c8ae6dbfa" +"checksum rayon-core 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b055d1e92aba6877574d8fe604a63c8b5df60f60e5982bf7ccbb1338ea527356" "checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" -"checksum relevant 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c2b087c662aa6d36c6bb22c44a97911196ffd4a1df324c1fabdbcb80d18b0302" +"checksum relevant 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e6b31ca5a7e746cef084e923742e6f6191e300a16129c6e8e29d70ed555e7176" "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" +"checksum rendy-memory 0.1.0 (git+https://github.com/rustgd/rendy?rev=ce7dd7f)" = "" "checksum rustc-demangle 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "bcfe5b13211b4d78e5c2cadfebd7769197d95c639c35a50057eb4c05de811395" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7153dd96dade874ab973e098cb62fcdbb89a03682e46b144fd09550998d4a4a7" @@ -1114,31 +1218,29 @@ dependencies = [ "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)" = "84257ccd054dc351472528c8587b4de2dbf0dc0fe2e634030c1a90bfdacebaa9" -"checksum serde_derive 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)" = "652bc323d694dc925829725ec6c890156d8e70ae5202919869cb00fe2eff3788" -"checksum serde_derive_internals 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "32f1926285523b2db55df263d2aa4eb69ddcfa7a7eade6430323637866b513ab" -"checksum serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)" = "bb47a3d5c84320222f66d7db21157c4a7407755de41798f9b4c1c40593397b1a" +"checksum serde_derive 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)" = "ac38f51a52a556cd17545798e29536885fb1a3fa63d6399f5ef650f4a7d35901" +"checksum serde_json 1.0.32 (registry+https://github.com/rust-lang/crates.io-index)" = "43344e7ce05d0d8280c5940cabb4964bea626aa58b1ec0e8c73fa2a8512a38ce" "checksum shared_library 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" "checksum smallvec 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "153ffa32fd170e9944f7e0838edf824a754ec4c1fc64746fcc9fe1f8fa602e5d" "checksum smithay-client-toolkit 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f1609083d6bca3991a3c648d80ae16e1764d70881c3321bee1c915149073d605" -"checksum spirv_cross 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1c2c0be48967fec392de4749ac34a2da758aaa359ca648abaa47b90b36845013" "checksum spirv_cross 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2cc3aef2f7822a4fdd4174f547700f208bbc0f0871c59b754573717c92fd29f4" "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" "checksum storage-map 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cb94f167ccba0941876c8e722e888be8b4c05511ffdacc8cfcd4c647adfd424d" "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" "checksum syn 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)" = "58fd09df59565db3399efbba34ba8a2fec1307511ebd245d0061ff9d42691673" -"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" +"checksum syn 0.13.11 (registry+https://github.com/rust-lang/crates.io-index)" = "14f9bf6292f3a61d2c716723fdb789a41bbe104168e6f496dc6497e531ea1b9b" "checksum syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)" = "261ae9ecaa397c42b960649561949d69311f08eeaea86a65696e6e46517cf741" -"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" "checksum synstructure 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "85bb9b7550d063ea184027c9b8c20ac167cd36d3e06b3a40bceb9d746dc1a7b7" "checksum tempfile 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "55c1195ef8513f3273d55ff59fe5da6940287a0d7a98331254397f464833675b" "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" "checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6" -"checksum toml 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b7e7d59d55f36979a9dd86d71ae54657a5e9c7fdb4fa2212f4064e2d32f9dcda" +"checksum toml 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "4a2ecc31b0351ea18b3fe11274b8db6e4d82bce861bbb22e6dbed40417902c65" "checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526" "checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" +"checksum veclist 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f962bc5a4432ebd146dcd59e4e2438979ade49d7fda13a6a57f60ab0a78586e8" "checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum wayland-client 0.20.12 (registry+https://github.com/rust-lang/crates.io-index)" = "e7516a23419a55bd2e6d466c75a6a52c85718e5013660603289c2b8bee794b12" @@ -1150,7 +1252,6 @@ dependencies = [ "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" "checksum winit 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ba44cf306b981badc781894ab5d6fda54764a0512cbbf8db4685d329014143fa" -"checksum wio 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8a31e8a268d6941ffb7f8d7989fc93e4692bd3e75a27d400a72b4be1dadb213" "checksum x11 2.18.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39697e3123f715483d311b5826e254b6f3cfebdd83cf7ef3358f579c3d68e235" "checksum x11-dl 2.18.3 (registry+https://github.com/rust-lang/crates.io-index)" = "940586acb859ea05c53971ac231685799a7ec1dee66ac0bccc0e6ad96e06b4e3" "checksum xcb 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5e917a3f24142e9ff8be2414e36c649d47d6cc2ba81f16201cdef96e533e02de" diff --git a/wgpu-native/Cargo.toml b/wgpu-native/Cargo.toml index cfdc410f6b..40d5c911d9 100644 --- a/wgpu-native/Cargo.toml +++ b/wgpu-native/Cargo.toml @@ -17,9 +17,9 @@ remote = ["parking_lot"] bitflags = "1.0" lazy_static = "1.1.0" parking_lot = { version = "0.6", optional = true } -gfx-hal = { git = "https://github.com/gfx-rs/gfx", rev = "a435a05" } # required by gfx-memory -gfx-backend-empty = { git = "https://github.com/gfx-rs/gfx", rev = "a435a05" } -gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "a435a05", optional = true } -gfx-backend-dx12 = { git = "https://github.com/gfx-rs/gfx", rev = "a435a05", optional = true } -gfx-backend-metal = { git = "https://github.com/gfx-rs/gfx", rev = "a435a05", optional = true } -gfx-memory = { git = "https://github.com/gfx-rs/gfx-memory", rev = "483d64d" } +gfx-hal = { git = "https://github.com/gfx-rs/gfx" } # required by gfx-memory +gfx-backend-empty = { git = "https://github.com/gfx-rs/gfx" } +gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", optional = true } +gfx-backend-dx12 = { git = "https://github.com/gfx-rs/gfx", optional = true } +gfx-backend-metal = { git = "https://github.com/gfx-rs/gfx", optional = true } +rendy-memory = { git = "https://github.com/rustgd/rendy", rev = "ce7dd7f", features = ["gfx-hal"] } diff --git a/wgpu-native/src/conv.rs b/wgpu-native/src/conv.rs index f9b99b4906..d2c977ed88 100644 --- a/wgpu-native/src/conv.rs +++ b/wgpu-native/src/conv.rs @@ -286,4 +286,4 @@ pub(crate) fn map_texture_usage_flags(flags: u32, format: hal::format::Format) - // Note: TextureUsageFlags::Present does not need to be handled explicitly // TODO: HAL Transient Attachment, HAL Input Attachment value -} \ No newline at end of file +} diff --git a/wgpu-native/src/device.rs b/wgpu-native/src/device.rs index e0f409e1c2..79796efc71 100644 --- a/wgpu-native/src/device.rs +++ b/wgpu-native/src/device.rs @@ -1,8 +1,8 @@ -use {back, binding_model, command, conv, memory, pipeline}; +use {back, binding_model, command, conv, pipeline, resource}; use registry::{HUB, Items, Registry}; use { AttachmentStateId, BindGroupLayoutId, BlendStateId, CommandBufferId, DepthStencilStateId, - DeviceId, PipelineLayoutId, QueueId, RenderPipelineId, ShaderModuleId, + DeviceId, PipelineLayoutId, QueueId, RenderPipelineId, ShaderModuleId, TextureId, }; use hal::command::RawCommandBuffer; @@ -10,13 +10,15 @@ use hal::queue::RawCommandQueue; use hal::{self, Device as _Device}; use std::{ffi, slice}; +use rendy_memory::{allocator, Config, Heaps}; pub struct Device { pub(crate) raw: B::Device, queue_group: hal::QueueGroup, - mem_allocator: memory::SmartAllocator, + mem_allocator: Heaps, com_allocator: command::CommandAllocator, + mem_props: hal::MemoryProperties, } impl Device { @@ -25,11 +27,33 @@ impl Device { queue_group: hal::QueueGroup, mem_props: hal::MemoryProperties, ) -> Self { + // TODO: These values are just taken from rendy's test + // Need to set reasonable values per memory type instead + let arena = Some(allocator::ArenaConfig { + arena_size: 32 * 1024, + }); + let dynamic = Some(allocator::DynamicConfig { + blocks_per_chunk: 64, + block_size_granularity: 256, + max_block_size: 32 * 1024, + }); + let config = Config { arena, dynamic }; + let mem_allocator = unsafe { + Heaps::new( + mem_props + .memory_types + .iter() + .map(|mt| (mt.properties.into(), mt.heap_index as u32, config)), + mem_props.memory_heaps.clone(), + ) + }; + Device { raw, - mem_allocator: memory::SmartAllocator::new(mem_props, 1, 1, 1, 1), + mem_allocator, com_allocator: command::CommandAllocator::new(queue_group.family()), queue_group, + mem_props, } } } @@ -38,6 +62,52 @@ pub(crate) struct ShaderModule { pub raw: B::ShaderModule, } +#[no_mangle] +pub extern "C" fn wgpu_device_create_texture( + device_id: DeviceId, + desc: resource::TextureDescriptor, +) -> TextureId { + let kind = conv::map_texture_dimension_size(desc.dimension, desc.size); + let format = conv::map_texture_format(desc.format); + let usage = conv::map_texture_usage_flags(desc.usage, format); + let device_guard = HUB.devices.lock(); + let device = &device_guard.get(device_id); + let image_unbound = device + .raw + .create_image( + kind, + 1, // TODO: mips + format, + hal::image::Tiling::Optimal, // TODO: linear + usage, + hal::image::ViewCapabilities::empty(), // TODO: format, 2d array, cube + ) + .unwrap(); + let image_req = device.raw.get_image_requirements(&image_unbound); + let device_type = device + .mem_props + .memory_types + .iter() + .enumerate() + .position(|(id, memory_type)| { // TODO + image_req.type_mask & (1 << id) != 0 + && memory_type.properties.contains(hal::memory::Properties::DEVICE_LOCAL) + }) + .unwrap() + .into(); + // TODO: allocate with rendy + let image_memory = device.raw.allocate_memory(device_type, image_req.size).unwrap(); + let bound_image = device + .raw + .bind_image_memory(&image_memory, 0, image_unbound) + .unwrap(); + HUB.textures + .lock() + .register(resource::Texture { + raw: bound_image, + }) +} + #[no_mangle] pub extern "C" fn wgpu_device_create_bind_group_layout( device_id: DeviceId, diff --git a/wgpu-native/src/lib.rs b/wgpu-native/src/lib.rs index 68a903fc51..9d3248aa56 100644 --- a/wgpu-native/src/lib.rs +++ b/wgpu-native/src/lib.rs @@ -19,7 +19,7 @@ extern crate gfx_backend_metal as back; extern crate gfx_backend_vulkan as back; extern crate gfx_hal as hal; -extern crate gfx_memory as memory; +extern crate rendy_memory; mod binding_model; mod command; @@ -99,6 +99,7 @@ pub type BufferId = Id; // Resource pub type TextureViewId = Id; pub type TextureId = Id; +type TextureHandle = Texture; pub type SamplerId = Id; // Binding model diff --git a/wgpu-native/src/registry/mod.rs b/wgpu-native/src/registry/mod.rs index 49dbe3ba4a..ca9a32b5c2 100644 --- a/wgpu-native/src/registry/mod.rs +++ b/wgpu-native/src/registry/mod.rs @@ -13,6 +13,7 @@ use { BlendStateHandle, CommandBufferHandle, DepthStencilStateHandle, DeviceHandle, InstanceHandle, RenderPassHandle, ComputePassHandle, PipelineLayoutHandle, RenderPipelineHandle, ComputePipelineHandle, ShaderModuleHandle, + TextureHandle, }; @@ -47,6 +48,7 @@ pub struct Hub { pub(crate) compute_pipelines: ConcreteRegistry, pub(crate) render_passes: ConcreteRegistry, pub(crate) compute_passes: ConcreteRegistry, + pub(crate) textures: ConcreteRegistry, } lazy_static! { diff --git a/wgpu-native/src/resource.rs b/wgpu-native/src/resource.rs index 8154ef81ae..884a1d3a3e 100644 --- a/wgpu-native/src/resource.rs +++ b/wgpu-native/src/resource.rs @@ -76,8 +76,8 @@ pub struct TextureDescriptor { pub usage: TextureUsageFlags, } -pub struct Texture { - // TODO: create_texture_view() +pub struct Texture { + pub(crate) raw: B::Image, } #[repr(C)] From b2ec3233b0b673be2cd5b960d0c79088acd5dfea Mon Sep 17 00:00:00 2001 From: Joshua Groves Date: Sat, 6 Oct 2018 22:37:36 -0600 Subject: [PATCH 4/5] Update header --- wgpu-bindings/wgpu.h | 52 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/wgpu-bindings/wgpu.h b/wgpu-bindings/wgpu.h index 36c1e7592b..cbfcc4508d 100644 --- a/wgpu-bindings/wgpu.h +++ b/wgpu-bindings/wgpu.h @@ -28,6 +28,20 @@ #define WGPUShaderStageFlags_VERTEX 1 +#define WGPUTextureUsageFlags_NONE 0 + +#define WGPUTextureUsageFlags_OUTPUT_ATTACHMENT 16 + +#define WGPUTextureUsageFlags_PRESENT 32 + +#define WGPUTextureUsageFlags_SAMPLED 4 + +#define WGPUTextureUsageFlags_STORAGE 8 + +#define WGPUTextureUsageFlags_TRANSFER_DST 2 + +#define WGPUTextureUsageFlags_TRANSFER_SRC 1 + typedef enum { WGPUBindingType_UniformBuffer = 0, WGPUBindingType_Sampler = 1, @@ -101,6 +115,12 @@ typedef enum { WGPUStencilOperation_DecrementWrap = 7, } WGPUStencilOperation; +typedef enum { + WGPUTextureDimension_D1, + WGPUTextureDimension_D2, + WGPUTextureDimension_D3, +} WGPUTextureDimension; + typedef enum { WGPUTextureFormat_R8g8b8a8Unorm = 0, WGPUTextureFormat_R8g8b8a8Uint = 1, @@ -228,12 +248,42 @@ typedef struct { WGPUByteArray code; } WGPUShaderModuleDescriptor; +typedef WGPUId WGPUTextureId; + +typedef struct { + uint32_t width; + uint32_t height; + uint32_t depth; +} WGPUExtent3d; + +typedef uint32_t WGPUTextureUsageFlags; + +typedef struct { + WGPUExtent3d size; + uint32_t array_size; + WGPUTextureDimension dimension; + WGPUTextureFormat format; + WGPUTextureUsageFlags usage; +} WGPUTextureDescriptor; + typedef WGPUId WGPUQueueId; typedef struct { WGPUPowerPreference power_preference; } WGPUAdapterDescriptor; +#define WGPUBLACK (Color){ .r = 0, .g = 0, .b = 0, .a = 1 } + +#define WGPUBLUE (Color){ .r = 0, .g = 0, .b = 1, .a = 1 } + +#define WGPUGREEN (Color){ .r = 0, .g = 1, .b = 0, .a = 1 } + +#define WGPURED (Color){ .r = 1, .g = 0, .b = 0, .a = 1 } + +#define WGPUTRANSPARENT (Color){ .r = 0, .g = 0, .b = 0, .a = 0 } + +#define WGPUWHITE (Color){ .r = 1, .g = 1, .b = 1, .a = 1 } + WGPUDeviceId wgpu_adapter_create_device(WGPUAdapterId adapter_id, WGPUDeviceDescriptor _desc); WGPUComputePassId wgpu_command_buffer_begin_compute_pass(WGPUCommandBufferId command_buffer_id); @@ -269,6 +319,8 @@ WGPURenderPipelineId wgpu_device_create_render_pipeline(WGPUDeviceId device_id, WGPUShaderModuleId wgpu_device_create_shader_module(WGPUDeviceId device_id, WGPUShaderModuleDescriptor desc); +WGPUTextureId wgpu_device_create_texture(WGPUDeviceId device_id, WGPUTextureDescriptor desc); + WGPUQueueId wgpu_device_get_queue(WGPUDeviceId device_id); WGPUAdapterId wgpu_instance_get_adapter(WGPUInstanceId instance_id, WGPUAdapterDescriptor desc); From 897c5b9e8669301b610ec636ca773baa978b5913 Mon Sep 17 00:00:00 2001 From: Joshua Groves Date: Sun, 7 Oct 2018 09:22:24 -0600 Subject: [PATCH 5/5] Add texture creation to C example --- examples/hello_triangle_c/main.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/examples/hello_triangle_c/main.c b/examples/hello_triangle_c/main.c index 8115e3d86d..4e025c73fa 100644 --- a/examples/hello_triangle_c/main.c +++ b/examples/hello_triangle_c/main.c @@ -135,5 +135,27 @@ int main() WGPUQueueId queue = wgpu_device_get_queue(device); wgpu_queue_submit(queue, &cmd_buf, 1); + const uint32_t TEXTURE_WIDTH = 800; + const uint32_t TEXTURE_HEIGHT = 600; + + WGPUExtent3d texture_size = { + .width = TEXTURE_WIDTH, + .height = TEXTURE_HEIGHT, + .depth = 1, + }; + + const WGPUTextureFormat texture_format = WGPUTextureFormat_R8g8b8a8Unorm; + const WGPUTextureUsageFlags texture_usage = WGPUTextureUsageFlags_TRANSFER_DST | WGPUTextureUsageFlags_SAMPLED; + + WGPUTextureDescriptor texture_desc = { + .size = texture_size, + .array_size = 1, + .dimension = WGPUTextureDimension_D2, + .format = texture_format, + .usage = texture_usage, + }; + + WGPUTextureId texture = wgpu_device_create_texture(device, texture_desc); + return 0; }