#graphics #gamedev

gfx-backend-dx12

DirectX-12 API backend for gfx-rs

47 releases

0.9.1 Jul 1, 2021
0.8.0 Apr 29, 2021
0.7.0 Jan 30, 2021
0.6.13 Nov 4, 2020
0.1.0 Dec 27, 2018

#173 in Graphics APIs

Download history 5854/week @ 2021-05-29 5812/week @ 2021-06-05 5017/week @ 2021-06-12 6195/week @ 2021-06-19 6587/week @ 2021-06-26 5627/week @ 2021-07-03 6010/week @ 2021-07-10 6265/week @ 2021-07-17 6642/week @ 2021-07-24 6903/week @ 2021-07-31 6639/week @ 2021-08-07 5784/week @ 2021-08-14 7249/week @ 2021-08-21 5006/week @ 2021-08-28 3886/week @ 2021-09-04 5546/week @ 2021-09-11

22,579 downloads per month
Used in 183 crates (9 directly)

MIT/Apache

740KB
14K SLoC

gfx-backend-dx12

DX12 backend for gfx.

Normalized Coordinates

Render Depth Texture
render_coordinates depth_coordinates texture_coordinates

Binding Model

Dimensions of the model:

  1. Space: 0..8
  2. Binding (tight): constant buffers (CBV), shader resources (SRV), unordered access (UAV), samplers

Mirroring

TODO


lib.rs:

D3D12 backend internals.

Resource transitions

Vulkan semantics for resource states doesn't exactly match D3D12.

For regular images, whenever there is a specific layout used, we map it to a corresponding D3D12 resource state.

For the swapchain images, we consider them to be in COMMON state everywhere except for render passes, where it's forcefully transitioned into the render state. When transfers to/from are requested, we transition them into and from the COPY_ states.

For buffers and images in General layout, we the best effort of guessing the single mutable state based on the access flags. We can't reliably handle a case where multiple mutable access flags are used.

Dependencies

~6.5MB
~148K SLoC