Skip to content

Commit ecaff16

Browse files
committed
Update ash, winit
NOTE: This commit *breaks* the simulator. It has already been a bit of a hack, but the winit update has meant that we need to revisit its architecture completely.
1 parent 6d2d2ca commit ecaff16

File tree

27 files changed

+749
-755
lines changed

27 files changed

+749
-755
lines changed

Cargo.toml

Lines changed: 56 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,62 @@
11
[workspace]
22
members = [
3-
"benchmarks/stress-test",
4-
"examples/complex-scene",
5-
"examples/crab-saber",
6-
"examples/custom-rendering",
7-
"examples/shared",
8-
"examples/simple-scene",
9-
"hotham-asset-client",
10-
"hotham-asset-server",
11-
"hotham-simulator",
12-
"hotham",
3+
"benchmarks/stress-test",
4+
"examples/complex-scene",
5+
"examples/crab-saber",
6+
"examples/custom-rendering",
7+
"examples/shared",
8+
"examples/simple-scene",
9+
"hotham-asset-client",
10+
"hotham-asset-server",
11+
"hotham-simulator",
12+
"hotham",
1313
]
14+
resolver = "2"
15+
16+
[workspace.dependencies]
17+
ash = "0.38.0"
18+
ash-window = "0.13"
19+
anyhow = "1.0"
20+
bitflags = "1.3"
21+
cpal = "0.15.2"
22+
ctrlc = { version = "3", features = ["termination"] }
23+
egui = "0.15"
24+
generational-arena = "0.2.8"
25+
glam = { features = ["mint", "serde", "approx"], version = "0.23" }
26+
gltf = { version = "1.0", features = [
27+
"KHR_lights_punctual",
28+
"KHR_materials_unlit",
29+
"names",
30+
"utils",
31+
], default-features = false }
32+
half = "2.1.0"
33+
hecs = "0.10.1"
34+
hotham-asset-client = { path = "../hotham-asset-client" }
35+
id-arena = "2.2.1"
36+
image = { version = "0.24.3", default-features = false, features = [
37+
"jpeg",
38+
"png",
39+
] }
40+
itertools = "0.10.0"
41+
# ktx2 = "0.3"
42+
ktx2 = { git = "https://github.com/BVE-Reborn/ktx2", rev = "be27131c716686a416e6a805a26384f74a7353ff" }
43+
lazy_static = "1.4.0"
44+
mint = "0.5.6"
45+
notify-debouncer-mini = "0.2.1"
46+
oddio = "0.5"
47+
openxr = { features = ["loaded", "mint"], version = "0.17" }
48+
openxr-sys = "0.9"
49+
rand = "0.8"
50+
rapier3d = "0.17"
51+
raw_window_handle = "0.9.2"
52+
ruzstd = "0.3"
53+
serde = { version = "1.0", features = ["derive"] }
54+
symphonia = { version = "0.5", default-features = false, features = ["mp3"] }
55+
thiserror = "1.0"
56+
tokio = { version = "1.0.1", default-features = false, features = ["rt"] }
57+
vk-shader-macros = "0.2.8"
58+
winit = "0.30.11"
59+
1460

1561
# Make performance critical packages compile with optimizations
1662
[profile.dev.package.rapier3d]

benchmarks/stress-test/Cargo.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
edition = "2018"
2+
edition = "2021"
33
license = "MIT OR Apache-2.0"
44
name = "hotham-stress-test"
55
version = "0.2.0"
@@ -12,7 +12,7 @@ name = "hotham_stress_test_desktop"
1212
path = "src/main.rs"
1313

1414
[dependencies]
15-
hotham = {path = "../../hotham"}
15+
hotham = { path = "../../hotham" }
1616

1717
[target.'cfg(target_os = "android")'.dependencies]
1818
ndk-glue = "0.6"
@@ -49,7 +49,10 @@ value = "vr_only"
4949

5050
[[package.metadata.android.application.activity.intent_filter]]
5151
actions = ["android.intent.action.MAIN"]
52-
categories = ["com.oculus.intent.category.VR", "android.intent.category.LAUNCHER"]
52+
categories = [
53+
"com.oculus.intent.category.VR",
54+
"android.intent.category.LAUNCHER",
55+
]
5356

5457
[[package.metadata.android.application.activity.meta_data]]
5558
name = "com.oculus.vr.focusaware"

examples/complex-scene/Cargo.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
edition = "2018"
2+
edition = "2021"
33
license = "MIT OR Apache-2.0"
44
name = "complex-scene-example"
55
version = "0.2.0"
@@ -12,8 +12,8 @@ name = "hotham_complex_scene_example"
1212
path = "src/main.rs"
1313

1414
[dependencies]
15-
hotham = {path = "../../hotham"}
16-
hotham-examples = {path = "../shared"}
15+
hotham = { path = "../../hotham" }
16+
hotham-examples = { path = "../shared" }
1717

1818
[target.'cfg(target_os = "android")'.dependencies]
1919
ndk-glue = "0.6"
@@ -50,7 +50,10 @@ value = "vr_only"
5050

5151
[[package.metadata.android.application.activity.intent_filter]]
5252
actions = ["android.intent.action.MAIN"]
53-
categories = ["com.oculus.intent.category.VR", "android.intent.category.LAUNCHER"]
53+
categories = [
54+
"com.oculus.intent.category.VR",
55+
"android.intent.category.LAUNCHER",
56+
]
5457

5558
[[package.metadata.android.application.activity.meta_data]]
5659
name = "com.oculus.vr.focusaware"

examples/crab-saber/Cargo.toml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
[package]
2-
edition = "2018"
2+
edition = "2021"
33
license = "MIT OR Apache-2.0"
44
name = "crab-saber"
55
version = "0.2.0"
66

77
[lib]
8-
crate-type = ["cdylib"]
8+
crate-type = ["rlib", "cdylib"]
99

1010
[[bin]]
1111
name = "hotham_crab_saber"
1212
path = "src/main.rs"
1313

1414
[dependencies]
15-
hotham = {path = "../../hotham"}
15+
hotham = { path = "../../hotham" }
1616
rand = "0.8.0"
1717

1818
[dev-dependencies]
1919
approx = "0.5"
2020

2121
[target.'cfg(target_os = "android")'.dependencies]
22-
ndk-glue = "0.6"
22+
ndk-glue = "0.7"
2323

2424
[package.metadata.android]
2525
apk_label = "Crab Saber"
@@ -53,7 +53,10 @@ value = "vr_only"
5353

5454
[[package.metadata.android.application.activity.intent_filter]]
5555
actions = ["android.intent.action.MAIN"]
56-
categories = ["com.oculus.intent.category.VR", "android.intent.category.LAUNCHER"]
56+
categories = [
57+
"com.oculus.intent.category.VR",
58+
"android.intent.category.LAUNCHER",
59+
]
5760

5861
[[package.metadata.android.application.activity.meta_data]]
5962
name = "com.oculus.vr.focusaware"

examples/crab-saber/src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
crab_saber::real_main().unwrap()
3+
}

examples/custom-rendering/Cargo.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
edition = "2018"
2+
edition = "2021"
33
license = "MIT OR Apache-2.0"
44
name = "custom-rendering-example"
55
version = "0.2.0"
@@ -12,8 +12,8 @@ name = "hotham_custom_rendering_example"
1212
path = "src/main.rs"
1313

1414
[dependencies]
15-
hotham = {path = "../../hotham"}
16-
hotham-examples = {path = "../shared"}
15+
hotham = { path = "../../hotham" }
16+
hotham-examples = { path = "../shared" }
1717

1818
[target.'cfg(target_os = "android")'.dependencies]
1919
ndk-glue = "0.6"
@@ -50,7 +50,10 @@ value = "vr_only"
5050

5151
[[package.metadata.android.application.activity.intent_filter]]
5252
actions = ["android.intent.action.MAIN"]
53-
categories = ["com.oculus.intent.category.VR", "android.intent.category.LAUNCHER"]
53+
categories = [
54+
"com.oculus.intent.category.VR",
55+
"android.intent.category.LAUNCHER",
56+
]
5457

5558
[[package.metadata.android.application.activity.meta_data]]
5659
name = "com.oculus.vr.focusaware"

examples/custom-rendering/src/custom_render_context.rs

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl CustomRenderContext {
7070
render_context.descriptors.graphics_layout,
7171
quadrics_descriptor_set_layout,
7272
];
73-
let create_info = &vk::PipelineLayoutCreateInfo::builder().set_layouts(&layouts);
73+
let create_info = &vk::PipelineLayoutCreateInfo::default().set_layouts(&layouts);
7474
let quadrics_pipeline_layout =
7575
unsafe { device.create_pipeline_layout(create_info, None).unwrap() };
7676
let vertex_shader_code: Vec<u32> = QUADRIC_VERT.into();
@@ -88,7 +88,7 @@ impl CustomRenderContext {
8888
vulkan_context
8989
.device
9090
.allocate_descriptor_sets(
91-
&vk::DescriptorSetAllocateInfo::builder()
91+
&vk::DescriptorSetAllocateInfo::default()
9292
.descriptor_pool(render_context.descriptors.pool)
9393
.set_layouts(slice::from_ref(&quadrics_descriptor_set_layout)),
9494
)
@@ -134,12 +134,12 @@ fn create_quadrics_descriptor_set_layout(device: &ash::Device) -> vk::Descriptor
134134
];
135135

136136
let descriptor_flags = [vk::DescriptorBindingFlags::empty()];
137-
let mut binding_flags = vk::DescriptorSetLayoutBindingFlagsCreateInfoEXT::builder()
137+
let mut binding_flags = vk::DescriptorSetLayoutBindingFlagsCreateInfoEXT::default()
138138
.binding_flags(&descriptor_flags);
139139

140140
unsafe {
141141
device.create_descriptor_set_layout(
142-
&vk::DescriptorSetLayoutCreateInfo::builder()
142+
&vk::DescriptorSetLayoutCreateInfo::default()
143143
.bindings(&quadrics_bindings)
144144
.push_next(&mut binding_flags)
145145
.flags(vk::DescriptorSetLayoutCreateFlags::UPDATE_AFTER_BIND_POOL),
@@ -175,25 +175,23 @@ pub fn create_quadrics_pipeline(
175175
let stages = [vertex_stage, fragment_stage];
176176

177177
// Vertex input state
178-
let position_binding_description = vk::VertexInputBindingDescription::builder()
178+
let position_binding_description = vk::VertexInputBindingDescription::default()
179179
.binding(0)
180180
.stride(size_of::<Vec3>() as _)
181-
.input_rate(vk::VertexInputRate::VERTEX)
182-
.build();
183-
let vertex_binding_description = vk::VertexInputBindingDescription::builder()
181+
.input_rate(vk::VertexInputRate::VERTEX);
182+
let vertex_binding_description = vk::VertexInputBindingDescription::default()
184183
.binding(1)
185184
.stride(size_of::<Vertex>() as _)
186-
.input_rate(vk::VertexInputRate::VERTEX)
187-
.build();
185+
.input_rate(vk::VertexInputRate::VERTEX);
188186
let vertex_binding_descriptions = [position_binding_description, vertex_binding_description];
189187
let vertex_attribute_descriptions = Vertex::attribute_descriptions();
190188

191-
let vertex_input_state = vk::PipelineVertexInputStateCreateInfo::builder()
189+
let vertex_input_state = vk::PipelineVertexInputStateCreateInfo::default()
192190
.vertex_attribute_descriptions(&vertex_attribute_descriptions)
193191
.vertex_binding_descriptions(&vertex_binding_descriptions);
194192

195193
// Input assembly state
196-
let input_assembly_state = vk::PipelineInputAssemblyStateCreateInfo::builder()
194+
let input_assembly_state = vk::PipelineInputAssemblyStateCreateInfo::default()
197195
.topology(vk::PrimitiveTopology::TRIANGLE_LIST);
198196

199197
// Viewport State
@@ -210,12 +208,12 @@ pub fn create_quadrics_pipeline(
210208
// Scissors
211209
let scissors = [*render_area];
212210

213-
let viewport_state = vk::PipelineViewportStateCreateInfo::builder()
211+
let viewport_state = vk::PipelineViewportStateCreateInfo::default()
214212
.viewports(&viewports)
215213
.scissors(&scissors);
216214

217215
// Rasterization state
218-
let rasterization_state = vk::PipelineRasterizationStateCreateInfo::builder()
216+
let rasterization_state = vk::PipelineRasterizationStateCreateInfo::default()
219217
.polygon_mode(vk::PolygonMode::FILL)
220218
.cull_mode(vk::CullModeFlags::BACK)
221219
.front_face(vk::FrontFace::COUNTER_CLOCKWISE)
@@ -228,11 +226,11 @@ pub fn create_quadrics_pipeline(
228226
.line_width(1.0);
229227

230228
// Multisample state
231-
let multisample_state = vk::PipelineMultisampleStateCreateInfo::builder()
229+
let multisample_state = vk::PipelineMultisampleStateCreateInfo::default()
232230
.rasterization_samples(vk::SampleCountFlags::TYPE_4);
233231

234232
// Depth stencil state
235-
let depth_stencil_state = vk::PipelineDepthStencilStateCreateInfo::builder()
233+
let depth_stencil_state = vk::PipelineDepthStencilStateCreateInfo::default()
236234
.depth_test_enable(true)
237235
.depth_write_enable(true)
238236
.depth_compare_op(vk::CompareOp::GREATER)
@@ -242,23 +240,22 @@ pub fn create_quadrics_pipeline(
242240
.stencil_test_enable(false);
243241

244242
// Color blend state
245-
let color_blend_attachment = vk::PipelineColorBlendAttachmentState::builder()
243+
let color_blend_attachment = vk::PipelineColorBlendAttachmentState::default()
246244
.color_write_mask(
247245
vk::ColorComponentFlags::R
248246
| vk::ColorComponentFlags::G
249247
| vk::ColorComponentFlags::B
250248
| vk::ColorComponentFlags::A,
251249
)
252-
.blend_enable(false)
253-
.build();
250+
.blend_enable(false);
254251

255252
let color_blend_attachments = [color_blend_attachment];
256253

257-
let color_blend_state = vk::PipelineColorBlendStateCreateInfo::builder()
254+
let color_blend_state = vk::PipelineColorBlendStateCreateInfo::default()
258255
.logic_op_enable(false)
259256
.attachments(&color_blend_attachments);
260257

261-
let create_info = vk::GraphicsPipelineCreateInfo::builder()
258+
let create_info = vk::GraphicsPipelineCreateInfo::default()
262259
.stages(&stages)
263260
.vertex_input_state(&vertex_input_state)
264261
.input_assembly_state(&input_assembly_state)
@@ -269,8 +266,7 @@ pub fn create_quadrics_pipeline(
269266
.color_blend_state(&color_blend_state)
270267
.layout(pipeline_layout)
271268
.render_pass(render_pass)
272-
.subpass(0)
273-
.build();
269+
.subpass(0);
274270

275271
let create_infos = [create_info];
276272

examples/shared/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
2-
edition = "2018"
2+
edition = "2021"
33
license = "MIT OR Apache-2.0"
44
name = "hotham-examples"
55
version = "0.2.0"
66

77
[dependencies]
8-
hotham = {path = "../../hotham"}
8+
hotham = { path = "../../hotham" }

examples/simple-scene/Cargo.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[package]
2-
edition = "2018"
2+
edition = "2021"
33
license = "MIT OR Apache-2.0"
44
name = "simple-scene-example"
55
version = "0.2.0"
66

77
[lib]
8-
crate-type = ["lib", "cdylib"]
8+
crate-type = ["rlib", "cdylib"]
99

1010
[dependencies]
11-
hotham = {path = "../../hotham"}
11+
hotham = { path = "../../hotham" }
1212

1313
[target.'cfg(target_os = "android")'.dependencies]
1414
ndk-glue = "0.7"
@@ -45,7 +45,10 @@ value = "vr_only"
4545

4646
[[package.metadata.android.application.activity.intent_filter]]
4747
actions = ["android.intent.action.MAIN"]
48-
categories = ["com.oculus.intent.category.VR", "android.intent.category.LAUNCHER"]
48+
categories = [
49+
"com.oculus.intent.category.VR",
50+
"android.intent.category.LAUNCHER",
51+
]
4952

5053
[[package.metadata.android.application.activity.meta_data]]
5154
name = "com.oculus.vr.focusaware"

0 commit comments

Comments
 (0)