Skip to main content

Crate ironaccelerator_dx12

Crate ironaccelerator_dx12 

Source
Expand description

§ironaccelerator-dx12

Direct3D 12 backend. Covers the one GPU API on Windows that no other IronAccelerator backend reaches: NVIDIA, AMD, Intel, and Qualcomm parts all expose D3D12 on Windows whether or not a Vulkan ICD is installed, and on Arm-based Windows devices it is frequently the only path.

Scope is the driver line, as everywhere else in this workspace: enumerate adapters, probe feature support, report capability bits, allocate buffers, submit work, and synchronise. compute::Context covers the submission side — a COMPUTE queue, allocator, command list, and fence, plus buffers in the three standard heaps and dispatch of a compute pipeline.

It does not compile shaders. Bring DXIL, the same way the CUDA backend takes PTX:

dxc -T cs_6_0 -E main kernel.hlsl -Fo kernel.dxil

Note that dxc only signs its output when dxil.dll sits beside it, and D3D12 rejects unsigned DXIL. The Windows SDK ships that pair; the Vulkan SDK’s dxc does not.

d3d12.dll and dxgi.dll are resolved with libloading, never linked, so the crate builds on any target that has dynamic loading — Windows, Linux, macOS. Where the libraries are absent, which is every non-Windows host and Windows installs predating D3D12, Backend::is_available reports false and enumeration returns empty. wasm32 is the exception: it has no dynamic loader, so this crate does not build there. Only ironaccelerator-core and ironaccelerator-webgpu target WASM.

Re-exports§

pub use backend::Dx12Backend;
pub use backend::DX12_BACKEND;
pub use compute::BoundPipeline;
pub use compute::Buffer;
pub use compute::CommandQueue;
pub use compute::Context;
pub use compute::PipelineState;
pub use compute::RootSignature;
pub use drv::Device;
pub use drv::EnumeratedAdapter;

Modules§

backend
Direct3D 12 Backend impl. One descriptor per hardware adapter that creates a device at feature level 11_0 or better.
compute
D3D12 compute submission: buffers, a command queue/allocator/list, fence sync, and dispatch of a DXIL compute shader.
drv
Minimal Direct3D 12 driver access: DXGI adapter enumeration plus the D3D12 feature-support probes needed to fill in capability bits.

Functions§

register
Register the D3D12 backend into the given registry. Idempotent.