upleb.uk

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

summaryrefslogtreecommitdiff
path: root/runtime/src
diff options
context:
space:
mode:
authorEmirhan Karaca <emirhan.karaca@std.yildiz.edu.tr>2026-11-22 13:06:54 +0300
committerEmirhan Karaca <emirhan.karaca@std.yildiz.edu.tr>2026-11-22 13:06:54 +0300
commit2fdfd8c4336b0d85e01c74b91c406233e64021c8 (patch)
tree35a5745d3373837dd1c6748bf00e9f1e10a97284 /runtime/src
parentc0ac5fd6518b3ba9fa66765b8b07099990dadd74 (diff)
Runtime: suspend conditional rendering across all ResolveQueryData runs (D3D-148)
Diffstat (limited to 'runtime/src')
-rw-r--r--runtime/src/vulkan_replay.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/runtime/src/vulkan_replay.h b/runtime/src/vulkan_replay.h
index 6df4beba5..ab8005714 100644
--- a/runtime/src/vulkan_replay.h
+++ b/runtime/src/vulkan_replay.h
@@ -1714,8 +1714,8 @@ ReplayResult prepare(const CommandList& list, Resolve&& resolve, const ReplayFun
1714 !vk.prepare_predicate(p.binding.buffer, p.binding.buffer_offset + predication->offset, p.predicate)) 1714 !vk.prepare_predicate(p.binding.buffer, p.binding.buffer_offset + predication->offset, p.predicate))
1715 return ReplayResult::unsupported; 1715 return ReplayResult::unsupported;
1716 } else if (const QueryRange range = query_range(command); range.count) { 1716 } else if (const QueryRange range = query_range(command); range.count) {
1717 // BeginQuery, EndQuery and ResolveQueryData are not among D3D12's predicated calls, and Vulkan's 1717 // BeginQuery, EndQuery and ResolveQueryData are not among D3D12's predicated calls, so a predicate does
1718 // conditional rendering leaves query commands and transfers alone, so a predicate changes nothing here. 1718 // not suppress them (emit_query suspends conditional rendering around ResolveQueryData).
1719 if (!queries) return ReplayResult::unsupported; 1719 if (!queries) return ReplayResult::unsupported;
1720 QueryPool* heap = vk.query_pool(range.heap); 1720 QueryPool* heap = vk.query_pool(range.heap);
1721 if (!heap) return ReplayResult::unresolved_resource; 1721 if (!heap) return ReplayResult::unresolved_resource;
@@ -1908,16 +1908,16 @@ inline void emit_query(const PreparedList& list, const detail::PreparedQuery& qu
1908 const bool binary = resolve.type == d3d12_query::binary_occlusion; 1908 const bool binary = resolve.type == d3d12_query::binary_occlusion;
1909 const auto size = query_result_size(resolve.type); 1909 const auto size = query_result_size(resolve.type);
1910 const auto dst = list.commands[query.command].binding.buffer; 1910 const auto dst = list.commands[query.command].binding.buffer;
1911 bool suspended = false; 1911 // ResolveQueryData is unconditional in D3D12. Suspend conditional rendering for the whole resolve rather
1912 // than only before helper dispatches: on Intel's Windows Vulkan driver, vkCmdFillBuffer (used for un-ended
1913 // queries) is suppressed inside an active conditional rendering scope after PredicateReducer::capture's
1914 // compute dispatch (D3D-148).
1915 const bool suspend = predicate.buffer && !query.resolves.empty();
1916 if (suspend) vk.end_conditional_rendering(cb);
1912 for (const auto& run : query.resolves) { 1917 for (const auto& run : query.resolves) {
1913 if (!run.pool) { 1918 if (!run.pool) {
1914 vk.fill_buffer(cb, dst, run.offset, VkDeviceSize(run.count) * size, 0); 1919 vk.fill_buffer(cb, dst, run.offset, VkDeviceSize(run.count) * size, 0);
1915 } else if (run.sum || binary) { 1920 } else if (run.sum || binary) {
1916 // ResolveQueryData is unconditional even when the helper uses a dispatch.
1917 if (predicate.buffer && !suspended) {
1918 vk.end_conditional_rendering(cb);
1919 suspended = true;
1920 }
1921 const auto& resolve_occlusion = run.sum ? vk.sum_occlusion : vk.resolve_binary_occlusion; 1921 const auto& resolve_occlusion = run.sum ? vk.sum_occlusion : vk.resolve_binary_occlusion;
1922 resolve_occlusion(cb, run.pool, run.first, run.count, dst, run.offset); 1922 resolve_occlusion(cb, run.pool, run.first, run.count, dst, run.offset);
1923 } else { 1923 } else {
@@ -1925,7 +1925,7 @@ inline void emit_query(const PreparedList& list, const detail::PreparedQuery& qu
1925 VK_QUERY_RESULT_64_BIT | VK_QUERY_RESULT_WAIT_BIT); 1925 VK_QUERY_RESULT_64_BIT | VK_QUERY_RESULT_WAIT_BIT);
1926 } 1926 }
1927 } 1927 }
1928 if (suspended) vk.begin_conditional_rendering(cb, &predicate); 1928 if (suspend) vk.begin_conditional_rendering(cb, &predicate);
1929 } 1929 }
1930} 1930}
1931 1931