D3D12: implement backend#1410
Conversation
|
Impressive work, but this is too big to review/merge (as you expected though ;) I'll keep the PR open though for other people to reference, and maybe also as reference for a time when an official D3D12 backend might be implemented. PS: when I got some more time I'll try to play around with the PR a bit. E.g. when the performance is comparable to the D3D11 backend, that might be a good reason to start thinking about replacing the D3D11 backend with D3D12 - mainly because D3D12 has a more modern shader compiler infrastructure... |
|
PS: the failing CI is about missing switch-prongs for a switch on the backend enum in some of the language samples... nothing critical. |
|
Yup, all understood and that makes sense. Essentially...use it as you see fit (or not!). |
|
I added my stress test to a new branch, which might be useful if/when you come to experiment. https://github.com/oviano/sokol/tree/d3d12-backend-with-stress-test |
The Zig binding generator cannot handle uint64_t* pointer types. Changed to void* with internal cast, matching other pointer fields.
Hello @floooh
Long-time sokol user here. Thanks for the great library!
I know you've mentioned D3D12 is better suited for sokol_gfx2. That said, I had a need for it and have a complete implementation that passes all samples. Offering it in case it's useful, with no expectation to merge.
Even if it's not right for mainline, others may find it helpful?
Summary
Design
The implementation follows D3D12 best practices rather than being a thin wrapper over D3D11 patterns:
Written in C99-compatible style consistent with the other backends.
Implementation size: ~4,600 lines (compared to D3D11's ~2,300 lines). The larger size reflects D3D12's explicit resource management model.
Changes
Testing
Note
The language binding examples (sokol-odin, sokol-rust, etc.) will need their switch/match statements updated to handle the new
D3D12backend case.Related PRs
floooh/sokol-samples#188
floooh/sokol-tools#206