Skip to content

Commit

Permalink
Update dependencies (EmbarkStudios#765)
Browse files Browse the repository at this point in the history
  • Loading branch information
khyperia authored Oct 14, 2021
1 parent f8a1130 commit e2db97f
Show file tree
Hide file tree
Showing 11 changed files with 494 additions and 719 deletions.
1,018 changes: 390 additions & 628 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
resolver = "2"
members = [
"examples/runners/cpu",
"examples/runners/ash",
Expand Down
2 changes: 1 addition & 1 deletion crates/rustc_codegen_spirv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ topological-sort = "0.1"

[dev-dependencies]
pipe = "0.4"
pretty_assertions = "0.7"
pretty_assertions = "1.0"
tempfile = "3.2"

[package.metadata.rust-analyzer]
Expand Down
2 changes: 1 addition & 1 deletion crates/spirv-std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ bitflags = "1.2.1"
num-traits = { version = "0.2.14", default-features = false, features = ["libm"] }
spirv-types = { path = "./shared", version = "0.4.0-alpha.12" }
spirv-std-macros = { path = "./macros", version = "0.4.0-alpha.12" }
glam = { version = ">=0.17, <=0.18", default-features = false, features = ["libm"], optional = true }
glam = { version = ">=0.17, <=0.19", default-features = false, features = ["libm"], optional = true }

[features]
default = []
1 change: 1 addition & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ exceptions = [
# so we prefer to not have dependencies using it
# https://tldrlegal.com/license/creative-commons-cc0-1.0-universal
{ allow = ["CC0-1.0"], name = "notify" },
{ allow = ["CC0-1.0"], name = "hexf-parse" },
]
copyleft = "deny"

Expand Down
12 changes: 8 additions & 4 deletions examples/runners/ash/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,19 @@ use-installed-tools = ["spirv-builder/use-installed-tools"]
use-compiled-tools = ["spirv-builder/use-compiled-tools"]

[dependencies]
ash = "0.32"
ash-window = "0.6"
winit = "0.25.0"
ash = "0.33"
ash-window = "0.7"
winit = { git = "https://github.com/rust-windowing/winit", rev = "1b3b82a3c1369c5248a2e6a251230ba6c615e918" }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
structopt = "0.3.20"
cfg-if = "1.0.0"
shared = { path = "../../shaders/shared" }
spirv-builder = { path = "../../../crates/spirv-builder", default-features = false }

# TODO: Remove this once no longer needed, only needed to make cargo-deny happy for some reason.
# https://rustsec.org/advisories/RUSTSEC-2021-0119
nix = "0.20.2"

[target.'cfg(target_os = "macos")'.dependencies]
ash-molten = { git = "https://github.com/EmbarkStudios/ash-molten.git", rev = "fea270b0c9186b8a45e62215314204f4c16a57b6", features = ["pre-built"] }
ash-molten = { version = "0.11.0", features = ["pre-built"] }
5 changes: 2 additions & 3 deletions examples/runners/ash/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
use ash::{
extensions::{ext, khr},
util::read_spv,
version::{DeviceV1_0, EntryV1_0, InstanceV1_0},
vk,
};

Expand Down Expand Up @@ -247,7 +246,7 @@ impl RenderBase {
pub fn new(window: winit::window::Window, options: &Options) -> Self {
cfg_if::cfg_if! {
if #[cfg(target_os = "macos")] {
let entry = ash_molten::MoltenEntry::load().unwrap();
let entry = ash_molten::MoltenEntry::load();
} else {
let entry = unsafe { ash::Entry::new().unwrap() };
}
Expand Down Expand Up @@ -280,7 +279,7 @@ impl RenderBase {
.application_version(0)
.engine_name(&app_name)
.engine_version(0)
.api_version(vk::make_version(1, 2, 0));
.api_version(vk::make_api_version(1, 2, 0, 0));

let instance_create_info = vk::InstanceCreateInfo::builder()
.application_info(&appinfo)
Expand Down
14 changes: 7 additions & 7 deletions examples/runners/wgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ use-compiled-tools = ["spirv-builder/use-compiled-tools"]
cfg-if = "1.0.0"
shared = { path = "../../shaders/shared" }
futures = { version = "0.3", default-features = false, features = ["std", "executor"] }
wgpu = "0.9"
winit = { version = "0.25.0", features = ["web-sys"] }
clap = "3.0.0-beta.2"
strum = { version = "0.21.0", default_features = false, features = ["derive"] }
wgpu = { version = "0.11", features = ["spirv"] }
winit = { git = "https://github.com/rust-windowing/winit", rev = "1b3b82a3c1369c5248a2e6a251230ba6c615e918" }
structopt = "0.3"
strum = { version = "0.22.0", default_features = false, features = ["std", "derive"] }
bytemuck = "1.6.3"

[target.'cfg(not(any(target_os = "android", target_arch = "wasm32")))'.dependencies]
spirv-builder = { path = "../../../crates/spirv-builder", default-features = false, features = ["watch"] }

[target.'cfg(target_os = "android")'.dependencies]
ndk-glue = "0.3"
ndk-glue = "0.4"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
env_logger = "0.8.4"
env_logger = "0.9.0"

[target.'cfg(target_arch = "wasm32")'.dependencies]
web-sys = "=0.3.50"
web-sys = "=0.3.55"
console_error_panic_hook = "0.1.6"
console_log = "0.2.0"
wasm-bindgen-futures = "0.4.18"
23 changes: 13 additions & 10 deletions examples/runners/wgpu/src/compute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ pub fn start(options: &Options) {

pub async fn start_internal(
_options: &Options,
shader_binary: wgpu::ShaderModuleDescriptor<'static>,
shader_binary: wgpu::ShaderModuleDescriptorSpirV<'static>,
) {
let instance = wgpu::Instance::new(wgpu::BackendBit::PRIMARY);
let instance = wgpu::Instance::new(wgpu::Backends::PRIMARY);
let adapter = instance
.request_adapter(&wgpu::RequestAdapterOptions {
power_preference: wgpu::PowerPreference::default(),
force_fallback_adapter: false,
compatible_surface: None,
})
.await
Expand All @@ -37,7 +38,8 @@ pub async fn start_internal(
.request_device(
&wgpu::DeviceDescriptor {
label: None,
features: wgpu::Features::TIMESTAMP_QUERY,
features: wgpu::Features::TIMESTAMP_QUERY
| wgpu::Features::SPIRV_SHADER_PASSTHROUGH,
limits: wgpu::Limits::default(),
},
None,
Expand All @@ -50,7 +52,7 @@ pub async fn start_internal(
let timestamp_period = queue.get_timestamp_period();

// Load the shaders from disk
let module = device.create_shader_module(&shader_binary);
let module = unsafe { device.create_shader_module_spirv(&shader_binary) };

let top = 2u32.pow(20);
let src_range = 1..top;
Expand All @@ -70,7 +72,7 @@ pub async fn start_internal(
wgpu::BindGroupLayoutEntry {
binding: 0,
count: None,
visibility: wgpu::ShaderStage::COMPUTE,
visibility: wgpu::ShaderStages::COMPUTE,
ty: wgpu::BindingType::Buffer {
has_dynamic_offset: false,
min_binding_size: Some(NonZeroU64::new(1).unwrap()),
Expand All @@ -97,22 +99,22 @@ pub async fn start_internal(
label: None,
size: src.len() as wgpu::BufferAddress,
// Can be read to the CPU, and can be copied from the shader's storage buffer
usage: wgpu::BufferUsage::MAP_READ | wgpu::BufferUsage::COPY_DST,
usage: wgpu::BufferUsages::MAP_READ | wgpu::BufferUsages::COPY_DST,
mapped_at_creation: false,
});

let storage_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor {
label: Some("Collatz Conjecture Input"),
contents: &src,
usage: wgpu::BufferUsage::STORAGE
| wgpu::BufferUsage::COPY_DST
| wgpu::BufferUsage::COPY_SRC,
usage: wgpu::BufferUsages::STORAGE
| wgpu::BufferUsages::COPY_DST
| wgpu::BufferUsages::COPY_SRC,
});

let timestamp_buffer = device.create_buffer(&wgpu::BufferDescriptor {
label: Some("Timestamps buffer"),
size: 16,
usage: wgpu::BufferUsage::MAP_READ | wgpu::BufferUsage::COPY_DST,
usage: wgpu::BufferUsages::MAP_READ | wgpu::BufferUsages::COPY_DST,
mapped_at_creation: true,
});
timestamp_buffer.unmap();
Expand All @@ -127,6 +129,7 @@ pub async fn start_internal(
});

let queries = device.create_query_set(&wgpu::QuerySetDescriptor {
label: None,
count: 2,
ty: wgpu::QueryType::Timestamp,
});
Expand Down
Loading

0 comments on commit e2db97f

Please sign in to comment.