Skip to main content

Nrd

Struct Nrd 

Source
pub struct Nrd;

Implementations§

Source§

impl Nrd

Source

pub unsafe fn new(_: &Device, _: u32) -> Result<Self>

Creates a runtime retaining the graph device until this runtime is dropped.

§Errors

Always returns an error because the native backend is unavailable.

§Safety

The queue family, enabled extensions, and synchronization must satisfy Self::from_raw. Device ownership does not establish these requirements.

Source

pub unsafe fn from_raw( _: Instance, _: PhysicalDevice, _: Device, _: u32, _: u32, ) -> Result<Self>

Creates a runtime borrowing raw Vulkan handles without taking ownership.

§Errors

Always returns an error because the native backend is unavailable.

§Safety

The device must belong to the physical device and instance. All handles must remain valid until Self::shutdown returns. queue_family_index must identify a graphics and compute capable family with queue 0 created on the device; command buffers passed to Self::evaluate must belong to that family. The caller must externally synchronize queue access and NRD work. api_version must be standard Vulkan 1.3 or later, enabled for the instance and supported by the device. Enable the extensions and device features documented in Self::required_device_extensions. Complete all NRD GPU work before resolution changes or shutdown, and call shutdown before destroying the device or instance. Dropping alone leaks the native context.

Source

pub unsafe fn evaluate( &mut self, _: CommandBuffer, _: &Frame, _: &Resources, ) -> Result<()>

Records RELAX SH work into an active command buffer.

Inputs must declare SHADER_READ_ONLY_OPTIMAL, and outputs GENERAL.

§Errors

Always returns an error because the native backend is unavailable; no slot is consumed. With a native backend, pre-FFI errors do not consume slots, but failures after NewFrame can. Errors do not reliably indicate native advancement; follow crate::QUEUED_EVALUATIONS even when calls fail.

§Safety

All images must belong to this instance’s device and remain alive until execution completes. Transition them to their declared layouts and synchronize prior writes for compute shader sampled reads (inputs) or storage reads/writes (outputs) before NRD executes. NRD restores the declared layouts after its dispatches. Before each call, retire all older work according to crate::QUEUED_EVALUATIONS, counting every call including errors, not frame.frame_index. Do not infer native slot indices from this count. The caller must synchronize shutdown and resolution changes with all previously submitted NRD work. The command buffer must be recording on the device and queue family supplied at creation.

Source

pub unsafe fn shutdown(&mut self)

Destroys the native context after all submitted work has completed.

§Safety

The Vulkan device must be idle with respect to every NRD dispatch.

Source§

impl Nrd

Source

pub fn required_device_extensions(api_version: u32) -> &'static [&'static CStr]

Vulkan device extensions that must be enabled before creating the NRD runtime.

NRD requires standard Vulkan 1.3 or later; this list does not imply support for earlier API versions. Enable synchronization2, dynamicRendering, maintenance4, timelineSemaphore, and descriptorBindingPartiallyBound on the logical device. Also enable bufferDeviceAddress when physically supported: NRI infers its use from physical-device support, not the enabled feature chain. For Vulkan 1.4 or later, enable the core pushDescriptor, maintenance5, and maintenance6 features; the push-descriptor extension is no longer needed. Raw handles cannot be used to verify enabled device features.

Auto Trait Implementations§

§

impl Freeze for Nrd

§

impl RefUnwindSafe for Nrd

§

impl Send for Nrd

§

impl Sync for Nrd

§

impl Unpin for Nrd

§

impl UnsafeUnpin for Nrd

§

impl UnwindSafe for Nrd

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.