diff options
| author | PyZik <98541963+PyZikYG@users.noreply.github.com> | 2026-11-25 00:17:38 +0500 |
|---|---|---|
| committer | PyZik <98541963+PyZikYG@users.noreply.github.com> | 2026-11-25 00:17:38 +0500 |
| commit | a8ed98c231c79bade00ddd7ccb44186d9f0a0df0 (patch) | |
| tree | aa6c1db31602b24be856684b5c988b7088c4dfa5 /runtime/shims/d3d12_com.cpp | |
| parent | 6293c1c4f88c7ea2088ec595fea51362f1759996 (diff) | |
d3d12: report copy queue timestamp support from Vulkan queue capabilities
Diffstat (limited to 'runtime/shims/d3d12_com.cpp')
| -rw-r--r-- | runtime/shims/d3d12_com.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/runtime/shims/d3d12_com.cpp b/runtime/shims/d3d12_com.cpp index 4f4904e96..8be31b940 100644 --- a/runtime/shims/d3d12_com.cpp +++ b/runtime/shims/d3d12_com.cpp | |||
| @@ -1658,7 +1658,7 @@ public: | |||
| 1658 | for (const auto& command : list.commands().commands()) { | 1658 | for (const auto& command : list.commands().commands()) { |
| 1659 | const auto range = leonida::query_range(command); | 1659 | const auto range = leonida::query_range(command); |
| 1660 | if (range.count && range.type == leonida::d3d12_query::timestamp && | 1660 | if (range.count && range.type == leonida::d3d12_query::timestamp && |
| 1661 | context_.query_heap_type(range.heap) == other) | 1661 | (!timestamp_family_supported() || context_.query_heap_type(range.heap) == other)) |
| 1662 | return false; | 1662 | return false; |
| 1663 | } | 1663 | } |
| 1664 | return true; | 1664 | return true; |
| @@ -1717,16 +1717,20 @@ public: | |||
| 1717 | } | 1717 | } |
| 1718 | 1718 | ||
| 1719 | // Ticks per second of the timestamps EndQuery writes: one tick is timestampPeriod nanoseconds. Every D3D12 | 1719 | // Ticks per second of the timestamps EndQuery writes: one tick is timestampPeriod nanoseconds. Every D3D12 |
| 1720 | // queue of the device shares one VkQueue, so they share one frequency. E_FAIL when that queue has no | 1720 | // device has one timestamp period, but individual queue families may not write timestamps. |
| 1721 | // timestamps (timestampValidBits 0), as D3D12 reports for a queue that does not support them. | ||
| 1722 | HRESULT STDMETHODCALLTYPE GetTimestampFrequency(UINT64* frequency) override { | 1721 | HRESULT STDMETHODCALLTYPE GetTimestampFrequency(UINT64* frequency) override { |
| 1723 | if (!frequency) return E_INVALIDARG; | 1722 | if (!frequency) return E_INVALIDARG; |
| 1724 | const double period = context_.timestamp_period(); | 1723 | const double period = context_.timestamp_period(); |
| 1725 | if (!(period > 0)) return E_FAIL; | 1724 | if (!(period > 0) || !timestamp_family_supported()) return E_FAIL; |
| 1726 | *frequency = static_cast<UINT64>(1e9 / period + 0.5); | 1725 | *frequency = static_cast<UINT64>(1e9 / period + 0.5); |
| 1727 | return S_OK; | 1726 | return S_OK; |
| 1728 | } | 1727 | } |
| 1729 | 1728 | ||
| 1729 | bool timestamp_family_supported() const { | ||
| 1730 | // The low-level queue factory also accepts caller-owned queues without a QueueClock. | ||
| 1731 | return !clock_.get_device_proc || clock_.timestamp_valid_bits != 0; | ||
| 1732 | } | ||
| 1733 | |||
| 1730 | // Queue labels, in order with the submissions around them. | 1734 | // Queue labels, in order with the submissions around them. |
| 1731 | void STDMETHODCALLTYPE SetMarker(UINT metadata, const void* data, UINT size) override { | 1735 | void STDMETHODCALLTYPE SetMarker(UINT metadata, const void* data, UINT size) override { |
| 1732 | d3d12_trace::record("ID3D12CommandQueue::SetMarker"); | 1736 | d3d12_trace::record("ID3D12CommandQueue::SetMarker"); |