Commit Graph

5744 Commits

Author SHA1 Message Date
1fa5187d76 Merge pull request #2062 from dororodev
# Conflicts:
#	docs/design.md
2026-11-22 11:41:23 -05:00
d672b19212 Merge pull request #2057 from Vonsek 2026-11-22 11:41:18 -05:00
fcab6124bc Merge pull request #2053 from Vonsek
# Conflicts:
#	docs/design.md
2026-11-22 11:41:17 -05:00
88eb186603 Merge pull request #2052 from Nethmina Yasas 2026-11-22 11:41:14 -05:00
7ef8c899b1 Merge pull request #2047 from CLHelper 2026-11-22 11:41:11 -05:00
04068def59 Merge pull request #2034 from Davide 2026-11-22 11:41:05 -05:00
410ac7c349 Merge pull request #2025 from undeadhuman37 2026-11-22 11:41:03 -05:00
9b138453e8 Merge pull request #2001 from Rafael 2026-11-22 11:41:00 -05:00
b4491b0a05 Merge pull request #1968 from SweatierKey
# Conflicts:
#	docs/design.md
2026-11-22 11:40:58 -05:00
fe1cc0b7aa Merge pull request #1967 from fearkov
# Conflicts:
#	docs/design.md
2026-11-22 11:40:56 -05:00
56000c7c7f Runtime: CreateRootSignature and CreateQueryHeap answer invalid arguments as the host does
Measured against the host D3D12 runtime (RTX 5070, driver 621.14) with
d3d12_vulkan_device_test's compare_invalid_arguments, five answers
differed:

- CreateRootSignature took a node mask other than node 0 (host:
  E_INVALIDARG), took a DXBC blob passed with more bytes than its own
  size (host: E_INVALIDARG), and answered a null output with E_POINTER.
  The host answers a null output with S_FALSE before it looks at the
  blob or the node mask.
- CreateQueryHeap answered an unknown type (past PIPELINE_STATISTICS1)
  with E_NOTIMPL (host: E_INVALIDARG), and a null output with S_FALSE
  (host: E_UNEXPECTED, after the description checks).

compare_invalid_arguments gets 30 "query heap:" and "root signature:"
cases. The root signature blobs come from the host's serializer.
d3d12_vulkan_device_test's own null-output check now expects
E_UNEXPECTED. Known query types this layer has no path for stay
E_NOTIMPL, and more than 32 root dwords stay refused (pack()).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:40:55 +01:00
5e27b4840f Merge pull request #1950 from CLHelper
# Conflicts:
#	docs/d3d12_command_objects.md
2026-11-22 11:40:54 -05:00
ffc5f589c6 Merge pull request #1941 from Vonsek
# Conflicts:
#	docs/design.md
2026-11-22 11:40:51 -05:00
fa3c76d318 docs: correct fragment recovery note for pinned explorer 2026-11-22 17:40:45 +01:00
cf021320e5 world_archetypes: read CMapTypes archetype definitions; check map extents (BUILD-557)
tools/world_archetypes.py reads the archetype structs of CMapTypes resources
(CBaseArchetypeDef, CMloArchetypeDef, CTimeArchetypeDef) by member hash, the
way world_index.py reads CEntityDef: name, assetName, assetType, bbMin/bbMax,
bsCentre/bsRadius, lodDist, flags. It imports world_index and world_census and
changes neither, so it does not touch the lines #1981 changes.

--check-extents rebuilds each fully-defined map's entitiesExtents from the
transformed archetype boxes. In levels.rpf 8-9 GiB the conjugated quaternion
reproduces 616 of 827 rotated maps (median error 0.16 mm), the stored one 236
(0.63 m), and the extents are computed without the entity scale.

docs/world.md: the member table, assetType measured against rpf9_names.py
(1 = fragment, 2 = drawable, 3 = drawable-like, no crossover), and the two
extents checks. Synthetic tests only, no game data.
2026-11-22 13:40:44 -03:00
5cf0a1743d Merge pull request #1880 from Vonsek 2026-11-22 11:40:43 -05:00
1c6d978650 chore(shader): merge main for 3D gradient samples
Keep the new coherent image-read guard alongside dimension-aware gradient widths.
2026-11-22 17:40:42 +01:00
c10d8a7081 Merge pull request #1878 from CLHelper 2026-11-22 11:40:42 -05:00
3ffdaed761 chore(shader): merge main for packed 2D mip loads
Keep upstream packed image atomics and allow packed texel and mip addresses on ordinary 2D mip loads.
2026-11-22 17:40:39 +01:00
867be74659 Merge pull request #1742 from RaveN499 2026-11-22 11:40:38 -05:00
fc2ee62c98 Merge pull request #1683 from requiemsnkrp 2026-11-22 11:40:37 -05:00
e2de7fc875 Merge pull request #1534 from Kam471 2026-11-22 11:40:35 -05:00
ea00498d3f Merge pull request #664 from WHOISJARDAS 2026-11-22 11:40:30 -05:00
63424bee7e text_tables: a string table's language from the nested RPF9 archive it sits in
docs/text.md had "Language per table" open: the tables carry no
language field and each one's language was guessed from its text. In
data.rpf and story000.rpf every string table sits in one of 13 nested
RPF9 archives (9FPR at 4 KiB-aligned offsets), and each archive is one
language.

A table in a nested archive now takes the guess most of that archive's
tables share (xx left out), when it covers more than half of them;
otherwise, and outside nested archives, a table keeps its own guess.
Nested archives come from an .rpf source or from the archive an
rpf9_carve.py directory's index.json names. --tables gains `guess` (the
per-table guess) and `archive` (the nested archive's offset). Scan
keeps the guesses and resolves languages when tables or texts are read.

Measured (counts only): data.rpf 14,440 tables in 13 archives, 2,075
change; story000.rpf 15,831 tables in 13 of 436 nested archives, 849
change. xx, plain es and plain zh drop to 0 in both. Table in
docs/text.md.

tests: nested-archive detection, archive majority over strays and xx,
no majority keeps each guess, a carve directory end to end through its
index.json, and a source with no archive.
2026-11-22 13:40:09 -03:00
e73aaca078 page_index: report 0DRP resource groups and the +0x20 disagreement (ASSET-150)
The +0x20 count is the only field that looked like a grouping unit, so it was tested against
every stream boundary reading on story000.rpf before being used: a directory is followed by one
non-directory stream in 16,128 of 16,977 cases regardless of the count, and the best page-size
reading matches 9,622 pages (56.7%). The boundary comes from the q38 table, so each page now
reports the streams that make up its resource and whether the declared count agrees with the
64 KiB units they occupy.
2026-11-22 16:40:07 +00:00
9b9c634b31 rdna2spirv: image_get_resinfo returns what RDNA2 returns (2D depth 0, minified layers, 0 past the last level)
Measured on gfx1036 in #2204 (tools/image_query_probe.py): a 2D image's
depth word is 0, a 2D array's layer count is minified to
max(1, layers >> (BASE_LEVEL + level)), and past the last level width,
height and depth are 0. The translator wrote 1, the full layer count, and
queried OpImageQuerySizeLod past the view's levels (undefined).

Gen.resinfo_words now emits the hardware rule: the level is compared
unsigned with the level count, the size query uses level 0 when it is out of
range, and BASE_LEVEL comes from T# word 3 [15:12]. vk_texture_test's
stand-in T# gets BASE_LEVEL 0 to match its level-0 views. cs_resinfo expects
depth 0 and gains level 5 of five.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:39:10 +01:00
f8e89767f6 Runtime: map sparse reserved RGBA8 texture tiles (D3D-285) 2026-11-22 13:39:08 -03:00
7a70ec73bc docs/xdxr: the offline statistics layout is not in the package (RT-155)
XboxBvhBuilder.dll (1.0.2.1) only rejects or skips postbuild InfoType 0x10:
0xe6a0, called first by the batched export, fails the build with
E_INVALIDARG on any 0x10 desc, and the export's own postbuild loop skips
it (0/3 -> 0x1d540, 2 -> 0x1d7c0). Neither reads past InfoType, and none
of the package's 15 other DLLs names the type or an offline builder.
Record the RVAs and close the open question: the layout needs the
offline BVH builder, which is not in the package. RVAs only; nothing
from the DLL is reproduced.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 05:38:42 +13:00
7812487acc d3d12_vulkan_device: answer Intel integrated OPTIONS1 lanes per generation (D3D-280)
Meteor Lake (Xe-LPG) hosts answer 8..32 while the D3D-121 rule pins 16..16 for every
Intel integrated GPU; keep the measured 16..16 pin on pre-Xe-LPG lines (Tiger Lake
regression-checked locally) and keep the Vulkan range on Xe-LPG+ device-ID ranges
(Meteor/Arrow Lake 0x7d40-0x7dc5, Lunar Lake 0x64a0-0x64b6).

Fixes D3D-280.
2026-11-22 17:38:00 +01:00
6fe4410f03 docs: record 6stars as an unlicensed format cross-check 2026-11-22 16:37:23 +00:00
703766fabc tools: link the skinned GLB docs and cover the no-numpy path 2026-11-22 16:37:06 +00:00
d38770fe11 Name the RDNA2 part in the GPU-checked rows (#2053)
AI-assisted.
2026-11-22 17:36:43 +01:00
fe7edb58bd Address review on #2087: commit the s_cmov_b64 probe cases
Add the salu_cmov_b64 group (14 cases) to tools/int_hw_probe.py so the
gfx1036 measurement in docs/design.md is reproducible, name the command in
the row, drop the pointer to the duplicate row, and point the salu_diff.py
comment at the design.md counts instead of a second number.

AI-assisted.
2026-11-22 17:36:15 +01:00
5ba0ab317c rdna2spirv: implement v_frexp_mant_f64 and v_frexp_exp_i32_f64 2026-11-22 17:35:31 +01:00
8dea28d4e2 docs: record the skinned GLB layout; fix per-component joint counts 2026-11-22 16:35:25 +00:00
c7b6136446 fix(shader): read packed coordinates on explicit 2D mip loads
GFX10 A16 packs the unsigned texel position into one VGPR and the mip level into the low half of the next one. The existing typed fetches can consume these addresses for both ordinary and packed results.
2026-11-22 17:35:25 +01:00
0a3bf1ed91 PresentX planes: enable swapchain_colorspace on the real instance, premultiply before filtering
- create_vulkan_device_standalone now enables VK_EXT_swapchain_colorspace when the loader has it (only the
  test device did), so the HDR10 surface formats can be listed in the real runtime; xbox_present_test checks
  the standalone path (device_has_swapchain_colorspace).
- Straight-alpha planes are bilinearly filtered on premultiplied colour and un-premultiplied after, so a
  transparent texel adds no colour; the CPU model does it independently, plus a transparent-edge case.

Both found in review by Flyander.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:34:38 +01:00
cb467ea27e docs/design: merge the duplicated Integer clamp rows 2026-11-22 19:34:31 +03:00
e20ced9262 tools: export a skinned GLB from the ped skin streams 2026-11-22 16:34:30 +00:00
72d7e52dfa Translator: a mask copied to a VGPR respects EXEC (SHADER-21 part 2, #210) 2026-11-22 16:33:52 +00:00
507ab37e19 docs: address review of the inline-dispatch notes
- move the new notes after the list-setup paragraph instead of splitting it
- list the fourth slot-80 fallback (0x1d047, W = 0x8020) in the section 3.3a row and the bullets
- write the header as table[root] + ((count - 1) << 16)
- say what is read from the code (the slot-80 fallback) and what stays inferred (slot 80's meaning)
2026-11-22 16:33:44 +00:00
fbe50b23fd rdna2spirv: align swizzled buffer addressing with native RDNA2 hardware (SHADER-343)
Measure MUBUF/MTBUF swizzled buffer addressing (V# SWIZZLE_ENABLE,
ADD_TID_ENABLE, INDEX_STRIDE, OOB_SELECT, multi-dword and typed
accesses, atomics, 32-bit offset wrap) natively on RDNA2 (gfx1036,
wave32 and wave64) via tools/buffer_swizzle_probe.py, and fix all six
observed silicon divergences in tools/rdna2spirv.py:

- idxen=1 ignores ADD_TID_ENABLE (both address and bounds).
- SWIZZLE_ENABLE=1 with idxen=0 and ADD_TID_ENABLE=0 stays linear and
  OOB_SELECT 3 remains RAW.
- Multi-dword raw accesses step by +4*IS only in scratch-swizzle mode
  (SWIZZLE_ENABLE=1, idxen=0, ADD_TID_ENABLE=1); indexed swizzle
  (idxen=1) steps linearly by +4 bytes even across IS boundaries.
- Scratch-swizzle mode suppresses typed formats > 4 bytes (MUBUF/MTBUF)
  and 8-byte buffer_atomic_*_x2 even under OOB_SELECT 2 (formats <= 4B
  execute normally); indexed swizzle executes them linearly.
- OOB_SELECT 3 with active swizzle and stride != 0 checks
  (index + soffset) >= num_records or off + payload > stride.
- off = uint32(voff + inst_offset) wraps at 32 bits before bounds
  checking, while RAW mode 3 uint64(off) + uint64(soffset) does not.

Update semantic tests, cs_buf_swizzle fixture expectation (word 4:
0x5eed0028 -> 0x5eed000c), unit tests, and docs/design.md /
docs/shader_validation.md.
2026-11-22 08:32:34 -08:00
5943dcea70 tools: read story content-definition XML (ASSET-149)
Preserve ordered records and expose file/include/setup views, with synthetic tests and counts from four complete archives. No game data included. AI-assisted.
2026-11-22 17:31:54 +01:00
9b99a5f030 Merge remote-tracking branch 'origin/main' into d3d12-queues-v2
# Conflicts:
#	runtime/test/vk_test_device.h
2026-11-22 17:31:21 +01:00
49475796c2 Fix tests the round-39 merges broke
- test_translate: #1904 caps structured depth at 16, so the #1993 dispatch-loop test lowers MAX_STRUCTURED_DEPTH.
- test_ctest_registration: skip-code scan ignores conditional returns.
- test_d3d12_stubs_generation: INCLUDE uses os.pathsep.
- docs/README.md: one Other languages line.
- first_light.py, make_game.py: LF text writes; stdout guard on three tools.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:31:20 -05:00
8ab01bbe3b XDXR: totalSizeIn64BNodes does not count the header, a structure is 64 * (field + 1) bytes (RT-151)
docs/bvh.md 3.1: u32@0x20 = 0x140 + 64 * totalSizeIn64BNodes, 271,627 of
271,627 streams. xdxr_build.comp wrote total_size / 64; the copy and
postbuild paths read the field as the whole size, and tools/xdxr_bvh.py
wrote and validated it the same way. Now the header writes total / 64 - 1,
MODE_COPY_AS and MODE_POSTBUILD use (field + 1) * 64, validate() and the
reference builder agree, xdxr_build.inc is regenerated (glslc 2026.4) and
d3d12_xdxr_rt_test reads the size the same way.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 11:30:53 -05:00
14f7cce13f SHADER-337: texel-offset y and z fields measured on RDNA2 (signed 6-bit, upper bits ignored)
tools/texoff_probe.py samples a linear R32_SFLOAT texture whose texel holds its index (2D 64x64 for y, 3D 64x1x64
for z) with image_sample_lz_o through tools/hw_oracle on gfx1036, wave32 and wave64. All 15 rows fit the
translator's rule. tests/test_texoff_probe.py checks that each row with a negative field tells signed from unsigned.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:30:13 +01:00
7e7275915c MoltenVK: size the bindless set by its update-after-bind limits, not its layout-support answer
MoltenVK's vkGetDescriptorSetLayoutSupport compares every layout with maxPerSetDescriptors (1212, the limit without
argument buffers) and rejects even 1212 itself, although it creates and samples a 65536-image, 4096-sampler
update-after-bind set correctly (native repro; d3d12_descriptor_test under Wine with the set grown). On MoltenVK the
D3D12 device no longer asks it: size_bindings' per-type update-after-bind limits, which MoltenVK takes from Metal's
argument-buffer limits, decide, and the set grows to 65536 2D images and 4096 samplers on an M3 Max.
2026-11-22 20:29:38 +04:00
06f36cec6b tools/salu_diff: add integer SALU ops and gfx1036 RDNA2 follow-up to #1746 (SHADER-137) 2026-11-22 19:29:38 +03:00
e9f3b7e34e SHADER-336: s_load/s_buffer_load with sOFF + IMM < 0 measured on RDNA2; a known sOFF no longer wraps at 32 bits
tools/smem_neg_probe.py runs the rows natively (tools/hw_oracle) on gfx1036, wave32 and wave64. s_load reads at the
64-bit signed sum, as the translator inferred. s_buffer_load does not wrap the sOFF + IMM sum at 32 bits: the
translator's register form already matched, but a sOFF known at translation time was folded and truncated to 32 bits
(sOFF 0xfffffffc + IMM 8 read +4). Both forms keep the 64-bit sum now; SmemHardwareRuleTests runs every row in both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 17:29:21 +01:00