14 Commits

Author SHA1 Message Date
0bde4c82d7 Runtime: split pipeline statistics around predication and footprint helpers (D3D-162)
Replay refused SetPredication, predicated buffer copies and D24/RGB96 footprint conversions while a
pipeline-statistics query was active (#1624 added the last), because their compute dispatches would count in the
application's CSInvocations. They now get the segment split #1519 gave resolves: the statistics query ends its
current physical segment right before the helper dispatch and begins the next right after it, and its result is
the per-counter sum of the segments. Query resolves and these helpers share one segment numbering. The markers for
non-query commands live on detail::Prepared, and emit() places them around capture_predicate,
emit_predicated_copy and the depth24 conversion parts, outside any rendering scope.

Without a statistics segment pool (the single-list replay(), or a queue without the summation helper), the three
commands are still refused while statistics are active, before any helper scratch is allocated (prepare() takes
statistics_helpers, false by default) and again in QueryReplay::plan.

Tests (Khronos validation on): vk_predicated_copy and depth24_convert run their helpers inside an otherwise empty
statistics query. Their results stay byte-exact and all 11 counters are 0. d3d12_predicated_copy compares with
WARP the same way. replay_query_predication checks the emitted order for a capture, a predicated copy, a footprint
copy and a resolve in one query, and the refusal without a pool. predicated_copy and typeless_rtv check both
preparation modes.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:52:23 -03:00
34a760fc73 fix(vulkan): check vkGetSemaphoreCounterValue VkResult in ScratchBuffers and Depth24Converter collect() 2026-11-22 10:18:43 -03:00
eeb873355e Runtime: match GPU->HOST readback stages to depth24, rgb96 and buffer UAV clears 2026-11-22 15:23:54 +03:00
624f42e23b Runtime: apply backing-buffer end size to rgb96 CopyTexture 2026-11-22 14:30:52 +03:00
ce29a787c2 Merge pull request #1378 from Emirhan Karaca 2026-11-22 06:08:07 -05:00
b8bd9f20a0 Runtime: apply backing-buffer offsets to CopyResource and CopyTexture 2026-11-22 13:44:57 +03:00
e6f8478e9b D3D-62: create the converter on every GPU; merge with the concurrent-queue test
The converter was made only where the GPU lacks D24_UNORM_S8_UINT (1c5463b4). 96-bit textures need it on every
GPU, so it is always created; it costs nothing until a copy uses it (lazy pipeline, lazy tracker lock).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 11:26:48 +01:00
0723014a83 D3D-62: converter split test, COPY queue, footprint refusal, ctest skip
- depth24_convert_test: 96-bit texels split into rows (1 KiB range) and slices (1 MiB range).
- d3d12_rgb96_test: an upload and a readback on a COPY queue; GetCopyableFootprints refuses what creation
  refuses (as WARP); returns 77 without a Vulkan GPU or WARP so ctest skips; large timings behind LEONIDA_RGB96_LARGE.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 11:26:48 +01:00
4f4fc5ecce Merge pull request #1266 from Vonsek 2026-11-22 04:37:57 -05:00
1c5463b430 perf(vulkan): restore parallel prepare() with lazy depth24 lock and native-D24 skip 2026-11-22 06:31:28 -03:00
fd7761947a test(runtime): run depth24 conversion with CTest
The exhaustive compute readback was built on CI but missing from its test list. Preserve device initialization failures and let CTest distinguish an unavailable GPU from a successful comparison.
2026-11-22 10:18:08 +01:00
23962cb6d6 fix(runtime): classify D24 readback depth from its raw bits
Intel UHD 770 reports maximum depth for NaNs in the float comparison path. Check the input encoding before rounding finite values and exercise both signs of every NaN payload on the GPU.
2026-11-22 10:00:25 +01:00
0e63a76da0 D24 conversion: predication, large copies, tests, spec note (review)
- A dispatch honours conditional rendering and the layer's copies do not, so a
  SetPredication that skips copies also skipped the D24 conversion while the
  copy ran. Conditional rendering is ended around the dispatch and begun
  again; a test runs an upload and readback under a skipping predicate and
  compares with the host's unpredicated run (it fails without the fix).
- A copy larger than maxStorageBufferRange (queried; 128 MiB assumed if not)
  is split into dispatches by slices, or by rows of one slice; the descriptors
  bind 256-byte-aligned windows of both buffers. depth24_convert_test splits
  the 4096x4096 copy with a 1 MiB range and a pitched one with a 1 KiB range.
- make_pipeline destroys the layouts it made when a later step fails.
- depth24_convert_test is in the CI tool list; the docs say which GPU each test
  exercises.
- R24G8_TYPELESS with a typed D24 DSV is compared with the host. SRVs of
  R24_UNORM_X8_TYPELESS and X24_TYPELESS_G8_UINT are an empty slot in the
  layer (no format mapping; stencil-plane views refused): reported by the
  test and documented as a known gap.
- depth24.h: the D3D11.3 spec's FLOAT -> UNORM wording (3.2.3.6, 3.2.2) next to
  what WARP and AMD were measured to do; "159" is 5215.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 03:15:13 +01:00
33059d6b63 D24_UNORM_S8_UINT byte-exact on GPUs without D24
The layer stores D24 as D32_SFLOAT_S8_UINT where the GPU has no D24 (the
Radeon 880M, AMD generally). Footprint copies of the depth plane now convert
through a compute pass: an upload turns the 24-bit words into the nearest
floats of d / 16777215, a readback quantises floats back (float multiply by
16777215, round to nearest even, as WARP and AMD's D3D12 driver do) and writes
0 in the unspecified top byte. Clears store the float of the quantised value,
so a texture reads back as D3D's quantisation of the clear value.

- src/depth24.h, vulkan_depth24.h, depth24_convert.comp (+ compiled SPIR-V):
  reference conversion, the converter (pipeline, scratch, descriptors freed
  once the submission completes) and the shader.
- vulkan_replay.h: depth24_as_float binding flag, convert jobs prepared with the
  list and run around the copy, depth clear value.
- depth24_convert_test: all 16777216 words to float and back, 16777216 float
  patterns against the reference, a pitched copy; d3d12_depth24_compare.h:
  5215 clear values (whole-view and rectangle) against the host.
- d3d12_copy_compare.h: the D24 case now compares upload and readback with the
  host instead of only the bit-preserving copies.

Depends on #610.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:53:51 +01:00