Commit Graph

4696 Commits

Author SHA1 Message Date
3dce6425c7 bvh_builder_test: skip with a reason when the host D3D12 device has no ID3D12Device11 (#688)
The proxy answers ID3D12Device11 with a QueryInterface on the host device. The Windows 10 runtime without the Agility SDK stops before ID3D12Device11, on hardware and WARP alike, so the test failed on every Windows 10 machine with a game copy before the DLL made a call. It now prints SKIP with the reason there, as root_sig does since #597; LEONIDA_BVH_DEVICE=vulkan still runs.
2026-11-21 21:19:16 -05:00
eaeb73f466 Merge remote-tracking branch 'origin/main' into HEAD 2026-11-22 03:17:42 +01:00
6910e1cfef Merge origin/main into d3d-47-d24-emulation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 03:17:17 +01:00
00fef11ad2 fix(runtime): report unaligned BC texture support
The Vulkan path can sample a top-level mip with partial edge blocks, but callers querying OPTIONS8 receive E_INVALIDARG. Report the logical device's enabled BC feature so callers can select the matching upload path.
2026-11-22 03:16:34 +01:00
0e63a76da0 D24 conversion: predication, large copies, tests, spec note (review)
- A dispatch honours conditional rendering and the layer's copies do not, so a
  SetPredication that skips copies also skipped the D24 conversion while the
  copy ran. Conditional rendering is ended around the dispatch and begun
  again; a test runs an upload and readback under a skipping predicate and
  compares with the host's unpredicated run (it fails without the fix).
- A copy larger than maxStorageBufferRange (queried; 128 MiB assumed if not)
  is split into dispatches by slices, or by rows of one slice; the descriptors
  bind 256-byte-aligned windows of both buffers. depth24_convert_test splits
  the 4096x4096 copy with a 1 MiB range and a pitched one with a 1 KiB range.
- make_pipeline destroys the layouts it made when a later step fails.
- depth24_convert_test is in the CI tool list; the docs say which GPU each test
  exercises.
- R24G8_TYPELESS with a typed D24 DSV is compared with the host. SRVs of
  R24_UNORM_X8_TYPELESS and X24_TYPELESS_G8_UINT are an empty slot in the
  layer (no format mapping; stencil-plane views refused): reported by the
  test and documented as a known gap.
- depth24.h: the D3D11.3 spec's FLOAT -> UNORM wording (3.2.3.6, 3.2.2) next to
  what WARP and AMD were measured to do; "159" is 5215.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 03:15:13 +01:00
ce87bf7ede Merge upstream GPU runner coverage into the packed format fixture branch 2026-11-21 19:14:27 -07:00
54d3ea1a88 GPU test: s_barrier sites in different wave-uniform branches meet (SHADER-91)
cs_barrier_divergent: wave32, 128 threads. Wave 0 and waves 1-3 take different branches, each with its own s_barrier; on RDNA they count against the same workgroup barrier, so wave 0 reads what wave 3 wrote to LDS (out[i] = 127 - i). Registered in check.py and scripts/run_gpu_tests.py as a wave32 dump that doesn't need 32-lane subgroups.

Passes on an RTX 4070 Ti with the current translator; it guards the behaviour for any change to barrier handling.

AI-assisted.
2026-11-22 03:12:48 +01:00
21126810d6 Answer shader model and root signature feature queries
CheckFeatureSupport fell through to E_INVALIDARG for
D3D12_FEATURE_SHADER_MODEL and D3D12_FEATURE_ROOT_SIGNATURE, so a game
asking either got an error where the PC runtime answers. Report DXIL 1.0
and root signature 1.1, the versions this layer can honour rather than
the driver's maximum, clamp higher requests down, and refuse an undefined
value, a wrong DataSize and a null buffer, as the host runtime does.
2026-11-22 02:11:18 +00:00
cb6550fda5 Tests: the d_cl clamp sample draws on two mips, so its clamp shows
With one mip the clamp changed nothing. On the two-mip texture the clamp is 0 left of x = 32 and 1 from there on, so a clamp read from the f16 pad turns the left half cyan and a dropped clamp leaves the right half on mip 0.
2026-11-21 22:11:02 -04:00
b707035ca0 Tests: vk_texture_test enables shaderResourceMinLod for a MinLod clamp
A shader that declares MinLod (image_sample_d_cl) needs the feature, and without it the validation layer reports VUID-VkShaderModuleCreateInfo-pCode-08740. A device without it is now a skip (exit 77), as in the other texture tests.
2026-11-21 22:11:02 -04:00
bd880b85cc Tests: a16 bias, d_cl and depth compare samples on a GPU 2026-11-21 22:10:52 -04:00
8de6eb2875 Tests: vk_texture_test dref checks depth compare samples on a GPU 2026-11-21 22:10:21 -04:00
ad6bb01d06 GPU and value test for SHADER-46: s_ff0/s_ff1_i32_b32 of an immediate
The follow-up to #349 that the #374 coordination note asked for. #349
fixed s_ff0_i32_b32 reading an inline constant or literal as a lane mask;
this adds a hardware and interpreter check for it.

ps_sff_imm runs s_ff1_i32_b32 on the inline constant 4 and the literal
0x00100000, and s_ff0_i32_b32 on the inline constant 61 and the literal
0x0000ffff: 2, 1, 20, 16. Read as a lane mask (all ones or zero from bit
0) the two s_ff0 words are -1; the s_ff1 words guard the path that was
already right.

- runtime/test/shaders/ps_sff_imm.asm, with its expected words in
  check.py and run_gpu_tests.py
- the fixture (regen_fixtures.py) and a value test in
  tests/semantic/test_value_semantics.py that runs it through the
  interpreter, with an independent reference

AI-assisted (Claude Code). Tested on NVIDIA GeForce RTX 4060 Ti (subgroup
32), driver 32.0.16.2124, Windows 11: see the PR for the run on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 20:10:09 -06:00
3dde44ecb2 Merge current main and isolate the A8 and R8 view descriptors 2026-11-21 23:09:05 -03:00
86a1bfeac7 Merge pull request #694 from ismailchaka1 2026-11-21 21:08:42 -05:00
f68f8d5211 Merge pull request #686 from Tal Swicegood 2026-11-21 21:08:41 -05:00
69cb90ca32 Merge pull request #683 from Rafael 2026-11-21 21:08:40 -05:00
0f2cee0fdf Merge pull request #682 from Rafael 2026-11-21 21:08:40 -05:00
816a4e5c20 Merge pull request #678 from ismailchaka1 2026-11-21 21:08:40 -05:00
a3fc24f55d Merge pull request #675 from nicolas 2026-11-21 21:08:39 -05:00
1abfc432ad Merge pull request #668 from ismailchaka1 2026-11-21 21:08:37 -05:00
d8b3fd73ec Merge pull request #657 from dcastell1 2026-11-21 21:08:35 -05:00
460d23c335 Merge pull request #654 from AlxcBTW 2026-11-21 21:08:34 -05:00
720639adbf Merge pull request #639 from FJBP-code 2026-11-21 21:08:33 -05:00
36da56b1d9 Merge pull request #610 from AlxcBTW 2026-11-21 21:08:32 -05:00
89f19af545 chore: merge upstream 3D target and RGB9E5 coverage
Keep both packed and volume textures in the bindless readback test. Place the volume upload beyond the UINT texture so the RGB9E5 upload cannot overwrite its first depth slice.
2026-11-22 03:08:17 +01:00
6e1e5c5ce0 Refresh B5G5R5A1 sampling coverage after RGB9E5 support merged 2026-11-21 23:07:59 -03:00
4e1de429fd Runtime: add opt-in D3D12 call tracing 2026-11-22 03:07:36 +01:00
527e41c2d3 Runtime: report DXGI format plane counts through CheckFeatureSupport 2026-11-22 02:06:26 +00:00
e80485e24e Merge main into d3d-61-b4g4r4a4
The only conflict: block_format's two-byte list, where main added
R5G6B5_UNORM_PACK16 (#587) next to this PR's A4R4G4B4_UNORM_PACK16. Both kept.
2026-11-22 02:05:52 +00:00
762893fd60 Fix what the merge round broke
- rdna2spirv: restore f32_to_f16_int / pack_f16_pair_int, which #489's call sites need
- spirv_mini_interp: OpFDiv by zero is undefined, so refuse it again in the shared float branch
- test_run_gpu_tests: take the wave32 lane-dump list from check.py rather than restating it
- vulkan_replay: pass the ResourceBinding to round_trip in the clear path, as its new signature expects

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 21:03:38 -05:00
6d2303e0a7 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 03:02:50 +01:00
a71caa846f Merge remote-tracking branch 'origin/main' into bpw32-main
# Conflicts:
#	runtime/test/shaders/check.py
2026-11-22 03:02:48 +01:00
9b70afedb8 Runtime: B4G4R4A4_UNORM textures (D3D-61)
CreateCommittedResource refused DXGI_FORMAT_B4G4R4A4_UNORM. It now maps
to VK_FORMAT_A4R4G4B4_UNORM_PACK16: DXGI names channels from the low bits
up and Vulkan from the high bits down, so both have B in bits 0-3 and A
in 12-15. Vulkan 1.3 requires sampling it. Copies use two-byte texels,
and the shader-resource view is a 4_4_4_4_UNORM T#, which the GFX10
table already had.

d3d12_descriptor_test uploads an 8x8 texture with a different nibble in
every channel of every texel, checks the footprint (two-byte rows), and
samples it through set 0: all 64 texels match, each nibble n read as
n * 17.
2026-11-22 02:00:15 +00:00
ce43602adf runtime: build the tiny_dll fixture with /EHa under clang-cl
pe_loader_test's unwind check calls tiny_fault_caught(nullptr) and expects the image's own
__except to catch the access violation. The fault is a load inside that function's own __try:
MSVC always treats it as able to raise, clang-cl only with asynchronous exceptions, so under
clang-cl the fault escaped and the check failed although the loader had registered .pdata.

/EHa is added for Clang only, so the MSVC build is unchanged. With it, ctest passes 21/21 under
clang-cl (pe_loader failed before).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 22:54:40 -03:00
33059d6b63 D24_UNORM_S8_UINT byte-exact on GPUs without D24
The layer stores D24 as D32_SFLOAT_S8_UINT where the GPU has no D24 (the
Radeon 880M, AMD generally). Footprint copies of the depth plane now convert
through a compute pass: an upload turns the 24-bit words into the nearest
floats of d / 16777215, a readback quantises floats back (float multiply by
16777215, round to nearest even, as WARP and AMD's D3D12 driver do) and writes
0 in the unspecified top byte. Clears store the float of the quantised value,
so a texture reads back as D3D's quantisation of the clear value.

- src/depth24.h, vulkan_depth24.h, depth24_convert.comp (+ compiled SPIR-V):
  reference conversion, the converter (pipeline, scratch, descriptors freed
  once the submission completes) and the shader.
- vulkan_replay.h: depth24_as_float binding flag, convert jobs prepared with the
  list and run around the copy, depth clear value.
- depth24_convert_test: all 16777216 words to float and back, 16777216 float
  patterns against the reference, a pitched copy; d3d12_depth24_compare.h:
  5215 clear values (whole-view and rectangle) against the host.
- d3d12_copy_compare.h: the D24 case now compares upload and readback with the
  host instead of only the bit-preserving copies.

Depends on #610.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 02:53:51 +01:00
bc8e604cf4 Avoid descriptor table growth with a bounded slot relocation 2026-11-21 19:53:23 -06:00
12f1dc5a48 runtime: depth-stencil views of a multisample texture array's slice range (D3D-79 part 1)
CreateDepthStencilView refused D3D12_DSV_DIMENSION_TEXTURE2DMSARRAY, so the descriptor held an
empty TargetView and any clear through it failed when the list was recorded. Multisample textures
have one mip, so the view is {resource, mip 0, FirstArraySlice, ArraySize}; the replay already
checks the range against the image and clears through a view of those layers.

d3d12_vulkan_device_test: a 4-layer 4x multisampled D32 texture, a view of slices 1-2 captures
that range and its clear replays; a view of slices 3-4 is refused at execute
(invalid_subresource). D3D12 can't copy a multisampled texture to a buffer, so the cleared
values are not read back. Without the change the test fails at the captured-range check.

docs/d3d12_vulkan.md: drop the duplicated RTV/DSV bullet and list the new dimension. The 1D and
1D-array DSVs need 1D textures first (D3D-63, #561).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 22:51:42 -03:00
b74ebc5b6c runtime: compare the Xbox tiled layout word as an integer so clang-cl builds
create_reserved() declared `constexpr auto xbox_tiled = static_cast<D3D12_TEXTURE_LAYOUT>(0x101)`.
0x101 is outside D3D12_TEXTURE_LAYOUT's enumerators (the enum has no fixed underlying type), so the
cast is undefined in a constant expression. MSVC accepts it; clang-cl rejects it:

  error: constexpr variable 'xbox_tiled' must be initialized by a constant expression
  note: integer value 257 is outside the valid range of values [0, 3] for the enumeration type

Keep the word as a UINT and compare desc->Layout through a cast. Same behaviour; with this one
change the whole runtime builds with clang-cl 23 + lld-link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-21 22:51:10 -03:00
69e3be8bc5 Runtime: depth-plane shader-resource views of depth-stencil textures
R24_UNORM_X8_TYPELESS (D24S8) and R32_FLOAT_X8X24_TYPELESS (D32S8) views
were refused ("view format not supported for this texture: 46") and wrote
a null descriptor, so shadow maps and depth reads of these textures found
nothing. They now write a T# of the texture's own depth format
(8_24_UNORM, X24_8_32_FLOAT) with the depth in R, which set 0 views
through the depth aspect.

d3d12_descriptor_test checks both formats next to their stencil views:
same address, the depth format's code, R from X.

Depends on: #668
2026-11-22 01:49:06 +00:00
6b101b24e2 Fail pipeline checks when shader modules or pipelines fail 2026-11-21 18:46:11 -07:00
8cf0a8f6fc Run the packed 10:10:10:2 fixture in both GPU test suites 2026-11-21 18:46:06 -07:00
df9039e64d feat(runtime): bind single-sampled 3D texture SRVs
Volume depth belongs in the T# depth field, while its Vulkan view has a single array layer. Route matching descriptors through the existing 3D binding so a shader can select W slices and use a view-relative mip.
2026-11-22 02:45:57 +01:00
f165a13ff8 D3D-56: sweep all entries in wave-uniform cases and report unique keys 2026-11-22 02:45:53 +01:00
ed7e1ead05 D3D-61: keep alpha-only texture sampling distinct from R8 2026-11-21 22:44:35 -03:00
dd201e794e Runtime: shader-resource views of the stencil plane (D3D-75)
PlaneSlice 1 of a depth-stencil texture, viewed as X24_TYPELESS_G8_UINT
or X32_TYPELESS_G8X24_UINT, now writes an 8_UINT T# (the format of the
console's separate stencil surface) at the texture's address, with the
eight bits in G and R, B, A as 0, 0, 1, as D3D12 returns them. set 0
views it in the image's own format with the stencil aspect.

A plane past 1, plane 1 of a texture without stencil, or another view
format stays a null descriptor with a log. d3d12_descriptor_test decodes
both stencil formats and checks the refusals.
2026-11-22 01:44:24 +00:00
d7bceb8b9c Merge pull request #643 from Vonsek
# Conflicts:
#	docs/d3d12_vulkan.md
2026-11-21 20:39:05 -05:00
ff094ce885 Merge pull request #639 from FJBP-code 2026-11-21 20:39:03 -05:00
13d68c1358 Merge pull request #630 from 73N1X 2026-11-21 20:39:02 -05:00
c0a93d29f0 Merge pull request #628 from SirAmong 2026-11-21 20:39:01 -05:00