Commit Graph

4696 Commits

Author SHA1 Message Date
8c35079690 Merge pull request #1583 from Vonsek 2026-11-22 07:38:22 -05:00
df311d79b8 Merge pull request #1582 from Emirhan Karaca 2026-11-22 07:38:22 -05:00
afd77f314d Merge pull request #1581 from Gurvan 2026-11-22 07:38:22 -05:00
e99aecb5cc Merge pull request #1580 from Zebraine 2026-11-22 07:38:21 -05:00
01cde4562b Verify the exact tiny game exit code in runtime tests 2026-11-22 20:38:19 +08:00
0dd6bb051c Merge pull request #1569 from Vonsek 2026-11-22 07:38:16 -05:00
4717f13f7c Merge pull request #1565 from Vyral1978
# Conflicts:
#	docs/design.md
2026-11-22 07:38:15 -05:00
85520f2a64 Merge pull request #1560 from Instru Control 2026-11-22 07:38:12 -05:00
af665729d2 Merge pull request #1553 from quackottu 2026-11-22 07:38:09 -05:00
c7dfd34fda Merge pull request #1552 from Luiz Neves 2026-11-22 07:38:08 -05:00
41557027b6 Merge pull request #1551 from HQasper 2026-11-22 07:38:08 -05:00
d87b14012c Merge pull request #1545 from abilliontokens 2026-11-22 07:38:06 -05:00
f3e6d5a9b4 Merge pull request #1523 from AlxcBTW 2026-11-22 07:38:02 -05:00
11380bbbd6 Merge pull request #1511 from zneel 2026-11-22 07:38:00 -05:00
12eab0b570 Merge pull request #1489 from AlxcBTW 2026-11-22 07:38:00 -05:00
8bf46bd30e Merge pull request #1419 from Jan Trencansky 2026-11-22 07:37:55 -05:00
1cca596655 Merge pull request #1391 from Flyander 2026-11-22 07:37:55 -05:00
814e506179 Merge pull request #558 from omar-akermi 2026-11-22 07:37:53 -05:00
ce7e042e6e Merge pull request #495 from Aminecsmc 2026-11-22 07:37:52 -05:00
ac1529efee vk_texture_test: skip when the Vulkan environment is unavailable
The texture test only returned 77 when --two-mip was set; a normal run returned 1 for a missing physical device or graphics queue, and a missing loader or ICD also failed instead of skipping. Treat those unavailable-environment cases as the existing ctest skip (77) in every mode, while real shader or result failures still return 1.

Verified on Windows 11 with an RX 7900 XTX: the normal texture test passes after building the generated SPIR-V, and a forced no-ICD run returns 77. No game files.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-22 06:37:03 -06:00
1556d9c4db Merge main (99f99890) into d3d-51-command-list-rules
Conflicts in d3d12_com.cpp and d3d12_vulkan_device_test.cpp: both sides kept.

d3d12_debug_markers_test recorded two lists into one allocator at once, which
this branch rejects as the PC runtime does; its second list now has its own
allocator. The device-removed wording in the docs and the test matches main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:36:11 +01:00
7173782f05 GPU test cs_w32_new_ops: ops merged today with CPU-only checks
s_quadmask_b32/b64, s_bitreplicate_b64_b32, v_cvt_pknorm_i16/u16_f32,
ds_wrxchg2_rtn_b32 and the ds_nop / v_clrexcp no-ops were merged with
semantic tests only. cs_w32_new_ops.asm has lane 0 of a wave32 group
store one word of each; check.py and run_gpu_tests.py expect the eight
words (derived in the .asm header), so CI runs it on llvmpipe.

tests/semantic/test_new_ops_fixture.py runs the fixture on the CPU,
checks the words against values computed from the ISA definitions, and
that both GPU runners expect the same words.
2026-11-22 09:35:20 -03:00
444de13ca4 GPU test cs_w32_misc_ext: more ops that only had CPU checks
s_nand_b64, s_xnor_b64, v_cvt_pk_u16_u32, v_cvt_pk_i16_i32,
v_mad_u32_u16, v_mad_i32_i16, ds_cmpst_rtn_b32 and ds_write2_b64 /
ds_read2_b64 were added with semantic tests only. cs_w32_misc_ext.asm has
lane 0 of a wave32 group store one word of each; check.py and
run_gpu_tests.py expect the eight words (derived in the .asm header), so
CI runs it on llvmpipe.

tests/semantic/test_misc_ext_fixture.py runs the fixture on the CPU,
checks the words against values computed from the ISA definitions, and
that both GPU runners expect the same words.
2026-11-22 09:35:20 -03:00
d63d9c9a05 Merge origin/main into pso-subgroup-size-v2
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 13:34:03 +01:00
67c8ffe45c fix(shader): query dimensions from 2D array image views
Array resource queries need the array at the descriptor index so the third component reports the view's layer count. Check the returned dimensions through a draw against the existing 12-layer texture.
2026-11-22 13:33:58 +01:00
c083d09f19 dxgi: report swapchain frame statistics from the presenter
GetFrameStatistics returned E_NOTIMPL even though the swapchain already tracks successful presents. Record the QPC at each successful present and fill PresentCount, PresentRefreshCount, SyncRefreshCount and SyncQPCTime; failed and test presents still change nothing. The test checks the values and the null-argument error.

Verified on Windows 11 with an RX 7900 XTX: dxgi_swapchain passed with and without LEONIDA_VK_VALIDATION=1. No game files.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-22 06:33:56 -06:00
9f681772df Tests: skip ps_vcmpx_forms when fragment subgroups may run narrower than 32 (TEST-205)
On devices with minSubgroupSize under 32, vk_harness cannot pin fragment (#1318), so the
v_cmpx EXEC packing in ps_vcmpx_forms is not comparable to the 32-lane expectation.
2026-11-22 09:33:33 -03:00
f3977cac42 Merge main into test-184-image-ops
main is at 41f44826. Two conflicts, both sides kept:

- docs/design.md: both sides edited the one-line "Ray tracing" row. Main's
  row (the triangle node types and their vertex slots), with this branch's
  sentence about cs_bvh32 where it stood.
- tests/test_shader_checks.py: main counts ps_ssharp (9 -> 10) and patches
  sampler_test on the lines next to this branch's STORE_WORDS / GET_LOD_TESTS
  terms and its get_lod_test patch. All four lines.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 07:33:23 -05:00
c94ca41411 dxgi: answer swapchain GetDevice and GetFullscreenDesc
The swapchain kept the factory but discarded the device passed to CreateSwapChainForHwnd, so both IDXGIDeviceSubObject::GetDevice and IDXGISwapChain1::GetFullscreenDesc returned E_NOTIMPL. Hold that device (as native DXGI does), return it through QueryInterface, and describe the windowed swapchain with a zeroed fullscreen description and Windowed = TRUE. The swapchain test now checks both.

Verified on Windows 11 with an RX 7900 XTX: dxgi_swapchain passed with and without LEONIDA_VK_VALIDATION=1. No game files.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-22 06:32:44 -06:00
c2215fc635 vk_xdxr_build_test: a timing mode in device-local memory
`vk_xdxr_build_test <dir> <triangles>` times BLAS builds of random triangles
with the result and scratch in device-local memory; vk_test_device.h's
buffer() gives a device-local buffer when `mapped` is null.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:31:32 +01:00
c96a3427f8 shader_library: parse JSON numbers without floating-point from_chars
Apple's libc++ (Xcode Command Line Tools 17) does not provide the floating-point std::from_chars overload, so the runtime does not build on macOS. Parse the token with strtod instead, keeping the full-token and ERANGE checks so malformed or out-of-range JSON numbers are still refused. No game files.

Verified with shader_library_test on Windows/MSVC (1/1 and direct run).

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-22 06:31:04 -06:00
678c5c0b1e fix(test): synchronize texture framebuffer readback
Make the render pass expose its attachment writes and final layout transition to the copy that reads the frame. Matching pixels alone leave this hazard invisible on two drivers.
2026-11-22 13:30:08 +01:00
445f796eae fix(runtime): enable multisampled graphics pipelines (SampleDesc.Count > 1)
CreateGraphicsPipelineState previously rejected SampleDesc.Count > 1 with E_NOTIMPL and hardcoded rasterizationSamples = VK_SAMPLE_COUNT_1_BIT, even though multisampled render targets, RTVs and ResolveSubresource already work.

Validate power-of-two sample counts against the physical device's framebufferColorSampleCounts / framebufferDepthSampleCounts / framebufferStencilSampleCounts / framebufferNoAttachmentsSampleCounts limits, set VkPipelineMultisampleStateCreateInfo::rasterizationSamples from desc.SampleDesc.Count, and add a synthetic 4x MSAA draw + ResolveSubresource test in d3d12_draw_test with SampleMask = 0xFFFFFFFF and SampleMask = 0x5 (half-mask control).
2026-11-22 13:30:06 +01:00
b02e334962 Mark the binary occlusion test output host-readable 2026-11-22 15:59:55 +03:30
21a8e07168 Fix what the merge round broke: w64_graphics fixtures, the R24G8 FORMAT_SUPPORT check, four tools' stdout
- run_gpu_tests.py: #1541's wave64 pixel fixtures (runtime/test/shaders/w64_graphics.py FIXTURES, tiers A-C) are
  checked by that runner; run_gpu_tests picked up their .asm and failed 14 of them with "no checker defined".
  It now leaves w64_graphics.FIXTURES to that runner.
- d3d12_d24_support_test (#1493): expected DEPTH_STENCIL in FORMAT_SUPPORT for R24G8_TYPELESS. Measured here, the
  host D3D12 (RTX 4060 Ti and WARP) reports 0x001010b0 for R24G8_TYPELESS and 0x003110b0 (DEPTH_STENCIL) only for
  D24_UNORM_S8_UINT, which #1511's per-format rules follow; the check now expects the bit for the typed format only.
- fma_mix_probe, text_tables, wave64_halves, xdxr_bvh: new tools without #1428's stdout errors='replace' guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 07:29:31 -05:00
c5fb25f734 gta6rt: a failed write-open no longer revives a deleted GAME: name (RT-97)
write_target cleared the delete marker before the host CreateFileW ran, and copied a package file up
without looking at the marker, so a write-open of a deleted name could make it readable again: an
OPEN_EXISTING open succeeded on the copy-up, and one that failed left the marker gone with the package
file visible behind it.

The marker is now never removed, and a tombstoned name is never copied up. Reads and listings prefer an
overlay copy, so a re-created file is visible without clearing anything, while an open that keeps the
contents (OPEN_EXISTING, TRUNCATE_EXISTING) fails with ERROR_FILE_NOT_FOUND and leaves the name deleted.
file_system asserts that sequence: the failed write-open, no overlay copy, and the name still gone.

Review pass over the rest of the shim: Target loses the two fields nothing read, FindFirstFile no longer
parses its pattern twice, collect drops its unreachable non-console branch, and the enumeration states are
unique_ptr entries looked up under the lock instead of raw pointers handed out of it.
2026-11-22 13:29:20 +01:00
1cf3ca9211 Mark the overlapping occlusion test output host-readable 2026-11-22 15:58:49 +03:30
432d9ab1eb fix(runtime): support IBStripCutValue via dynamic primitive restart
CreateGraphicsPipelineState previously logged that index-buffer strip cuts (primitive restart) were not modelled and left primitiveRestartEnable disabled.

Load Vulkan 1.3 vkCmdSetPrimitiveRestartEnable in vulkan_backend.h, declare VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE on graphics pipelines, record IBStripCutValue on GraphicsPipeline, and enable primitive restart during replay only for indexed strip topologies whose index format matches the PSO strip-cut value (0xFFFF with UINT16, 0xFFFFFFFF with UINT32). Add synthetic 16-bit/32-bit triangle-strip cut and no-cut negative-control GPU draw tests in d3d12_draw_test.
2026-11-22 13:25:06 +01:00
7ec6e3ecfe d3d12 FORMAT_SUPPORT: depth formats are not UAVs
NVIDIA gives VK_FORMAT_D32_SFLOAT and D16_UNORM STORAGE_IMAGE, so the
layer reported typed UAVs (and now typed loads) for D32_FLOAT and
D16_UNORM on an RTX 3070 where native D3D12 reports none (found by
@Parakeet-Wheat, review by @Flyander). The depth cleanup clears the
typed-UAV bit and every Support2 bit, and the host comparison's depth
check now covers TYPED_UNORDERED_ACCESS_VIEW and Support2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:24:48 +01:00
eeb873355e Runtime: match GPU->HOST readback stages to depth24, rgb96 and buffer UAV clears 2026-11-22 15:23:54 +03:00
4852fe83e2 Report unconfigured retail runtime tests as skipped 2026-11-22 20:23:07 +08:00
17d0861c34 d3d12 FORMAT_SUPPORT: review fixes; the test catches over-claims
From two reviews of #1511:
- Depth formats drop TEXTURE1D: the layer refuses 1D depth-stencil
  resources (native D3D12 allows them).
- The depth MULTISAMPLE_RENDERTARGET query uses the same usages as
  MULTISAMPLE_QUALITY_LEVELS and resource creation.
- R9G9B9E5's emulated UAV reports typed load with store, like the rest.
- Comments and docs say what works today: typed UAV texture reads go
  through the sampled binding; typed buffer UAVs share the store side's
  gaps (no buffer UAV views, rdna2spirv FORMATS); R32_UINT atomics work
  on 2D UAVs only.
- compare_format_support only runs against a host on the same adapter,
  lists the formats the layer answers with no uses instead of skipping
  them silently, needs at least 40 compared formats, and checks
  over-claims: MIP and atomics the host lacks, atomics outside
  R32_UINT/R32_SINT, sampling integer formats, and multisample render
  targets that disagree with MULTISAMPLE_QUALITY_LEVELS. A layer with
  injected atomics, multisample and integer-sampling over-claims fails
  it with 128 mismatches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:23:02 +01:00
f2cf303237 SHADER-177: model computed I/J barycentrics (v0/v1 overwritten before v_interp) 2026-11-22 04:22:04 -08:00
cb33e81b04 Runtime: invalid-argument HRESULTs as the host runtime (D3D-49)
CreateCommittedResource, CreateDescriptorHeap, CreateCommandQueue, CreateFence
and Map now return the host PC runtime's HRESULTs for invalid arguments.
compare_invalid_arguments in d3d12_vulkan_device_test checks the invalid
descriptions and their valid neighbours, plus ALLOW_RENDER_TARGET and
ALLOW_DEPTH_STENCIL on every format both devices create, against the host
device.

On main the new test found 25 mismatches in its first 55 cases (invalid
heap properties and flags, buffer layouts, upload/readback states, clear
values and texture flags accepted; two access violations, on a zero-width
buffer and a zero-size texture array), then the process died creating a
2049-layer texture. main also refused zero-descriptor heaps and answered
E_POINTER where the host treats a null output as a capability check.

CreateDescriptorHeap answers a null output before its flag, type and node
rules, as the host does; committed resources and fences check their
arguments first. A GPU_UPLOAD heap is refused, matching the layer's
OPTIONS16.GPUUploadHeapSupported FALSE; the test compares that case only on
a host without GPU upload heaps (Resizable BAR off).

CreateCommittedResource accepts a sample quality on a single-sampled texture
and the two standard MSAA patterns, as the host does.

The flag and format rules were measured on an RX 9070 XT, an integrated Radeon
GPU and WARP. Answers that differ between them, or that the layer can't follow,
are not compared and are listed in docs/d3d12_vulkan.md. Each new refusal is
logged once with its reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:19:56 +01:00
86f7e9f887 Runtime: build XDXR BVH4 acceleration structures on the GPU
The game's translated ray-tracing shaders read the console's BVH records
themselves (docs/d3d12_vulkan.md 4.8), so the layer has to write them. This
adds the GPU builder, checked against tools/xdxr_bvh.py:

- src/xdxr_build.comp: one pipeline, one dispatch per step. Triangle leaves
  (any of R32G32B32/R32G32 vertices, none/R16/R32 indices, a stride, an
  optional 3x4 transform) or 128-byte INSTANCE records with world-to-object
  inverses; Morton keys and a bitonic sort; BOX32 nodes four consecutive
  children at a time, level by level, with the parent table; the header.
  Buffer device addresses as uvec2: needs bufferDeviceAddress, not
  shaderInt64. NaN triangles, mask-0 instances, instances without a BLAS and
  singular transforms get empty boxes.
- src/xdxr_build.h: XdxrLayout (exact result and scratch sizes from the
  element count, for the prebuild info too) and XdxrBuilder (records the
  dispatches). A bias maps the application's 40-bit BLAS addresses to device
  addresses.
- test/vk_xdxr_build_test.cpp: nine synthetic cases built on the GPU and
  dumped; ctest `xdxr_build` + `xdxr_build_check`, which runs
  `tools/xdxr_bvh.py check-build`: validate, then trace 1000 rays per case
  against brute force.
- vk_test_device.h: opt-in bufferDeviceAddress (request_buffer_device_address,
  device_address()).
- tools/xdxr_bvh.py: check-build; trace takes the bias; instances without a
  BLAS and inactive triangles are valid.

Not wired to BuildRaytracingAccelerationStructure yet: that path builds a
VkAccelerationStructureKHR today (#743), and which one the layer uses is a
maintainer decision.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:19:18 +01:00
1a156425c7 Merge fork/m2-textured-draw into m3-synthetic-gate
# Conflicts:
#	scripts/run_gpu_tests.py
2026-11-22 13:18:51 +01:00
bf7014999a fix(runtime): enable VkSamplerReductionModeCreateInfo for MIN/MAX samplers
sampler_descriptor() already encodes D3D12_FILTER_REDUCTION_TYPE_MINIMUM and MAXIMUM into the S# filter_mode and gfx10_descriptors.h already provides vulkan_reduction_mode(), but bind_sampler() ignored it and logged that minimum/maximum samplers blend for now.

Enable Vulkan 1.2 samplerFilterMinmax in device creation and vk_test_device.h, chain VkSamplerReductionModeCreateInfo in bind_sampler() when supported and not combined with compareEnable (falling back to blend with a log otherwise), update docs/d3d12_vulkan.md, and add a synthetic 2x2 GPU sampling test in d3d12_descriptor_test comparing MINIMUM, MAXIMUM, and STANDARD (negative control) linear filters.
2026-11-22 13:18:40 +01:00
ec6645401d [TEST-200] Make M1 CTest skips accurate 2026-11-22 13:13:38 +01:00
84a0b02161 Test Vulkan swapchain retry after a surface query failure 2026-11-22 15:43:12 +03:30
b367783da5 Keep the Vulkan swapchain alive until preflight succeeds 2026-11-22 15:42:57 +03:30