Skip to content

Commit

Permalink
spirv-std: prevent MIR inlining of buffer_{load,store}_intrinsic w/…
Browse files Browse the repository at this point in the history
… `#[inline(never)]`.
  • Loading branch information
eddyb committed Jun 8, 2023
1 parent d443c6c commit b174c54
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/spirv-std/src/byte_addressable_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>(
buffer: &[u32],
// FIXME(eddyb) should be `usize`.
Expand All @@ -22,8 +23,9 @@ unsafe fn buffer_load_intrinsic<T>(
}

#[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<T>(
buffer: &mut [u32],
// FIXME(eddyb) should be `usize`.
Expand Down

0 comments on commit b174c54

Please sign in to comment.