MCPcopy Create free account
hub / github.com/Rust-GPU/rust-cuda / pack_pointer

Function pack_pointer

crates/optix_device/src/util.rs:4–8  ·  view source on GitHub ↗
(ptr: *mut T)

Source from the content-addressed store, hash-verified

2use glam::Vec3;
3
4pub fn pack_pointer<T>(ptr: *mut T) -> (u32, u32) {
5 let x = ptr as u32;
6 let y = (ptr as u64 >> 32) as u32;
7 (x, y)
8}
9
10pub fn unpack_pointer<T>(x: u32, y: u32) -> *mut T {
11 (((y as u64) << 32) | x as u64) as *mut T

Callers 2

__raygen__renderFunction · 0.85
__raygen__renderFrameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected