fn raw_device_address(&self) -> Result<NonZeroU64, DeviceAddressUsageNotEnabledError> {
        let inner = self.inner();

        if !inner.buffer.usage().device_address {
            return Err(DeviceAddressUsageNotEnabledError);
        }

        let dev = self.device();
        unsafe {
            let info = ash::vk::BufferDeviceAddressInfo {
                buffer: inner.buffer.internal_object(),
                ..Default::default()
            };
            let ptr = dev
                .fns()
                .ext_buffer_device_address
                .get_buffer_device_address_ext(dev.internal_object(), &info);

            if ptr == 0 {
                panic!("got null ptr from a valid GetBufferDeviceAddressEXT call");
            }

            Ok(NonZeroU64::new_unchecked(ptr + inner.offset))
        }
    }
/// Gets the device address for this buffer.
///
/// # Safety
///
/// No lock checking or waiting is performed. This is nevertheless still safe because the
/// returned value isn't directly dereferencable. Unsafe code is required to dereference the
/// value in a shader.
Gets the device address for this buffer.
Gets the device address for this buffer .
fn raw_device_address(&self) -> Result<NonZeroU64, DeviceAddressUsageNotEnabledError> {
        let inner = self.inner();
        if !inner.buffer.usage().device_address {
            return Err(DeviceAddressUsageNotEnabledError);
        }
        let dev = self.device();
        unsafe {
            let info = ash::vk::BufferDeviceAddressInfo {
                buffer: inner.buffer.internal_object(),
                ..Default::default()
            };
            let ptr = dev
                .fns()
                .ext_buffer_device_address
                .get_buffer_device_address_ext(dev.internal_object(), &info);
            if ptr == 0 {
                panic!("got null ptr from a valid GetBufferDeviceAddressEXT call");
            }
            Ok(NonZeroU64::new_unchecked(ptr + inner.offset))
        }
    }
fn raw_device_address ( & self ) -> Result < NonZeroU64 , DeviceAddressUsageNotEnabledError > { let inner = self . inner ( ) ; if ! inner . buffer . usage ( ) . device_address { return Err ( DeviceAddressUsageNotEnabledError ) ; } let dev = self . device ( ) ; unsafe { let info = ash :: vk :: BufferDeviceAddressInfo { buffer : inner . buffer . internal_object ( ) , .. Default :: default ( ) } ; let ptr = dev . fns ( ) . ext_buffer_device_address . get_buffer_device_address_ext ( dev . internal_object ( ) , & info ) ; if ptr == 0 { panic ! ( " " ) ; } Ok ( NonZeroU64 :: new_unchecked ( ptr + inner . offset ) ) } }
Gets the device address for this buffer.
Gets the device address for this buffer .
&self
&self
safety
No lock checking or waiting is performed. This is nevertheless still safe because the
returned value isn't directly dereferencable. Unsafe code is required to dereference the
value in a shader.
No lock checking or waiting is performed . This is nevertheless still safe because the returned value isn ' t directly dereferencable . Unsafe code is required to dereference the value in a shader .