Commit Graph

471 Commits

Author SHA1 Message Date
a47749b8de Merge pull request #1996 from Joao vitor alves
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-22 10:40:16 -05:00
8b310b2092 Merge pull request #1977 from Douglas Sposito 2026-11-22 10:40:03 -05:00
58cc88f5dd Merge pull request #1971 from Jolymmiles 2026-11-22 10:39:58 -05:00
dd91fbe6ff Merge pull request #1935 from Tao Battarel 2026-11-22 10:39:33 -05:00
4c2800bd27 Merge pull request #1912 from Nolan Cotter
# Conflicts:
#	docs/README.md
#	docs/d3d12_vulkan.md
#	docs/i18n/README.md
2026-11-22 10:39:23 -05:00
96dcddb6fb Merge pull request #1911 from Jan Trencansky 2026-11-22 10:39:21 -05:00
98e9acfb91 Merge pull request #1908 from Jolymmiles 2026-11-22 10:39:19 -05:00
12bad64c53 Merge pull request #1899 from Hadagalberto Junior 2026-11-22 10:39:15 -05:00
7a47f8b1b9 Merge pull request #1878 from CLHelper
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-22 10:39:06 -05:00
ff0b3747d4 Merge pull request #1844 from romainveurrier 2026-11-22 10:38:58 -05:00
2b37b6a5c3 Merge pull request #1825 from richardsenra 2026-11-22 10:38:57 -05:00
9fb466a137 Merge pull request #1820 from Tomgamer 2026-11-22 10:38:57 -05:00
ae2a4a1705 Merge pull request #987 from gabrielsteglich 2026-11-22 10:38:46 -05:00
1e48c3f463 Merge pull request #760 from 0xTehuti 2026-11-22 10:38:41 -05:00
35953169c9 Merge main into D3D-209 and resolve M3 documentation and test registration conflicts
Keep the upstream M4 and buffer-UAV targets and the new fence measurements alongside the single-output M3 query probe and first-pass test. Retested on Intel UHD and RTX 3050 with validation; the pre-existing Intel post-pass Int64 capability error remains visible. AI-assisted with Codex.
2026-11-22 12:36:58 -03:00
d9f7ec4162 Merge upstream main
# Conflicts:
#	tools/fspx_unpack.py
2026-11-22 10:28:36 -05:00
7d30d3fd83 D3D-238: accept HARDWARE_PROTECTED heaps, as the host does
A host run on an RTX 4070 SUPER and a UHD 770 (@CowBoYdu76) creates a
HARDWARE_PROTECTED default heap, though the D3D12_HEAP_FLAGS
documentation calls it unsupported. heap_desc_refusal no longer refuses
it; it moves from the refusal cases to compare_heap_neighbours and the
accepted list. ALLOW_DISPLAY stays refused, now confirmed on those hosts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 16:27:24 +01:00
6c47d748b1 Merge remote-tracking branch 'origin/main' into d3d-238-createheap-validation 2026-11-22 16:26:16 +01:00
502c1ce513 Runtime: M2 formats test (BC1/BC7 mip chains and a 2D array through a PSO)
Closes M2's open item "texture formats other than R8G8B8A8_UNORM, mips and arrays
through a PSO". d3d12_m2_formats_test samples, through the M2 descriptor path
(heap slots 9/10, CreateShaderResourceView, CreateSampler, two root tables,
translated vs_m2/ps_m2): an 8x8 BC1 and an 8x8 BC7 texture with 4 mips each and
an R8G8B8A8 2D array of 3 slices (new ps_m2_array.asm). Every subresource is
uploaded at its GetCopyableFootprints layout; POINT samplers with MinLOD = MaxLOD
pin each level; a view from mip 1 and two array views check that level and slice
are relative to the view. Blocks use endpoint colours only, so all 12 cases are
compared with the CPU byte for byte (error 0). Validation clean on RTX 4070 Ti
SUPER; no layer change was needed. Synthetic data only, no game files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_01PiKMETzszqwfnV8QQyzocY
2026-11-22 12:26:05 -03:00
b17531d021 Support sparse tile mappings for reserved D3D12 buffers
Depends on D3D-16 (PR #286).
2026-11-22 12:24:19 -03:00
c975dd407f docs: B8G8R8X8 blending in d3d12_vulkan.md (D3D-240)
Say that blending into a B8G8R8X8 render target reads destination alpha
as 1, which factors the PSO rewrites, and that what a draw leaves in the
X byte is not defined.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:20:23 -03:00
ef4d3053b1 Depth/stencil region resolves keep the texels around the rectangle
A ResolveSubresourceRegion of a depth or stencil plane runs in a rendering scope whose render area is the source
rectangle, and Vulkan resolves only inside it. MoltenVK (1.4.2 and 1.4.3) resolves the whole destination
subresource: it resolves through Metal's store action, which has no render area. d3d12_depth_resolve failed its
eight MIN/MAX rectangle cases under Wine on an M3 Max for that reason.

The texels around the rectangle now go into copy_scratch before the scope and back after it, in up to four bands, on
every GPU: no device property reports the behaviour. vk_command_replay_test part I resolves a D32 rectangle natively
and checks the texels around it; it failed on MoltenVK before this change (all 28 overwritten) and passes on
MoltenVK and KosmicKrisp, with no validation errors on KosmicKrisp.

AI-assisted.
2026-11-22 19:18:06 +04:00
efeef30822 d3d12: select integer transparent black for UINT custom border fallback
- For samplers with custom border colours (BorderColor::table), retain is_int in the fallback path when VK_EXT_custom_border_color is unavailable.
- Select VK_BORDER_COLOR_INT_TRANSPARENT_BLACK for UINT custom borders and VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK for float custom borders, satisfying Vulkan input validation rules on integer views (reported by Vonsek, #760).
- In vulkan_sampler(), default to VK_BORDER_COLOR_INT_TRANSPARENT_BLACK when sampler.integer_border is set for table colours.
- Update d3d12_sampler2_test with a fallback device and vkCreateSampler interception to verify that VK_BORDER_COLOR_INT_TRANSPARENT_BLACK and VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK are requested as expected.

Tested on Windows 11, MSVC 2022 x64 (Ninja, RelWithDebInfo), NVIDIA GeForce RTX 2070 SUPER.
Clean-room verification suite passed with exit code 0.
Co-Authored-By: Antigravity <antigravity@google.com>
2026-11-22 16:14:57 +01:00
3e3d94f65c d3d12: custom sampler border colours on VK_EXT_custom_border_color (D3D-73)
- Implements custom float and UINT sampler border colours on VK_EXT_custom_border_color in runtime/shims/d3d12_vulkan_device.cpp.
- Maintains a device-wide border colour table of up to 4000 entries.
- Assigns table indices into S# BORDER_COLOR_PTR [11:0] (with BORDER_COLOR_TYPE = table), ensuring distinct custom colours produce distinct keys in the bindless descriptor hash table while identical colours reuse existing indices.
- Chains VkSamplerCustomBorderColorCreateInfoEXT with VK_BORDER_COLOR_FLOAT_CUSTOM_EXT / VK_BORDER_COLOR_INT_CUSTOM_EXT and format = VK_FORMAT_UNDEFINED when customBorderColorWithoutFormat is enabled. Falls back to transparent black with a diagnostic warning when the extension is absent.
- Enables VK_EXT_custom_border_color in standalone device creation and vk_test_device.h.
- Updates d3d12_sampler2_test to verify table index assignment, index reuse, S# distinction between float and UINT representations, and Vulkan sampler creation.
- Documents the architecture in docs/d3d12_vulkan.md.

Tested on Windows 11, MSVC 2022 x64 (Ninja, RelWithDebInfo), NVIDIA GeForce RTX 2070 SUPER, Driver 595.79.
Clean-room verification suite (python compileall, make_game.py CLI, 27/27 CTest, d3d12_vulkan_device_test, d3d12_sampler2_test, d3d12_descriptor_test) passed with exit code 0.

Item: D3D-73 (#634)
Co-Authored-By: Antigravity <antigravity@google.com>
2026-11-22 16:14:56 +01:00
2b2effeacb runtime: answer non-OPTIONS CheckFeatureSupport queries (D3D-258) 2026-11-22 16:07:42 +01:00
17a27f23cc d3d12_present_test: check the presented images through the capture, GDI screen read only where it works
Under Wine's macOS driver the test failed at its last step, the GDI read of the screen: GetPixel on the screen DC
returns CLR_INVALID there for every pixel, even one GDI painted itself (BitBlt from the screen DC fails too), and
the window's own DC holds Wine's GDI surface (white), not the image presented through the Metal layer. The
presenter itself was fine: all the injected-failure checks passed, MoltenVK made 320x240 and 400x300 swapchains
at contents scale 1.0, and the driver reported no out-of-date presents. The "present failed" lines in that log
(VkResult -1000001004 twice, then -1 = VK_ERROR_OUT_OF_HOST_MEMORY) are the test's own injections; markers around
them showed each line inside its injection.

The test now enables the presenter's capture and checks the whole presented image for the clear colour at the
swapchain's size after the first 60 frames, after the resize and at the end, on every platform. The screen check
stays where GDI can read the screen; a CLR_INVALID there is reported and skipped instead of failing. The test also
says on stderr that the next three "present failed" lines are expected, since they were read as faults twice.
Checked under CrossOver's Wine 11 with MoltenVK 1.4.3 on an Apple M3 Max: the test passes, and with the clear
colour changed the capture check fails at the first 60 frames.
2026-11-22 18:59:21 +04:00
8fc8147bf3 docs+shims: fold in the measured Xbox ABI surface from sibling layers
Other Xbox Series compatibility-layer efforts have run the same package's
console DLLs, shader pack and retail titles. This folds their published
measurements into docs/d3d12_vulkan.md §7 — the CS root-argument packing, the
inline record opcodes, the mesh inputs, the OpenExistingHeapFromAddress UMA
recipe, 64 KiB physical pages, more command-list slot numbers and the console
export surface — each row paraphrased with its measurement basis noted.

The unimplemented-import classifier learns the console DLL names from that
surface (d3d12_xs!D3D12XboxCreateSyntheticDevice, xaudio2_9!XAudio2Create,
gameinput!GameInputCreate, dstorage_xs!DStorageGetFactory) so fail/stop
policies report E_NOTIMPL honestly instead of faking success; functions with
no measured return (xg_xs, AcpHal, D3D12XboxSetProcessDebugFlags) stay `other`.
Classification checks added to unimplemented_policy_test.

AI-assisted. Tested: test_i18n_index, test_docs_links, compileall. The
registry/test change is Windows-only C++ and was not compiled here.
2026-11-22 07:57:55 -07:00
d63fac7606 Merge branch 'main' into d3d-238-createheap-validation 2026-11-22 15:57:50 +01:00
0a488f6733 D3D-238: refuse ALLOW_DISPLAY and HARDWARE_PROTECTED, leave CreateHeap1 to #1846
heap_desc_refusal now also refuses D3D12_HEAP_FLAG_ALLOW_DISPLAY and
HARDWARE_PROTECTED, which the D3D12_HEAP_FLAGS documentation says
CreateHeap does not support (review on #1820). Both are host-comparison
cases in compare_invalid_arguments, awaiting a host run, and direct
refusal checks on the standalone device.

CreateHeap1, its heap1 test cases and the heap_create1 helper are
removed: #1846 implements CreateHeap1 over CreateHeap and inherits these
checks. The docs keep #1846's CreateHeap1 line untouched and describe
the CreateHeap checks under the heap bullet instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:56:23 +01:00
ad43d631e1 docs: open question 22, whether the game gates ray tracing on RaytracingTier
The layer keeps answering NOT_SUPPORTED (no CreateStateObject or DispatchRays),
although its XDXR acceleration structures are what the game's own traversal
shaders read. The first-boot trace shows whether the game asks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:55:12 +01:00
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
77a82d7c1a Merge pull request #1870 from Vonsek
# Conflicts:
#	docs/character_models.md
2026-11-22 09:48:57 -05:00
33507d493d Merge pull request #1863 from jsthope 2026-11-22 09:48:52 -05:00
c53024be39 Merge pull request #1858 from AlxcBTW
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-22 09:48:50 -05:00
7886972a6b Merge upstream main
# Conflicts:
#	docs/d3d12_command_objects.md
2026-11-22 09:48:41 -05:00
b566a8652f Merge pull request #1844 from romainveurrier 2026-11-22 09:48:41 -05:00
2daadb7968 Merge pull request #1820 from Tomgamer 2026-11-22 09:48:26 -05:00
f3b4e69b90 Merge pull request #1813 from SuarezPM 2026-11-22 09:48:23 -05:00
23c6147946 Merge pull request #1811 from Vonsek 2026-11-22 09:48:23 -05:00
3b7cd5e4bf Merge pull request #1791 from AlxcBTW 2026-11-22 09:48:16 -05:00
cd6d8ac35a Merge pull request #1787 from CowDeV 2026-11-22 09:48:15 -05:00
9335894fb0 docs: where the 0x03000000 root-signature flags come from in the package
Open question 19 asks what the 0x03000000 flag bits mean. Their origin can
be measured statically: of the two console-compiled clients only
XboxBvhBuilder.dll sets them. All 52 RTS0 parts in its shaders carry
0x03000000, and the function at 0xc2d0, which holds its only
D3D12SerializeVersionedRootSignature call (0xc32f), ORs them into the
stack copy's v1.1 Flags at 0xc30e with no branch before it. The FSR DLL's
29 RTS0 parts carry 0 and its code never uses the constant. The meaning
stays open, as does what the executable's root signatures carry.
2026-11-22 14:47:25 +00:00
f475508e93 docs: clarify the scope of M3 first-pass isolation
Describe the post-pass pipeline and draw that are omitted, and the shader files, library entries and descriptor setup that remain required. Addresses the scope feedback on PR #1825. AI-assisted with Codex.
2026-11-22 11:46:24 -03:00
02eccb8b8c docs: drop merge-duplicated bullets in d3d12_vulkan.md and character_models.md
d3d12_vulkan.md listed its RTV/DSV bullet twice (the second an older
version) and the "Hash-table cost" and "Wave64" risks twice each; keep the
current copy of each (the hash bullet with the Intel/RTX 5070 Ti/RDNA3
measurements, the wave64 bullet with the per-stage subgroup rule).
character_models.md kept the first line of a rewritten bullet. The new test
flags a list item whose opening repeats within a few lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:44:25 +01:00
c7801ac6fb Merge upstream main
# Conflicts:
#	docs/d3d12_vulkan.md
#	runtime/README.md
2026-11-22 09:35:55 -05:00
96d0b2455f docs: 42/52 after main's global-atomics fix
003e7812 loads EXEC before OpSelectionMerge in global_atomic and global_atomic_x2,
so FindTreelets assembles and validates. The 10 left are still the four rules.
2026-11-22 11:34:56 -03:00
4d9372d433 docs: M4 row lists typed buffer UAVs and UAV counters as done
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:34:20 +01:00
537486c875 Merge remote-tracking branch 'fork/m4-synthetic-gate' into buffer-uav-typed-counter
# Conflicts:
#	docs/d3d12_vulkan.md
#	runtime/shims/d3d12_vulkan_device.cpp
2026-11-22 15:34:07 +01:00
5ecb637a02 Docs: the embedded shader containers; the BVH builder's programs are console FSSM
The 52 containers in XboxBvhBuilder.dll carry an LLVM bitcode blob and an
XDAT/XBCH record. The console record decompresses to FSSM: 52/52 unpack, 42
translate, 41 pass spirv-val with the existing translator. The 10 left need
global_atomic_fmax/fmin, buffer_load_ushort and tbuffer_load_format_x (format
8), plus one OpSelectionMerge emission bug. Correct the DXIL-front-end premise
in d3d12_vulkan.md (4.8, 7.1, 7.2, M6, Q7, Q20, A.2) and index the new note.
2026-11-22 11:34:05 -03:00
f209d86b8f D3D12 layer: typed buffer UAVs and UAV counters (V# FORMAT, counter V# in the slot), d3d12_buffer_uav_test
CreateUnorderedAccessView on a buffer with a typed Format writes a typed V# (GFX10_FORMAT code, element size as
stride, element count, OOB_SELECT structured, the format's own DST_SEL), and a structured view with pCounterResource +
CounterOffsetInBytes writes a second raw 4-byte V# in the upper 16 bytes of the slot (a hypothesis for the console
contract, documented in section 3.4). The combinations D3D12 documents as invalid leave a null slot.

d3d12_buffer_uav_test runs two hand-written RDNA2 compute shaders through the translator (typed store/load/atomic on
five formats with NUM_RECORDS as the bound; append by 256 lanes and consume by 128 on a counter at offset 4096, read
back with CopyBufferRegion) against a CPU reference, then compares typed-buffer and counter clears with the host D3D12
runtime on the same adapter (LUID).

Depends on: #1791

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:33:50 +01:00