upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/shims/d3d12_com.cpp
diff options
context:
space:
mode:
authoraslan2142 <jan.trencansky@protonmail.com>2026-11-25 22:10:34 +0100
committerGitHub <noreply@github.com>2026-11-25 22:10:34 +0100
commit9cd0c3f42770724548e7812162e12d85aacdf8ce (patch)
treea241599b41a9be8953951d196242e78c5ddedd4c /runtime/shims/d3d12_com.cpp
parent72006d61d5e77175153965923f8eb7ad7d8a315d (diff)
parentef205eec98801521ac19792432f4bc2d0ed26503 (diff)
Merge pull request #1759 from abnalstlll-byte/feat/rt-xdxr-bvh-rehydrate-batched2x
xbox_bvh_builder: implement RehydrateRaytracingAccelerationStructureBatched2X (RT-XDXR-BVH-REHYDRATE-BATCHED2X)
Diffstat (limited to 'runtime/shims/d3d12_com.cpp')
-rw-r--r--runtime/shims/d3d12_com.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/runtime/shims/d3d12_com.cpp b/runtime/shims/d3d12_com.cpp
index 961514bcf..8ede67879 100644
--- a/runtime/shims/d3d12_com.cpp
+++ b/runtime/shims/d3d12_com.cpp
@@ -222,8 +222,11 @@ public:
222 const leonida::CommandList& commands() const { return list_; } 222 const leonida::CommandList& commands() const { return list_; }
223 // The descriptor tables this recording binds (console VAs), for the scan before a submission. 223 // The descriptor tables this recording binds (console VAs), for the scan before a submission.
224 const std::vector<std::pair<std::uint64_t, std::uint32_t>>& tables() const { return tables_; } 224 const std::vector<std::pair<std::uint64_t, std::uint32_t>>& tables() const { return tables_; }
225 // The pipeline states and root signatures the recording names (it holds a reference to each until Reset). 225 // The pipeline states and root signatures the recording names (it holds a reference to each until Reset), and
226 // the objects a shim handed it with hold_until_reset.
226 const std::vector<IUnknown*>& pinned() const { return held_; } 227 const std::vector<IUnknown*>& pinned() const { return held_; }
228 // rt::d3d12::hold_until_reset: an object the recording uses that its caller does not keep (a shim's own scratch).
229 void hold_for_recording(IUnknown* object) { hold(object); }
227 bool needs_all_sampled_views() const { 230 bool needs_all_sampled_views() const {
228 if (directly_indexed_) return true; 231 if (directly_indexed_) return true;
229 for (const auto& command : list_.commands()) { 232 for (const auto& command : list_.commands()) {
@@ -2188,7 +2191,8 @@ public:
2188 2191
2189 // What a held batch (queue_holds.h) keeps alive until it has run: the pipeline states and root signatures its 2192 // What a held batch (queue_holds.h) keeps alive until it has run: the pipeline states and root signatures its
2190 // lists name, which the application may release and Reset away as soon as ExecuteCommandLists returns. Resources 2193 // lists name, which the application may release and Reset away as soon as ExecuteCommandLists returns. Resources
2191 // are not held (a D3D12 application keeps them until the fence it signals; the docs, section 4.4, list this). 2194 // are not held (a D3D12 application keeps them until the fence it signals; the docs, section 4.4, list this),
2195 // except a shim's own the recording uses (hold_until_reset), which are pinned with them.
2192 static std::shared_ptr<void> pin_lists(const std::vector<const GraphicsCommandList*>& lists) { 2196 static std::shared_ptr<void> pin_lists(const std::vector<const GraphicsCommandList*>& lists) {
2193 auto objects = std::shared_ptr<std::vector<IUnknown*>>(new std::vector<IUnknown*>, [](auto* held) { 2197 auto objects = std::shared_ptr<std::vector<IUnknown*>>(new std::vector<IUnknown*>, [](auto* held) {
2194 for (IUnknown* object : *held) object->Release(); 2198 for (IUnknown* object : *held) object->Release();
@@ -2817,6 +2821,13 @@ bool front_back_stencil_ref(ID3D12GraphicsCommandList8* list, UINT& front, UINT&
2817 return true; 2821 return true;
2818} 2822}
2819 2823
2824bool hold_until_reset(ID3D12GraphicsCommandList* list, IUnknown* object) {
2825 GraphicsCommandList* l = GraphicsCommandList::from(list);
2826 if (!l || !object) return false;
2827 l->hold_for_recording(object);
2828 return true;
2829}
2830
2820bool recorded_commands(ID3D12GraphicsCommandList* list, std::vector<leonida::Command>& commands) { 2831bool recorded_commands(ID3D12GraphicsCommandList* list, std::vector<leonida::Command>& commands) {
2821 const GraphicsCommandList* l = GraphicsCommandList::from(list); 2832 const GraphicsCommandList* l = GraphicsCommandList::from(list);
2822 if (!l) return false; 2833 if (!l) return false;