From b2e5eb75951545782b121665c20f9f1c66fe5bdd Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Thu, 8 Jun 2023 15:16:48 +0300 Subject: [PATCH] spirv-std: prevent MIR inlining of `buffer_{load,store}_intrinsic` w/ `#[inline(never)]`. --- crates/spirv-std/src/byte_addressable_buffer.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/spirv-std/src/byte_addressable_buffer.rs b/crates/spirv-std/src/byte_addressable_buffer.rs index 3b67e65f8a..216ef027f8 100644 --- a/crates/spirv-std/src/byte_addressable_buffer.rs +++ b/crates/spirv-std/src/byte_addressable_buffer.rs @@ -3,8 +3,9 @@ use core::mem; #[spirv(buffer_load_intrinsic)] +// HACK(eddyb) try to prevent MIR inlining from breaking our intrinsics. +#[inline(never)] #[spirv_std_macros::gpu_only] -#[allow(improper_ctypes_definitions)] unsafe fn buffer_load_intrinsic( buffer: &[u32], // FIXME(eddyb) should be `usize`. @@ -22,8 +23,9 @@ unsafe fn buffer_load_intrinsic( } #[spirv(buffer_store_intrinsic)] +// HACK(eddyb) try to prevent MIR inlining from breaking our intrinsics. +#[inline(never)] #[spirv_std_macros::gpu_only] -#[allow(improper_ctypes_definitions)] unsafe fn buffer_store_intrinsic( buffer: &mut [u32], // FIXME(eddyb) should be `usize`.