device
| Type | Class |
| Namespace | conjure::rhi |
| Include File Path | engine/include/conjure/rhi/device.h |
| Source File Path | engine/src/rhi/device.cpp |
| API ↗ | Devices and swapchains, Shaders |
Syntax
Constructors
| Access | Signature | Description |
|---|---|---|
| public | explicit device(
create_tag); |
Important
Copy constructor and assignment has been deleted.
Destructors
| Access | Signature | Description |
|---|---|---|
| public | ~device(); |
Variables
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| private | mImpl | std::unique_ptr<impl> | {} |
Functions
Public
capabilities
capabilities[[nodiscard]] const device_capabilities &capabilities() const noexcept;Adapter name, limits and queue availability of the created device.
create
create[[nodiscard]] static core::result<std::unique_ptr<device>> create(
const device_desc &desc);Creates the NVRHI device for the requested backend. Fails with core::error_code::UNSUPPORTED when the backend is not compiled in, rhi_error::INVALID_DESC when the description is inconsistent (backend out of range, GPU validation without the debug layer, nullMsaaSampleCounts failing is_valid_msaa_sample_counts, a null device with nullMaxTextureDimension2d 0), and rhi_error::DEVICE_CREATION_FAILED when the API refuses (its message is quoted).
desc
desc[[nodiscard]] const device_desc &desc() const noexcept;The description the device was created from.
inject_null_fault
inject_null_faultvoid inject_null_fault(
null_fault fault,
u32 matchingCallsToSkip = 0);Arms one failure on the null backend (null_fault): the first matchingCallsToSkip calls that match it succeed, the next one reports it and disarms. Arming replaces any failure still armed; NONE disarms without a failure. No effect on D3D12 and Vulkan.
is_lost
is_lost[[nodiscard]] bool is_lost() const noexcept;True once the API reported device removal or NVRHI raised a Fatal message. Every later present fails with rhi_error::DEVICE_LOST; the owner must recreate everything.
native_device
native_device[[nodiscard]] nvrhi::IDevice *native_device() const noexcept;Non-owning NVRHI device for in-engine modules. Never exposed to game code.
null_stats
null_stats[[nodiscard]] std::optional<null_device_stats> null_stats() const;Snapshot of what the null backend recorded; nullopt on D3D12 and Vulkan.
reset_null_stats
reset_null_statsvoid reset_null_stats();Resets the null backend's counters; no effect on other backends.
run_garbage_collection
run_garbage_collectionvoid run_garbage_collection();Releases the resources of command lists that finished executing. Call once per frame.