fix(presenter): type the Vulkan extension pointers as c_char, not i8
`char` is signed on x86_64 but UNSIGNED on aarch64, so the hardcoded `Vec<*const i8>` compiles on every desktop target and then fails to match ash's `&[*const c_char]` when cross-compiling the client for ARM. Found by the aarch64 cross-build spike (punktfunk-planning: embedded-arm64-client.md) — the only portability defect in the client stack; nothing else in the client crates assumes an architecture. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -11,7 +11,7 @@ use crate::dmabuf;
|
|||||||
use anyhow::{anyhow, bail, Context as _, Result};
|
use anyhow::{anyhow, bail, Context as _, Result};
|
||||||
use ash::vk;
|
use ash::vk;
|
||||||
use ash::vk::Handle as _;
|
use ash::vk::Handle as _;
|
||||||
use std::ffi::CString;
|
use std::ffi::{c_char, CString};
|
||||||
|
|
||||||
impl Presenter {
|
impl Presenter {
|
||||||
/// Bring up instance → surface → device → swapchain over an SDL window.
|
/// Bring up instance → surface → device → swapchain over an SDL window.
|
||||||
@@ -40,7 +40,10 @@ impl Presenter {
|
|||||||
.iter()
|
.iter()
|
||||||
.map(|e| CString::new(e.as_str()).unwrap())
|
.map(|e| CString::new(e.as_str()).unwrap())
|
||||||
.collect();
|
.collect();
|
||||||
let ext_ptrs: Vec<*const i8> = ext_cstrings.iter().map(|e| e.as_ptr()).collect();
|
// `c_char`, not `i8`: plain `char` is SIGNED on x86_64 but UNSIGNED on aarch64, so a
|
||||||
|
// hardcoded `*const i8` compiles on the desktop targets and fails to match ash's
|
||||||
|
// `&[*const c_char]` on ARM.
|
||||||
|
let ext_ptrs: Vec<*const c_char> = ext_cstrings.iter().map(|e| e.as_ptr()).collect();
|
||||||
let instance = unsafe {
|
let instance = unsafe {
|
||||||
entry.create_instance(
|
entry.create_instance(
|
||||||
&vk::InstanceCreateInfo::default()
|
&vk::InstanceCreateInfo::default()
|
||||||
|
|||||||
Reference in New Issue
Block a user