Commit Graph

5744 Commits

Author SHA1 Message Date
Ryx
147f9300cf Runtime: presenter survives failed submits and recreations, and counts only shown frames (review)
From VictorJulianiR's review of the presenter, with Vonsek's measurements:
- A failed blit submission left the frame's fence reset with nothing to signal it, so the next present waited
  forever (Vonsek: the retry reached vkWaitForFences with UINT64_MAX). An empty batch now takes the acquire
  semaphore and signals the fence, and the swapchain is recreated next time to give back the image that was
  never presented. If that batch fails too, or a fence wait or reset fails, the presenter stops (ok() is
  false). A back buffer the device does not know is refused before an image is acquired for it.
- A swapchain recreation published the new swapchain before its per-image semaphores existed, so a failed
  semaphore left a presenter that could submit with a null one. The images and semaphores are now built in
  local storage and published only when all exist; on a failure the partial objects are released and the next
  present tries again.
- An out-of-date present was counted as presented (Vonsek: 69 VK_SUCCESS and one VK_ERROR_OUT_OF_DATE_KHR
  reached 70). presented() now counts VK_SUCCESS and VK_SUBOPTIMAL_KHR only; the caller still gets VK_SUCCESS.

d3d12_present_test gives the device and presenter their functions through a driver double that forwards to the
real driver. It counts real out-of-date presents (the frame counts allow for them) and live binary semaphores.
It reports one present as out of date and one as suboptimal, fails the second semaphore of a recreation, and
fails one blit submission. Against the old presenter the test fails at the frame count after the resize, where
this RTX 5060 Ti reported a real out-of-date present.

Docs: the presenter is named as leonida::VulkanPresenter, made by rt::d3d12::create_window_presenter, and the
test is described as 60 frames then 10 after a resize (AlxcBTW).
2026-11-22 04:55:03 +01:00
Ryx
e876fc830e Runtime: present D3D12 back buffers to a window on Vulkan (milestone M0)
- vulkan_present.h: VulkanPresenter blits a back buffer (an ordinary texture
  in D3D12's PRESENT state, layout tracked like any other) to an acquired
  swapchain image and presents it on the same VkQueue, after the
  application's work. Two frames in flight, a present semaphore per image,
  FIFO for vsync else MAILBOX/IMMEDIATE, swapchain recreated on resize or
  out-of-date/suboptimal, minimised windows skip presents.
- rt::d3d12::create_window_presenter / WindowPresenter: Win32 surface for a
  Vulkan device created with presentation; holds the device. This is the back
  end a DXGI shim or PresentX would call; the game's own front end is still
  open (docs question 6), so neither is invented here.
- Standalone device enables VK_KHR_surface/win32_surface and VK_KHR_swapchain
  when present; the test helper can too.

Test: d3d12_present_test opens a window and presents 60 frames through the
Xbox-ABI proxy (reset, PRESENT->RENDER_TARGET, clear, ->PRESENT, execute,
present, fence), resizes the window (swapchain recreated, scaled blit),
switches to unsynchronised presents, and reads the screen with GDI:
51,153,229 for a 51,153,230 clear. Clean under the Khronos validation layer,
as are the other GPU tests; 6/6 ctest.
2026-11-22 04:54:51 +01:00
9bc8e17919 Honor the default format of GFX10 typed buffer loads 2026-11-21 20:51:44 -07:00
9d74f443a4 ASSET-56: decode RSC8 (v8001) AWC 0x5c facial/lip-sync resources
Add stdlib-only decoder tools/rsc8_audio.py, 15 synthetic unit tests in tests/test_rsc8_audio.py, and full-corpus layout/count documentation in docs/rsc8_audio.md (641,428/641,428 valid across 4 archives, 0 outside ADAT, 0 embedded audio containers).
2026-11-22 00:51:12 -03:00
4c0faa7693 Merge pull request #739 from Ayinaki
# Conflicts:
#	docs/d3d12_vulkan.md
#	runtime/shims/d3d12_vulkan_device.cpp
2026-11-21 22:49:20 -05:00
749c1ae46c Merge pull request #745 from Ayinaki
# Conflicts:
#	runtime/shims/d3d12_vulkan_device.cpp
2026-11-21 22:48:53 -05:00
55d02a5861 Merge origin/main into d24-on-d32
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 04:48:46 +01:00
024cfee64d Merge pull request #845 from Dea7hsmiles 2026-11-21 22:48:38 -05:00
b7e871994c Merge pull request #839 from Luiz Neves 2026-11-21 22:48:37 -05:00
5fd1feca84 Merge pull request #834 from Vonsek 2026-11-21 22:48:36 -05:00
567c29da86 Merge pull request #829 from Vonsek 2026-11-21 22:48:35 -05:00
9c12c5bd6f Merge pull request #814 from Luiz Neves
# Conflicts:
#	docs/design.md
2026-11-21 22:48:35 -05:00
38baf0cdf7 Merge pull request #810 from Luiz Neves
# Conflicts:
#	docs/design.md
2026-11-21 22:48:33 -05:00
cc905491ab Merge pull request #806 from fearkov 2026-11-21 22:48:32 -05:00
5dd199fead Merge pull request #796 from Luiz Neves 2026-11-21 22:48:31 -05:00
3a18782f2f Merge pull request #792 from Luiz Neves 2026-11-21 22:48:31 -05:00
5a3367dc44 Merge pull request #784 from SirAmong 2026-11-21 22:48:31 -05:00
cd07c6902e Merge pull request #706 from cemalyakla
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-21 22:48:30 -05:00
2867a3b545 Merge pull request #253 from AlxcBTW 2026-11-21 22:48:27 -05:00
ccf8bdb50f docs: day-one item 2 reads only plain RPF9 tables
docs/design.md still told contributors to find the RPF9 table-of-contents key and decryption, which contradicts the ground rule that nothing here decrypts or works around package protection. Read only tables already plain on disk, record the five opaque ones, and keep the stop condition explicit.
2026-11-21 19:46:46 -08:00
ddc5677de6 Docs: reconcile feature queries after the FORMAT_INFO merge 2026-11-22 03:46:43 +00:00
0db0d72dc7 Merge origin/main into d24-on-d32; follow main's depth-plane T# rule (D3D-75)
Main's depth-plane SRV T# code follows the texture's backing format (X24_8_32_FLOAT
where D24 is stored as D32), so the override from f9addf5 is dropped and the
D24 comparison test expects the backing format's code. The family refusal and
bind_image are main's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 04:45:53 +01:00
8c36677b41 chore: merge upstream query and descriptor updates 2026-11-22 04:45:39 +01:00
dd301d3649 docs/design.md: contract row for this PR's ops (AGENTS.md; asked in #634) 2026-11-22 00:44:02 -03:00
aae7b077a8 docs/design.md: contract row for this PR's ops (AGENTS.md; asked in #634) 2026-11-22 00:43:59 -03:00
4a8d4103bf docs/design.md: contract row for this PR's ops (AGENTS.md; asked in #634) 2026-11-22 00:43:57 -03:00
5b06b7d3fb docs/design.md: contract row for this PR's ops (AGENTS.md; asked in #634) 2026-11-22 00:43:54 -03:00
3c6d117a57 docs: permlane bullet follows the fuzzer's docstring since #750 (follow-up to #645)
kapitche's review of #784: the fuzzer's docstring no longer calls the FI=0
inactive-source case unmeasured (#750 says it was measured on RDNA2 and
RDNA3.5 and that the translator models it only with #580). The tag stays
because of #580, so the bullet now says that instead.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-21 22:43:32 -05:00
bf902d2522 docs/design.md: contract rows for ops merged without one
AGENTS.md asks for a contract row for every new translator rule; these went
in without one (follow-up to PROC-20 / #666, asked for in #634): s_cmov_b32 /
s_cmovk_i32 / s_pack_*, the 64-bit scalar data ops (s_brev_b64, s_bfe_*64,
s_bitset*_b64, s_flbit_i32_*64), v_mul_hi_*24 / v_lshrrev_b64 / v_ashrrev_i64
/ v_qsad_pk_u16_u8 / v_mqsad_pk_u16_u8, and the constant/ordered VOPC
compares, v_cvt_off_f32_i4 and v_pipeflush. Each row gives the rule, its
source, the semantic tests and the GPU runs reviewers reported on the PRs.
2026-11-22 00:43:09 -03:00
1552ae7278 Merge remote-tracking branch 'origin/main' into bpw32-main
# Conflicts:
#	docs/design.md
#	runtime/test/shaders/check.py
#	scripts/run_gpu_tests.py
2026-11-22 04:42:52 +01:00
238c41671b Docs: a row for d16 and f16 format narrowing 2026-11-21 23:42:19 -04:00
783a491deb Answer wave ops and lane counts in D3D12_OPTIONS1
The query fell through to E_INVALIDARG. It now reports the Vulkan physical
device's subgroup operations and wave-size range, with TotalLaneCount held to
one full wave because Vulkan has no device-wide lane count.
2026-11-22 03:39:25 +00:00
ab1ff9f9c5 Support R10G10B10_XR_BIAS_A2_UNORM textures
Map XR_BIAS to the bit-compatible A2B10G10R10 UNORM Vulkan format, report only the 2D and cast-within-bit-layout support the layer provides, and refuse the mip, MSAA and 3D cases the PC runtime refuses. Test creation, allocation, footprints and the resource-method variants.
2026-11-22 03:39:24 +00:00
fac8b022d5 fix: preserve NEVER comparison samplers in set 0
The hardware depth function is zero for both a regular sampler and a NEVER comparison. Give layer-created NEVER comparisons a separate descriptor key so Vulkan binds a comparison-enabled sampler.
2026-11-22 04:39:05 +01:00
f29d827aee Merge pull request #830 from whattheflop 2026-11-21 22:37:51 -05:00
d381c1aeb7 Merge pull request #823 from JavierBlanco23 2026-11-21 22:37:50 -05:00
2474686591 Merge pull request #815 from Felix Croasdale 2026-11-21 22:37:48 -05:00
7b8da60192 Merge pull request #809 from nicolas 2026-11-21 22:37:47 -05:00
283a48eb0b Merge pull request #807 from eIBart0 2026-11-21 22:37:46 -05:00
bb2ca83ecf Merge pull request #791 from fearkov 2026-11-21 22:37:43 -05:00
918ef697a4 Merge pull request #788 from ismailchaka1 2026-11-21 22:37:43 -05:00
f4efdabf26 Merge pull request #719 from eIBart0 2026-11-21 22:37:40 -05:00
0b79afb666 Merge pull request #706 from cemalyakla
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-21 22:37:40 -05:00
afda786c2c Merge pull request #674 from VictorJulianiR
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-21 22:37:39 -05:00
52a357c604 Merge pull request #341 from AlxcBTW 2026-11-21 22:37:36 -05:00
4f26a04b71 Docs: measure vertex stream strides on 0x4042 pages (ASSET-57) 2026-11-22 13:36:23 +10:00
4428d939a6 fix(runtime): apply minimum LOD to sampled 2D views
The T# records an absolute mip clamp, but sampled views ignored it. Preserve the exposed mip range while applying the encoded clamp and use the descriptor fallback when a logical device cannot represent it.
2026-11-22 04:35:39 +01:00
3d21628d28 Convert every exposed integer RTV format in ClearRenderTargetView
R8G8, R16G16, R16G16B16A16, R32G32 (UINT/SINT), R32G32B32A32_SINT and R10G10B10A2_UINT fell into the float path and stored raw float bits. Clamp/truncate numerically like WARP; A2B10G10R10 alpha clamps to 3. Tests cover 19 formats on CPU and 15 against WARP.
2026-11-22 04:32:02 +01:00
7079108182 Runtime: query heaps on Vulkan (D3D-15)
CreateQueryHeap makes one VkQueryPool per heap: occlusion (OCCLUSION and
BINARY_OCCLUSION queries), timestamp and copy-queue timestamp, and pipeline
statistics (all eleven Vulkan counters, whose order is the field order of
D3D12_QUERY_DATA_PIPELINE_STATISTICS). Other heap types are logged and
refused with E_NOTIMPL.

BeginQuery, EndQuery and ResolveQueryData are recorded in the command-list
IR with D3D12's rules for the calls, and replayed as vkCmdResetQueryPool +
vkCmdBeginQuery/vkCmdEndQuery, vkCmdWriteTimestamp at BOTTOM_OF_PIPE and
vkCmdCopyQueryPoolResults (64-bit, WAIT). Heap types, index ranges and the
destination buffer are checked before anything is written. A query that was
never ended resolves to zeros instead of stalling the GPU on WAIT_BIT.
GetTimestampFrequency is 1e9 / timestampPeriod. The devices enable
occlusionQueryPrecise and pipelineStatisticsQuery where the GPU has them.

Overlapping queries of one kind (valid D3D12, one active query per type in
Vulkan) are refused as unsupported, and binary occlusion is not clamped to
0/1 yet; both are written down in docs/d3d12_vulkan.md section 4.6.

Tested on an RTX 5070 (driver 621.01) under VK_LAYER_KHRONOS_validation.
AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 21:30:47 -06:00
710c5e724b Merge remote-tracking branch 'origin/main' into shader-36-gather-wrap
# Conflicts:
#	scripts/run_gpu_tests.py
#	tests/test_shader_checks.py
2026-11-22 04:27:11 +01:00