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:
authorpmilewsskiedu-gif <pmilewsskiedu-gif@users.noreply.github.com>2026-11-22 18:05:46 -0500
committerpmilewsskiedu-gif <pmilewsskiedu-gif@users.noreply.github.com>2026-11-22 18:05:46 -0500
commit40cf85c2e3963ccece8578577ebabf899456f1cb (patch)
tree3322b270a76d78d246c8473fbe01aafcb4b9a6db /runtime/shims/d3d12_com.cpp
parent820c1b62211c1cb360551b389a6884456857309d (diff)
d3d12: retain invalid upload self-copy Close rejection
Diffstat (limited to 'runtime/shims/d3d12_com.cpp')
-rw-r--r--runtime/shims/d3d12_com.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/runtime/shims/d3d12_com.cpp b/runtime/shims/d3d12_com.cpp
index d9b1a009c..e50dfdda5 100644
--- a/runtime/shims/d3d12_com.cpp
+++ b/runtime/shims/d3d12_com.cpp
@@ -505,6 +505,14 @@ public:
505 void STDMETHODCALLTYPE CopyResource(ID3D12Resource* dst, ID3D12Resource* src) override { 505 void STDMETHODCALLTYPE CopyResource(ID3D12Resource* dst, ID3D12Resource* src) override {
506 d3d12_trace::record("ID3D12GraphicsCommandList::CopyResource"); 506 d3d12_trace::record("ID3D12GraphicsCommandList::CopyResource");
507 if (type_ == D3D12_COMMAND_LIST_TYPE_BUNDLE) return check(false); 507 if (type_ == D3D12_COMMAND_LIST_TYPE_BUNDLE) return check(false);
508 if (dst && dst == src) {
509 // A self-copy on a DEFAULT heap is a no-op, but an UPLOAD/READBACK resource still cannot
510 // be both source and destination: native D3D12 rejects it at Close. Check this before
511 // the no-op is omitted from the recorded command list.
512 D3D12_HEAP_PROPERTIES properties{};
513 if (FAILED(dst->GetHeapProperties(&properties, nullptr)) ||
514 properties.Type != D3D12_HEAP_TYPE_DEFAULT) return check(false);
515 }
508 check(list_.copy_resource({resource_id(dst), resource_id(src)})); 516 check(list_.copy_resource({resource_id(dst), resource_id(src)}));
509 } 517 }
510 518