8 Commits

Author SHA1 Message Date
23871359ff Merge pull request #1594 from Instru Control 2026-11-22 07:38:26 -05:00
b02e334962 Mark the binary occlusion test output host-readable 2026-11-22 15:59:55 +03:30
170dc22518 Runtime: resolves inside a pipeline-statistics query (D3D-162)
Replay refused binary occlusion resolves, and ordinary resolves that need a sum, while a pipeline-statistics
query was active: their compute helper would count in the application's CSInvocations.

A statistics query that contains a resolve (other than a timestamp copy) is now split. Its counters go to
physical PIPELINE_STATISTICS segments in a pool of the submission's own (flags 0x7ff, as the device creates
the heap). A segment ends before each such resolve and the next begins after it, so no helper dispatch runs
inside the application's query. The query's result is the sum of its segments: a new 11-counter compute shader
(statistics_sum.comp, encoded in statistics_sum_spirv.h like the occlusion helpers) adds them on the
occlusion-resolve scratch buffer. That sum is a helper dispatch too, and is kept out of any statistics query
still running by the same split. Whether a resolve dispatches is only known when the list is planned against
the heaps, so every such resolve splits the query.

The single-list replay() has no segment pool. It keeps refusing a resolve that dispatches inside statistics,
and now allows a binary resolve that only writes zeros. SetPredication and predicated copies are still refused
while statistics are active.

Tests, all with the Khronos validation layer on:
- vk_binary_occlusion: a binary resolve inside one statistics query, then the statistics sum of that query
  inside a second one. Every counter of both is 0. With the split disabled, CSInvocations reads 64.
- vk_overlapping_occlusion: a 261-segment occlusion sum inside a statistics query, with a native draw in each
  segment. The split query, and a second one split around the statistics sum, equal two unsplit queries with the
  same draws on every counter, and CSInvocations is 0.
- replay_query_predication (CPU): the exact begin/end/dispatch order of a split query, and the refusal without a
  segment pool.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 08:51:45 -03:00
2fdfd8c433 Runtime: suspend conditional rendering across all ResolveQueryData runs (D3D-148) 2026-11-22 13:06:54 +03:00
60e4d945ea Test predicated buffer copies with queue kinds and occlusion resolves
Verify compute and transfer readback-stage collection, descriptor cleanup after failed submits and gated/reused batches. Extend binary and overlapping occlusion fixtures with independent destinations to check skipped-copy preservation and copying after predicate reset. Document the command-slot lifetime and queue integration.

Local RX 5700 XT validation: 180 exact WARP comparisons, 64 gated/reused copy submissions, both occlusion controls, 192 predicate captures, replay A-G and 1663 existing WARP readbacks passed. CTest: 59/60 active tests passed; the six stencil CopyResource mismatch reports exactly match the tested #856 baseline. Shader source and embedded SPIR-V match after Vulkan 1.2 validation.
2026-11-22 05:28:28 -04:00
29345889be Runtime: capture full 64-bit predication values on the GPU 2026-11-22 04:34:35 -04:00
21bf8c3d79 Merge binary occlusion and share queue resolve resources 2026-11-22 04:05:44 -03:00
cce77b65ef Normalize binary occlusion results in Vulkan replay 2026-11-22 01:13:30 -03:00