spirv-std: prevent MIR inlining of buffer_{load,store}_intrinsic w/ #[inline(never)].

This commit is contained in:
Eduard-Mihai Burtescu 2023-06-08 15:16:48 +03:00 committed by Eduard-Mihai Burtescu
parent 92b975f53e
commit b2e5eb7595

View File

@ -3,8 +3,9 @@
use core::mem; use core::mem;
#[spirv(buffer_load_intrinsic)] #[spirv(buffer_load_intrinsic)]
// HACK(eddyb) try to prevent MIR inlining from breaking our intrinsics.
#[inline(never)]
#[spirv_std_macros::gpu_only] #[spirv_std_macros::gpu_only]
#[allow(improper_ctypes_definitions)]
unsafe fn buffer_load_intrinsic<T>( unsafe fn buffer_load_intrinsic<T>(
buffer: &[u32], buffer: &[u32],
// FIXME(eddyb) should be `usize`. // FIXME(eddyb) should be `usize`.
@ -22,8 +23,9 @@ unsafe fn buffer_load_intrinsic<T>(
} }
#[spirv(buffer_store_intrinsic)] #[spirv(buffer_store_intrinsic)]
// HACK(eddyb) try to prevent MIR inlining from breaking our intrinsics.
#[inline(never)]
#[spirv_std_macros::gpu_only] #[spirv_std_macros::gpu_only]
#[allow(improper_ctypes_definitions)]
unsafe fn buffer_store_intrinsic<T>( unsafe fn buffer_store_intrinsic<T>(
buffer: &mut [u32], buffer: &mut [u32],
// FIXME(eddyb) should be `usize`. // FIXME(eddyb) should be `usize`.