pub struct Nrd;Implementations§
Source§impl Nrd
impl Nrd
Sourcepub unsafe fn new(_: &Device, _: u32) -> Result<Self>
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.
Sourcepub unsafe fn from_raw(
_: Instance,
_: PhysicalDevice,
_: Device,
_: u32,
_: u32,
) -> Result<Self>
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.
Sourcepub unsafe fn evaluate(
&mut self,
_: CommandBuffer,
_: &Frame,
_: &Resources,
) -> Result<()>
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§impl Nrd
impl Nrd
Sourcepub fn required_device_extensions(api_version: u32) -> &'static [&'static CStr]
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.