Skip to content

Commit e2add82

Browse files
Copilotdontpanic92
andauthored
Fix macOS CI: Update Vulkan toolchain and migrate to winit 0.30/ash 0.38 APIs (#65)
* Initial plan * Update macOS CI workflow with Vulkan SDK 1.4.304.0 and arm64-osx triplet Co-authored-by: dontpanic92 <[email protected]> * Improve Vulkan SDK installation with fallback method Co-authored-by: dontpanic92 <[email protected]> * Add sudo to Vulkan SDK installer and improve error handling Co-authored-by: dontpanic92 <[email protected]> * Add diagnostic output for Vulkan SDK extraction Co-authored-by: dontpanic92 <[email protected]> * Fix Vulkan SDK installation - use correct extracted directory name Co-authored-by: dontpanic92 <[email protected]> * Fix $HOME expansion and add VULKAN_SDK environment variables Co-authored-by: dontpanic92 <[email protected]> * Add Vulkan SDK PATH to Build step for glslc access Co-authored-by: dontpanic92 <[email protected]> * Centralize VULKAN_SDK_VERSION as workflow environment variable Co-authored-by: dontpanic92 <[email protected]> * Add diagnostic logging to debug glslc PATH issue Co-authored-by: dontpanic92 <[email protected]> * Install Vulkan SDK to default system location for PATH availability Co-authored-by: dontpanic92 <[email protected]> * Replace Vulkan SDK installer with Homebrew packages Co-authored-by: dontpanic92 <[email protected]> * Install shaderc instead of vulkan-tools to provide glslc Co-authored-by: dontpanic92 <[email protected]> * Fix winit API syntax errors for macOS/Android keyboard input Co-authored-by: dontpanic92 <[email protected]> * Fix ash API for macOS Vulkan extensions Co-authored-by: dontpanic92 <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: dontpanic92 <[email protected]>
1 parent 156a4b7 commit e2add82

File tree

3 files changed

+16
-19
lines changed

3 files changed

+16
-19
lines changed

.github/workflows/ci-macos.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ env:
1212
jobs:
1313
macos-build:
1414
runs-on: macos-latest
15+
env:
16+
VCPKG_FEATURE_FLAGS: manifests
1517
steps:
1618
- uses: actions/checkout@v4
1719
with:
@@ -24,10 +26,9 @@ jobs:
2426
- name: Install Deps
2527
run: |
2628
brew install automake fdk-aac git lame libass libtool libvorbis libvpx opus sdl shtool texi2html theora wget x264 x265 xvid nasm
27-
curl -O https://sdk.lunarg.com/sdk/download/1.2.198.1/mac/vulkansdk-macos-1.2.198.1.dmg
28-
hdiutil attach vulkansdk-macos-1.2.198.1.dmg
29-
cd /Volumes/vulkansdk-macos-1.2.198.1
30-
sudo ./InstallVulkan.app/Contents/MacOS/InstallVulkan --root ~/VulkanSDK/1.2.176.1 --accept-licenses --default-answer --confirm-command install
29+
# Install Vulkan tools via Homebrew
30+
# shaderc provides glslc (shader compiler needed by build.rs)
31+
brew install molten-vk vulkan-headers vulkan-loader shaderc
3132
- name: Cache ffmpeg
3233
uses: actions/cache@v3
3334
with:
@@ -36,7 +37,7 @@ jobs:
3637
- name: Install ffmpeg
3738
run: |
3839
vcpkg x-update-baseline
39-
vcpkg install --triplet=x64-osx
40+
vcpkg install --triplet=arm64-osx
4041
vcpkg integrate install
4142
- name: Build
4243
run: cargo build --workspace --release --verbose

radiance/radiance/src/input/keyboard/winit.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::input::{Key, KeyState};
22
#[cfg(any(target_os = "macos", target_os = "android"))]
33
use winit::event::WindowEvent;
44
use winit::{
5-
event::{DeviceEvent, ElementState, Event, RawKeyEvent},
5+
event::{DeviceEvent, ElementState, Event, KeyEvent, RawKeyEvent},
66
keyboard::{KeyCode, PhysicalKey},
77
};
88

@@ -46,19 +46,17 @@ impl KeyboardInput {
4646
Event::WindowEvent {
4747
event:
4848
WindowEvent::KeyboardInput {
49-
input:
50-
winit::event::KeyboardInput {
49+
event:
50+
winit::event::KeyEvent {
5151
state: ElementState::Pressed,
52-
virtual_keycode,
53-
scancode,
52+
physical_key: PhysicalKey::Code(code),
5453
..
5554
},
5655
..
5756
},
5857
..
5958
} => {
6059
keycode = Some(code);
61-
scan_code = scancode;
6260
action = Box::new(move |key| {
6361
states[key as usize].set_down(true);
6462
states[key as usize].set_pressed(true);
@@ -68,19 +66,17 @@ impl KeyboardInput {
6866
Event::WindowEvent {
6967
event:
7068
WindowEvent::KeyboardInput {
71-
input:
72-
winit::event::KeyboardInput {
69+
event:
70+
winit::event::KeyEvent {
7371
state: ElementState::Released,
74-
virtual_keycode,
75-
scancode,
72+
physical_key: PhysicalKey::Code(code),
7673
..
7774
},
7875
..
7976
},
8077
..
8178
} => {
82-
virtual_code = virtual_keycode;
83-
scan_code = scancode;
79+
keycode = Some(code);
8480
action = Box::new(|key| {
8581
states[key as usize].set_down(false);
8682
states[key as usize].set_released(true);

radiance/radiance/src/rendering/vulkan/helpers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ pub fn instance_extension_names() -> Vec<*const c_char> {
99
ash::khr::surface::NAME.as_ptr(),
1010
ash::ext::metal_surface::NAME.as_ptr(),
1111
ash::ext::debug_utils::NAME.as_ptr(),
12-
ash::vk::KhrPortabilityEnumerationFn::name().as_ptr(),
13-
ash::vk::KhrGetPhysicalDeviceProperties2Fn::name().as_ptr(),
12+
ash::khr::portability_enumeration::NAME.as_ptr(),
13+
ash::khr::get_physical_device_properties2::NAME.as_ptr(),
1414
]
1515
}
1616
#[cfg(target_os = "linux")]

0 commit comments

Comments
 (0)