Commit Graph

4696 Commits

Author SHA1 Message Date
a3c60bafb8 Merge pull request #2852 from Felix Croasdale 2026-11-22 15:12:36 -05:00
1c96d2785b Merge pull request #2839 from admin 2026-11-22 15:12:29 -05:00
32180661c1 Merge pull request #2823 from jsthope
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-22 15:12:22 -05:00
9a507b063d Merge pull request #2822 from bobcatchris 2026-11-22 15:12:19 -05:00
f5ec088201 Merge pull request #2817 from IAmNotSiob 2026-11-22 15:12:17 -05:00
bf576586b3 d3d12: place 1D and 3D textures like 2D ones
CreatePlacedResource answered E_NOTIMPL for every non-tiled texture that
was not 2D, while the host places 1D and 3D textures. A placed texture
already gets its own image from create_texture, which handles 1D and 3D
for committed textures, so the 2D-only branch goes. The checks before it
(size and room in the heap, an invalid dimension, no output pointer)
stay as they are and now cover 1D and 3D too.

d3d12_placed_dimensions_test compares the answers and GetDesc with the
host (default adapter and WARP) for 1D, 1D arrays, 3D, BC1 3D, UAV and
render-target 1D/3D textures, and round-trips a pattern through every
subresource of a placed 3D texture and a placed 1D array.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 20:12:16 +00:00
0a23659605 Merge pull request #2806 from Alex Arenas 2026-11-22 15:12:11 -05:00
6c3f18cf0e Merge pull request #2794 from Kacper Serewis 2026-11-22 15:12:03 -05:00
64272954c2 Merge pull request #2791 from bobcatchris 2026-11-22 15:12:01 -05:00
94ff85fdf7 Merge pull request #2784 from SuarezPM 2026-11-22 15:11:58 -05:00
e138630254 Merge pull request #2772 from Nicolas Abosch 2026-11-22 15:11:49 -05:00
a92d95386d Merge pull request #2764 from Kacper Serewis
# Conflicts:
#	docs/animation.md
2026-11-22 15:11:44 -05:00
63ab7be421 Runtime: zero-fill default-heap buffers outside the arena (D3D-71)
D3D12 committed resources start zeroed unless the heap has
CREATE_NOT_ZEROED. Arena buffers are zeroed through its mapping, but
device-local buffers outside it were not ("default-heap buffers are not
zero-filled yet"). They are now queued on the context and filled with
vkCmdFillBuffer by the next submission on any queue, ahead of its lists.

That submission publishes the same initialisation semaphore as the
storage-image setup, so a list on another queue that uses the buffer first
waits for the fill. A buffer destroyed before any submission leaves the
queue, and a failed submission puts its fills back.

A queue being destroyed now clears that shared semaphore if it published
it: the queue is idle, so the work is done, and a later submission on
another queue would otherwise wait on a destroyed semaphore. With buffer
fills publishing it often, d3d12_vulkan_device_test hit exactly that
(vkQueueSubmit: invalid pWaitSemaphores, then a crash).

d3d12_vulkan_device_test (a device without the arena) reads a fresh
default buffer back as zeros after dirtying recycled memory, and checks
that a CREATE_NOT_ZEROED buffer written in the same list keeps the copy.
2026-11-22 20:11:43 +00:00
5a7507d508 Merge pull request #2750 from admin 2026-11-22 15:11:36 -05:00
1d2d67dc37 DXGI: keep IDXGIObject private data on the factory, adapter and swapchain
SetPrivateData, SetPrivateDataInterface and GetPrivateData accepted the data and discarded it, so GetPrivateData always returned DXGI_ERROR_NOT_FOUND. They now store a copy of the bytes, hold a reference for an interface until it is replaced or removed, and answer DXGI_ERROR_MORE_DATA for a buffer that is too small. Test: dxgi_swapchain.
2026-11-22 15:11:35 -05:00
18234e1fcc Merge pull request #2728 from Størm 2026-11-22 15:11:31 -05:00
92da70ad6b Merge remote-tracking branch 'origin/main' into bindless-per-queue-retire
# Conflicts:
#	runtime/src/vulkan_backend.h
2026-11-22 21:11:25 +01:00
bf05936467 tests: preserve DrawParameters when enabling Vulkan maintenance8 2026-11-23 06:11:17 +10:00
2257d30b13 Merge pull request #2594 from totonii 2026-11-22 15:11:11 -05:00
cda0da18b8 Merge pull request #2567 from marquezini 2026-11-22 15:11:09 -05:00
2236919f71 Merge pull request #2533 from mrp1no 2026-11-22 15:11:02 -05:00
342d5672cc Churn test on distinct VkQueues, vk_bindless_test in ctest with its flush ticket (review of #2740)
The churn test gives the two D3D12 queues distinct VkQueues where the family has two and runs the async-compute case with and without the old idle wait; with the cross-queue wait removed it fails on the RTX 5070 (reported by duudiis). vk_bindless_test flushes with ticket 1 so release_retired(0) keeps the generation (reported by duudiis and ricarmandoagent), and is registered with ctest as vk_bindless_ps_tex and vk_bindless_ps_imgatomic (it only ran from run_gpu_tests.py and check.py before). Docs: the one-VkQueue caveat is corrected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:10:57 +01:00
f7283f05d0 Merge pull request #2423 from Jolymmiles 2026-11-22 15:10:46 -05:00
d65ef538b5 Merge pull request #2260 from Linnard Alex Brown Jr.
# Conflicts:
#	docs/design.md
2026-11-22 15:10:26 -05:00
5a41704181 Merge pull request #2167 from Alex Arenas 2026-11-22 15:10:18 -05:00
1fde38e317 test(root_signature): extend the oracle to flags, CBV/SAMPLER ranges, root UAVs and the 1.0 root-view form
The oracle serializes synthetic versioned root signatures with Microsoft's
D3D12SerializeVersionedRootSignature and requires rt::rootsig::parse_rts0 to recover
the same model. It covered 27 of 53 features: every fixture used FLAG_NONE, only SRV
and UAV ranges existed, dtype 4 (root UAV) never reached the parser, and 1.0 root
views were only tested as SRV.

That matters because a mis-read flags word silently switches the binding model, and
bindless signatures (NumDescriptors == UINT_MAX, sampler tables) are exactly what a
modern title uses. A first root UAV in a compute signature would have failed to parse
with no test to catch the regression.

Adds 32 assertions across 1.0/1.1/1.2: every root-signature flag, CBV and SAMPLER
ranges including unbounded counts and DESCRIPTORS_VOLATILE, root UAVs, the 1.0 root
view form, static samplers in a second table, and checkerboard parameter orders.

Each case is named, so a failure reads 'flags: allow IA layout survives' rather than
'false'. parse_checked() stops a failed parse from being indexed, which is what
segfaulted the earlier attempt.

Verified on Windows with MSVC 19.44 / SDK 10.0.26100 at /W4: 62 PASS, 0 FAIL.
Mutation-checked: reading flags at +16, dropping dtype 4, and mapping MESH to PIXEL
each fail new cases only, and the untouched suite passes none of them.
2026-11-22 15:10:16 -05:00
41cdb55803 Merge pull request #2123 from traeb0n 2026-11-22 15:10:14 -05:00
00f9ebd672 Merge pull request #2070 from jaybeebabageyus 2026-11-22 15:10:09 -05:00
5063e9cd80 Merge pull request #2069 from AlxcBTW
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-22 15:10:09 -05:00
5abbc6031a Merge pull request #2042 from Vonsek 2026-11-22 15:10:04 -05:00
66ff7cb82a Merge pull request #2039 from Vonsek 2026-11-22 15:10:04 -05:00
7fded18980 Merge pull request #1773 from Vonsek 2026-11-22 15:09:47 -05:00
803abc9176 Merge pull request #1611 from Vonsek 2026-11-22 15:09:45 -05:00
c4eaab94c9 Merge pull request #1518 from Henrique Vinagre 2026-11-22 15:09:42 -05:00
94a6cba5e7 Merge pull request #1299 from Vonsek 2026-11-22 15:09:39 -05:00
45ffc82680 Merge pull request #1161 from woreksami 2026-11-22 15:09:38 -05:00
58024a3a6f Merge pull request #896 from DiazE117 2026-11-22 15:09:38 -05:00
6c92d8e998 Merge pull request #612 from ismailchaka1 2026-11-22 15:09:35 -05:00
ee0d2c5117 Merge refreshed sampled indexing into storage indexing follow-up 2026-11-23 06:09:15 +10:00
9e6544a36b Fix Vulkan replay of same-subresource texture copies
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-22 20:09:05 +00:00
04c99b0825 Translator: --fma exact, a single-rounded f32 FMA without VK_KHR_shader_fma (SHADER-497) 2026-11-22 22:07:33 +02:00
b7b1ce8097 Present: a skipped present no longer leaves the old frame for read_back (TEST-378)
VulkanPresenter::submit() skips the present and returns VK_SUCCESS when the
surface is 0x0 (a minimised window, VK_KHR_win32_surface), but it left
captured_ set, so read_back() handed out the frame before it. PresentX then
succeeded and the read-back showed the previous colour: the real-time 60 Hz
loop in xbox_present_test failed its centre-pixel check whenever the window
was minimised mid-loop (Win+D during a CTest run, say). Reproduced on an
RTX 4080 by minimising at frame 10: "got 0,255,0 want 0,0,255", presented
count frozen.

Both skip paths (no swapchain at the start, and an out-of-date acquire whose
recreation finds a 0x0 surface) now clear captured_, so read_back() is false
until a frame is shown again.

The real-time loop accepts a skipped frame only while the window is iconic,
restores the window and checks the rest; a new case minimises the window on
purpose and requires PresentX S_OK, a skipped present that is not read back,
and the right colour after restoring. It fails without the runtime change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 21:06:51 +01:00
7e1aecf0cb first_light: fix VKH_TSHARP_VA overflow guard, subgroup size, preview env, and test docs
Addresses @Kam471's review on #2806:
- Fix uint32 wraparound in VKH_TSHARP_VA bounds check (tsharp_va > heap_bytes - 32) so 0xFFFFFFE0 is rejected with exit 2 instead of writing OOB; add regression test in tests/test_first_light.py.
- Clarify exact test counts in docs/first_light.md (14 tests: 11 pass, 3 skip without LEONIDA_FIRST_LIGHT_DIR; 14/14 pass with LEONIDA_FIRST_LIGHT_DIR).
- Require --obj when --dds is passed so textured probes are always populated, include all texture env vars in the non---run preview command, and pass VKH_SUBGROUP_SIZE from manifest['ps']['subgroup_size'].
2026-11-22 21:06:15 +01:00
faf8268e3f vk_harness: enable shaderSampledImageArrayDynamicIndexing for VKH_TEX_RGBA 2026-11-22 21:06:15 +01:00
3763517741 First light: add textured draw path with T#/S# bindless set and CPU oracle (TEST-524)
Implements TEST-524:
- runtime/test/vk_harness.cpp: adds optional VKH_TEX_RGBA, VKH_TSHARP_VA, and VKH_SSHARP (inert when unset) to upload an RGBA8 texture to set 0 image index 1 (with 1x1 magenta fallback at index 0), write the 8-dword T# at VKH_TSHARP_VA in the 64 KiB heap, decode S# via gfx10_descriptors.h into sampler index 1, and bind DescriptorTable at binding 2.
- tools/first_light.py: adds --dds <path.dds> (decoding via tools/dds_png.py to texture.rgba), defaults --ps to PS_Copy_3ea4b38a_Wrapped (wave32, single image_sample_lz, compatible with DEFAULT_VS), reads ptr32_lo SGPR and literal_samplers from index.json, and adds a bilinear clamp-to-edge CPU texture oracle (centre_rgba + rgba_probes) in check_image.
- tests/test_first_light.py: shares fl.harness_env() so package-gated tests cover both untextured and textured runs, and adds 6 synthetic TexturedOracleTests (no GPU or game files).
- docs/first_light.md: documents the textured path and RTX 3060 verification (counts and hashes only; no game data).
2026-11-22 21:06:14 +01:00
c901fda139 Merge upstream main into sampled descriptor indexing fix 2026-11-23 06:06:06 +10:00
76d1add3da Merge origin/main into rt-175-raw-hid
Keep RT-160's force-feedback interface and tests next to the raw HID ones.
The raw HID test fakes are renamed (FakeRawHid, raw_*) so they no longer clash
with the haptic fakes. The API table gets one IGameInputDevice row with both
feature sets; the stale duplicate IGameInputDevice and IGameInputDispatcher
rows are dropped.
2026-11-22 23:05:47 +03:00
7be6847cf0 d3d12: a pipeline registers its shaders' literal S#s
A shader that builds its S# from immediates (literal_samplers in the
translator index) names no heap slot, so nothing gave that S# a sampler
and a hash-table key: register_samplers (#1169) had no caller outside its
test. The shader's lookup found the fallback sampler and sampled with
the wrong filter and address modes.

ShaderLibrary now keeps each entry's literal_samplers, and
CreateGraphicsPipelineState / CreateComputePipelineState register those
of every stage that uses the bindless set.

Test: ps_m2_literal.asm (ps_m2 with the S# from s_mov literals) in
d3d12_m2_textured_test: no key for the words before its PSO, a sampler
index after it. Fails on main, passes here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:05:25 -03:00
e421765b40 Merge upstream main into RT-207 2026-11-22 22:05:24 +02:00
a13d955159 vk_compute_test: probe only with compute ballots, main's LocalSize, width apart from lane order
Review of #2886: the probe needs subgroup operations in compute (supportedStages) with basic and ballot
(supportedOperations), or the size stays "not available". LocalSize is the one of the GLCompute entry point "main"
the pipeline is made from, not the last in the module. The width is checked from each subgroup's own lane numbers
and ballot (a wrong width fails the test); 32-lane subgroups that aren't in invocation order, which Vulkan doesn't
promise and the translator assumes, print "not available" and the runners skip.
2026-11-23 00:04:20 +04:00