diff options
| author | Mumogg <104529023+Mumogg@users.noreply.github.com> | 2026-11-23 15:20:43 -0600 |
|---|---|---|
| committer | Mumogg <104529023+Mumogg@users.noreply.github.com> | 2026-11-23 15:20:43 -0600 |
| commit | 237f9e0ba83c8b8e740dd7bcc0e10d311fddb897 (patch) | |
| tree | 4890c217a2c816e61874897ebe6e37eea254f86a /runtime/shims/d3d12_com.cpp | |
| parent | e64653e58599b0372a3e3e4d8909bd652eb704e8 (diff) | |
local: diagnostics (draw/present/clear/rect state), rect experiments
Diffstat (limited to 'runtime/shims/d3d12_com.cpp')
| -rw-r--r-- | runtime/shims/d3d12_com.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/runtime/shims/d3d12_com.cpp b/runtime/shims/d3d12_com.cpp index e1408d281..ca28ac6da 100644 --- a/runtime/shims/d3d12_com.cpp +++ b/runtime/shims/d3d12_com.cpp | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | #include <cstdlib> | ||
| 1 | #include "d3d12_com.h" | 2 | #include "d3d12_com.h" |
| 2 | 3 | ||
| 3 | #include "d3d12_stubs.h" // generated | 4 | #include "d3d12_stubs.h" // generated |
| @@ -698,6 +699,17 @@ public: | |||
| 698 | d3d12_trace::record("ID3D12GraphicsCommandList::ClearRenderTargetView"); | 699 | d3d12_trace::record("ID3D12GraphicsCommandList::ClearRenderTargetView"); |
| 699 | if (type_ == D3D12_COMMAND_LIST_TYPE_BUNDLE) return check(false); | 700 | if (type_ == D3D12_COMMAND_LIST_TYPE_BUNDLE) return check(false); |
| 700 | if (!view.ptr || !color) return check(false); | 701 | if (!view.ptr || !color) return check(false); |
| 702 | // LOCAL DIAGNOSTIC: LEONIDA_DEBUG_CLEAR=1 clears to magenta; the first clears are logged. | ||
| 703 | static const bool magenta = [] { const char* v = std::getenv("LEONIDA_DEBUG_CLEAR"); return v && *v == '1'; }(); | ||
| 704 | const auto* target = reinterpret_cast<const leonida::TargetView*>(view.ptr); | ||
| 705 | static std::atomic<int> shown{0}; | ||
| 706 | if (shown.fetch_add(1, std::memory_order_relaxed) < 6) | ||
| 707 | std::fprintf(stderr, "[rt] localdbg: clear resource=0x%llx colour=%g %g %g %g rects=%u\n", | ||
| 708 | static_cast<unsigned long long>(target->resource), color[0], color[1], color[2], color[3], count); | ||
| 709 | if (magenta) { | ||
| 710 | check(list_.clear_render_target(*target, {1.0f, 0.0f, 1.0f, 1.0f}, to_rects(count, rects))); | ||
| 711 | return; | ||
| 712 | } | ||
| 701 | check(list_.clear_render_target(*reinterpret_cast<const leonida::TargetView*>(view.ptr), | 713 | check(list_.clear_render_target(*reinterpret_cast<const leonida::TargetView*>(view.ptr), |
| 702 | {color[0], color[1], color[2], color[3]}, to_rects(count, rects))); | 714 | {color[0], color[1], color[2], color[3]}, to_rects(count, rects))); |
| 703 | } | 715 | } |