Commit Graph

5744 Commits

Author SHA1 Message Date
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
bec6d72a21 rdna2spirv: s_atc_probe and s_atc_probe_buffer are no-ops
Both SMEM ops only probe (prefetch) an address in the address translation
cache: no data comes back and nothing is written. They raised Unsupported;
they join NOOPS. test_sopp_noops.py covers them and the design row lists
them.
2026-11-22 11:58:55 -03:00
de2db33510 i18n: add the Spanish community quickstart
Mirrors the stable onboarding text (what Leonida is, the own-copy and
no-game-data rules, prerequisites, build commands, stage order, common
troubleshooting, contribution pointers) at synced commit 003e7812, following
the fr/pt-BR structure. The index row lists @NolanCotter as maintainer.

AI-assisted. Tested: test_i18n_index, test_docs_links.
2026-11-22 07:57:55 -07: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
18abefa47b wave64-emulate: elide dead SCC votes and fold safe lane-local execz regions
Reduces redundant round barriers and OpSwitch cases under --wave64-emulate (Issue #884) via two exact CFG/dataflow passes in tools/wave64_emulate_opt.py: (1) backward SCC liveness skips scc_from_mask/scc_any_half votes when SCC is dead-out; (2) safe lane-local s_cbranch_execz/execnz region folding inlines single-entry/single-exit read-only regions with no cross-lane ops, no barriers, no EXEC-widening, and no live-out scalars behind if (%active) and chains single-predecessor continuations.
2026-11-22 10:57:54 -04: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
f5fa44f68d sop2_b32_srcs: mask reads only when the result goes to EXEC / VCC
s_and_b32 s20, exec_lo, 1 put each lane's bit in s20, which lane_masks.py
classifies as data when the other operand is a constant, so s_bcnt1 of it
counted 32 / 0 instead of 1 (found by @Pierre-Kookis on #1792, reproduced
on AMD RDNA2 and an RTX 4070 Ti SUPER; main was right). The mask read is
now only for an EXEC / VCC destination; into a plain SGPR the op keeps the
data read. test_mask_src_sgpr_const.py has the case.
2026-11-22 11:55:06 -03:00
c49bdcd156 rdna2spirv: a constant used as a lane mask through an SGPR (or in a b32 SOP2 on EXEC) gives each lane its bit
s_mov_b32 s20, 0x3ffffc00; s_and_saveexec_b32 s6, s20 left all lanes on:
mask_src read the SGPR's raw value, the same non-zero constant in every
invocation. The 32-bit bitwise SOP2 ops read constants raw too, so
s_and_b32 exec_lo, exec_lo, 0xff00 (inline or in an SGPR) kept every
lane, and s_mov_b32 exec_lo, sN did the same.

mask_src now takes bit L of an SGPR holds_lane_mask doesn't flag (the
high SGPR of a pair for lanes 32-63 in wave64). In wave32, a bitwise SOP2
on masks (EXEC/VCC destination or a mask source) reads both operands
through mask_src (sop2_b32_srcs), and s_mov_b32 exec_lo/hi from a non-mask
SGPR takes each lane's bit. A real mask is unchanged (0 / ~0 per lane).

tests/semantic/test_mask_src_sgpr_const.py covers saveexec, SOP2 on EXEC
(inline and SGPR), exec_lo from an SGPR, v_cndmask, a wave64 pair and
masks from compares. cf_diff (self-test, 800 runs) and salu_diff (500)
pass. docs/design.md row updated.
2026-11-22 11:54:58 -03:00
9a967e1901 rdna2spirv, fssm_header: read authoritative wave size from FSSM 0xD4 bit 5 2026-11-22 06:54:06 -08:00
186d793b2e Translator: v_dot4_i32_i8 refuses neg_lo and neg_hi, which the hardware does not ignore
The rule took v_dot4_i32_i8 with a neg_lo or neg_hi field as the plain instruction. llvm-mc accepts those
fields on it for gfx1036 (not on v_dot4c_i32_i8), and on RDNA2 hardware they change the result: neg_lo flips
bit 15 and neg_hi bit 31 of S0 or S1, and on S2 neg_hi clears bit 31 before neg_lo flips it, as the fields do
to float operands.

Measured on gfx1036 through tools/hw_oracle: 5 operand sets under 8 forms plus the plain one, 45 words, all as
that model predicts. Nine of them are the table MEASURED_NEG of tests/semantic/test_alu_dot4_i8.py.

A set bit is now Unsupported, like clamp and op_sel; an all-zero field stays the plain instruction. No listing
of the 29 FSPX programs carries either field on these two instructions (0 lines), so what translates there
does not change.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 09:52:23 -05: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
307809a156 rdna2spirv: add v_dot2_i32_i16/u16, v_dot4_u32_u8, v_dot8_i32_i4/u4, and v_pk_fmac_f16 (SHADER-300) 2026-11-22 15:51:56 +01:00
a827ff9f96 cfg_structure: make structuring iterative and flatten dominated tail continuations
Avoid O(N) OpSelectionMerge nesting and Python RecursionError on long sequential diamond/loop chains (e.g. unrolled ScreenProbes compute shaders): hoist each guarded member's dominated tail continuation out of its enclosing guard (exact by strict dominance) and make cfg_structure.structure, cfg_structure.run, and rdna2spirv.assemble's structured emitter iterative.
2026-11-22 10:51:34 -04:00
4de870250e SHADER-309: keep compute workgroup memory under the limit
--wave64-emulate adds %x_buf (2L + 6W + 7 dwords) on top of the LDS
array, so a 64 KiB LDS made modules over maxComputeSharedMemorySize,
which spirv-val accepts and RADV dies on (#1721).

Translator: a 64 KiB hard cap (MAX_SHARED_BYTES, --max-shared-memory).
Over it, the pow2-rounded LDS array shrinks to the room left when the
program's need fits (indices wrap with OpUMod); otherwise the shader is
refused (Unsupported, with the byte counts). lds_bytes in index.json is
now the whole Workgroup total.

Runtime: the D3D12 shim's create_compute compares lds_bytes with the
device's maxComputeSharedMemorySize (32768 on AMD Windows and Intel)
and refuses the pipeline with a log line instead of creating it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 15:49:23 +01:00
a9929f9044 Merge pull request #1877 from Dominik 2026-11-22 09:49:01 -05:00
35cd8160ca Merge pull request #1871 from Vonsek
# Conflicts:
#	docs/design.md
2026-11-22 09:48:59 -05:00
77a82d7c1a Merge pull request #1870 from Vonsek
# Conflicts:
#	docs/character_models.md
2026-11-22 09:48:57 -05:00
9c891f5e27 Merge pull request #1867 from liang-kai-shui
# Conflicts:
#	docs/i18n/README.md
2026-11-22 09:48:55 -05:00
a37bf235b7 Merge pull request #1866 from SirAmong 2026-11-22 09:48:54 -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
db1e5605df Merge pull request #1856 from Youssef Rahmouni 2026-11-22 09:48:48 -05:00
ca1557eac6 Merge pull request #1855 from bingll123
# Conflicts:
#	docs/README.md
#	docs/i18n/README.md
2026-11-22 09:48:48 -05:00
19e7023217 Merge pull request #1849 from Vonsek 2026-11-22 09:48:44 -05:00
613d90052b Merge pull request #1847 from SirAmong 2026-11-22 09:48:43 -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
432a555a2a Merge pull request #1843 from Kam471 2026-11-22 09:48:41 -05:00
e41faaff35 Merge pull request #1838 from ezwinxdlmao
# Conflicts:
#	docs/design.md
2026-11-22 09:48:39 -05:00
c3bc62bb45 Merge pull request #1835 from Vonsek
# Conflicts:
#	docs/README.md
#	docs/testing.md
2026-11-22 09:48:37 -05:00
b9a2ac53cf Merge pull request #1833 from Kam471
# Conflicts:
#	docs/design.md
2026-11-22 09:48:35 -05:00
cc26b16dbd Merge pull request #1831 from Youssef Rahmouni
# Conflicts:
#	docs/design.md
2026-11-22 09:48:33 -05:00
740a13fbe2 Merge pull request #1830 from AwkGrep256 2026-11-22 09:48:32 -05:00
b78a9fca36 Merge pull request #1828 from dcastell1
# Conflicts:
#	docs/design.md
2026-11-22 09:48:31 -05:00
5a3aca054c Merge pull request #1826 from SirAmong 2026-11-22 09:48:29 -05:00
9eb80309fc Merge pull request #1823 from Vonsek
# Conflicts:
#	docs/design.md
2026-11-22 09:48:28 -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
b689b28967 Merge pull request #1810 from Tayar 2026-11-22 09:48:22 -05:00
6fb8ba8d2e Merge pull request #1806 from Dmitry Bykov 2026-11-22 09:48:21 -05:00
6ffa0e2aa8 Merge pull request #1800 from Leonardo Guimaraes 2026-11-22 09:48:18 -05:00
b489f06dba Merge pull request #1792 from Luiz Neves
# Conflicts:
#	docs/design.md
2026-11-22 09:48:17 -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
773807f451 Merge pull request #1774 from Shadman PC
# Conflicts:
#	docs/design.md
#	docs/shader_validation.md
2026-11-22 09:48:15 -05:00
9df596963a Translator: v_cvt_pk_u8_f32 NaN gives 0, with RDNA2-measured GPU test (SHADER-48)
Measured natively on an RDNA2 iGPU (gfx1036): v_cvt_pk_u8_f32 rounds to
nearest even, clamps to [0, 255] and gives 0 for NaN. The RoundEven rule
was right; NaN reached FClamp, which is undefined for a NaN operand, so it
is now replaced by +0 first.

cs_cvt_pk_u8.asm holds eight hardware words (four byte selects), checked
by check.py and run_gpu_tests.py, and bit-for-bit on the CPU by
tests/semantic/test_cvt_pk_u8.py. Contract-table row added.

Fixes #358
2026-11-22 15:48:12 +01:00
18d6f165cb Merge pull request #1759 from BetterJdue
# Conflicts:
#	docs/design.md
2026-11-22 09:48:12 -05:00