diff options
| author | Vonsek <45567075+Vonsek@users.noreply.github.com> | 2026-11-22 22:01:03 +0100 |
|---|---|---|
| committer | Vonsek <45567075+Vonsek@users.noreply.github.com> | 2026-11-22 22:01:03 +0100 |
| commit | 3a1ed28bebf374321149bc4bbffc005ea6f691c4 (patch) | |
| tree | 8884d5f8c45eef1e8f4d3a806790418de278ae55 /docs/testing.md | |
| parent | 0d58747e0da27dcb44b0127831260b763913fc2f (diff) | |
| parent | f847748cc76bd3777f9c070c4034eb2fc1c04e64 (diff) | |
Merge main into hw4-ps-formats (#3499)
docs/shader_validation.md
AI-assisted.
Diffstat (limited to 'docs/testing.md')
| -rw-r--r-- | docs/testing.md | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/docs/testing.md b/docs/testing.md index 060da9905..86e0ed328 100644 --- a/docs/testing.md +++ b/docs/testing.md | |||
| @@ -145,6 +145,15 @@ cmake --build runtime/build/windows --parallel | |||
| 145 | WINEPREFIX="$HOME/.local/share/leonida-wine" ctest --test-dir runtime/build/windows | 145 | WINEPREFIX="$HOME/.local/share/leonida-wine" ctest --test-dir runtime/build/windows |
| 146 | ``` | 146 | ``` |
| 147 | 147 | ||
| 148 | Use a recent xwin: 0.10.0 lays out SDK 10.0.26100 with the command above, while 0.6.5 stops with "unable to find | ||
| 149 | x86_64 headers for Win11SDK_10.0.26100". | ||
| 150 | |||
| 151 | On a machine without a display (a server, a container, WSL without WSLg), Wine has no graphics driver to create a | ||
| 152 | Vulkan instance with, so every Vulkan test fails with `vkCreateInstance failed (VkResult -3)` and, with | ||
| 153 | `WINEDEBUG=+vulkan`, "Failed to load Wine graphics driver supporting Vulkan". Run the tests under a virtual X server, | ||
| 154 | as CI does: `xvfb-run -a ctest --test-dir runtime/build/windows` (package `xvfb`). With Mesa installed, the tests | ||
| 155 | then run on llvmpipe. | ||
| 156 | |||
| 148 | The build type defaults to `RelWithDebInfo`: xwin leaves out the debug CRT, so `Debug` needs `--include-debug-libs`. | 157 | The build type defaults to `RelWithDebInfo`: xwin leaves out the debug CRT, so `Debug` needs `--include-debug-libs`. |
| 149 | `make_game.py`'s `runtime` stage makes this same build on Linux when the tools and the SDK are there (`--runtime-build | 158 | `make_game.py`'s `runtime` stage makes this same build on Linux when the tools and the SDK are there (`--runtime-build |
| 150 | runtime/build/windows` takes a folder made by hand like a Windows build). CMake packages are | 159 | runtime/build/windows` takes a folder made by hand like a Windows build). CMake packages are |
| @@ -206,6 +215,22 @@ Each line prints `ok`, a `SKIP` with its reason, or what differed. To add a fixt | |||
| 206 | 3. Add it to `EXPECT` in `tests/test_wave64_halves_fixtures.py` with the tier, reasons and idioms the translator | 215 | 3. Add it to `EXPECT` in `tests/test_wave64_halves_fixtures.py` with the tier, reasons and idioms the translator |
| 207 | should give it, and run `python -m pytest tests/test_wave64_halves_fixtures.py`. | 216 | should give it, and run `python -m pytest tests/test_wave64_halves_fixtures.py`. |
| 208 | 4. Run `w64_graphics.py` on a RADV GPU and say which GPU and Mesa version in the pull request. | 217 | 4. Run `w64_graphics.py` on a RADV GPU and say which GPU and Mesa version in the pull request. |
| 218 | ## GPUs with 128 bytes of push constants (AMD RDNA2 iGPUs on Windows, some Intel Arc drivers) | ||
| 219 | |||
| 220 | The translated shaders take 144 bytes of push constants: s0..s31, then the heap base and the code base. A device whose | ||
| 221 | `maxPushConstantsSize` is 128, Vulkan's minimum, can't take that, so the texture tests and every test drawn through | ||
| 222 | `vk_harness` skip there (`unsupported: need 144 push constant bytes, device has 128`); `vulkaninfo` shows the limit. | ||
| 223 | AMD's Windows driver reports 128 on RDNA2 iGPUs (Radeon 680M, 610M, the Ryzen 7000 iGPU); RADV reports more on the | ||
| 224 | same chips. | ||
| 225 | |||
| 226 | To run them anyway, set `LEONIDA_PC_TAIL_UBO=1` **for both `build.py` and `check.py`** (or for | ||
| 227 | `run_gpu_tests.py`). The shaders are then translated with `--pc-tail-ubo`: s0..s31 stay in 128 push-constant bytes, | ||
| 228 | and the heap base and code base move to a uniform block at set 1 (`docs/design.md`, "Push-constant tail as a uniform | ||
| 229 | block"), which `vk_compute_test`, `vk_store_test`, `vk_harness`, `vk_texture_test`, `vk_sampler_test` and | ||
| 230 | `vk_bindless_test` bind (`runtime/test/vk_pc_tail.h`). If you set it | ||
| 231 | only for `check.py`, the shaders read the tail from push constants the programs no longer declare. `--mesh-compute` | ||
| 232 | (`LEONIDA_MESH_COMPUTE=1`) isn't combined with it yet: its vertex shader still reads the output address from push | ||
| 233 | constants, so those tests skip. | ||
| 209 | 234 | ||
| 210 | ## GPUs without mesh shaders (NVIDIA Pascal and older) | 235 | ## GPUs without mesh shaders (NVIDIA Pascal and older) |
| 211 | 236 | ||
| @@ -307,6 +332,7 @@ The GPU tools of `runtime/test/shaders` (`vk_compute_test`, `vk_harness`, ...) r | |||
| 307 | 332 | ||
| 308 | | What you see | Cause | What to do | | 333 | | What you see | Cause | What to do | |
| 309 | |---|---|---| | 334 | |---|---|---| |
| 335 | | `ctest` passes but runs far fewer tests than expected (about 45 instead of 125 on Windows), no `d3d12_*` GPU tests, and `LEONIDA_D3D12=vulkan` does nothing | CMake found no Vulkan headers: `VULKAN_SDK` was not set in the environment that ran CMake (for example a user variable set after the terminal opened), and `CMakeCache.txt` keeps that failed lookup. The configure prints a `CMake Warning` "Vulkan headers not found" | Set `VULKAN_SDK` in that environment (or pass `-DLEONIDA_VULKAN_HEADERS_FETCH=ON`), delete `CMakeCache.txt` and configure again. `-DLEONIDA_REQUIRE_VULKAN=ON` makes this a configure error; CI and `scripts/build_runtime.ps1` (with `VULKAN_SDK` set) pass it | | ||
| 310 | | Windows refuses to start freshly built test programs ("An Application Control policy has blocked this file"), and the runner stops with a traceback | Smart App Control on Windows 11 | Turn Smart App Control off for the run | | 336 | | Windows refuses to start freshly built test programs ("An Application Control policy has blocked this file"), and the runner stops with a traceback | Smart App Control on Windows 11 | Turn Smart App Control off for the run | |
| 311 | | Validation errors without a VUID, or messages from a layer you didn't ask for | An implicit Vulkan layer from other software (Rockstar Social Club, ReShade, MangoHud, an overlay) | Set `VK_LOADER_LAYERS_DISABLE=~implicit~`. Overlays that hook the swapchain (RivaTuner `VK_LAYER_RTSS`, OBS `VK_LAYER_OBS_HOOK`) can stay loaded: see the next row | | 337 | | Validation errors without a VUID, or messages from a layer you didn't ask for | An implicit Vulkan layer from other software (Rockstar Social Club, ReShade, MangoHud, an overlay) | Set `VK_LOADER_LAYERS_DISABLE=~implicit~`. Overlays that hook the swapchain (RivaTuner `VK_LAYER_RTSS`, OBS `VK_LAYER_OBS_HOOK`) can stay loaded: see the next row | |
| 312 | | Validation errors that only your machine shows (e.g. `xbox_present`'s sRGB swapchain `STORAGE` message), with MSI Afterburner/RivaTuner or OBS installed | An overlay layer that hooks the swapchain: while RivaTuner Statistics Server is running, its `VK_LAYER_RTSS` adds `STORAGE` usage to it (OBS's `VK_LAYER_OBS_HOOK` injects `VK_IMAGE_USAGE_STORAGE_BIT` too). In an elevated (administrator) terminal the loader ignores `VK_LOADER_LAYERS_DISABLE` (`VK_LOADER_DEBUG=all` says so), so `~implicit~` leaves the layer in | Run the tests from a normal terminal, close the overlay application, or set the layer's own switch, which works elevated too: `DISABLE_RTSS_LAYER=1`, `DISABLE_VULKAN_OBS_CAPTURE=1` (OBS). Any other layer's switch is the `disable_environment` entry in its manifest (the JSON listed under `HKLM\SOFTWARE\Khronos\Vulkan\ImplicitLayers` or `HKCU\...`). `VK_LOADER_DEBUG=layer` prints the layers that were actually inserted | | 338 | | Validation errors that only your machine shows (e.g. `xbox_present`'s sRGB swapchain `STORAGE` message), with MSI Afterburner/RivaTuner or OBS installed | An overlay layer that hooks the swapchain: while RivaTuner Statistics Server is running, its `VK_LAYER_RTSS` adds `STORAGE` usage to it (OBS's `VK_LAYER_OBS_HOOK` injects `VK_IMAGE_USAGE_STORAGE_BIT` too). In an elevated (administrator) terminal the loader ignores `VK_LOADER_LAYERS_DISABLE` (`VK_LOADER_DEBUG=all` says so), so `~implicit~` leaves the layer in | Run the tests from a normal terminal, close the overlay application, or set the layer's own switch, which works elevated too: `DISABLE_RTSS_LAYER=1`, `DISABLE_VULKAN_OBS_CAPTURE=1` (OBS). Any other layer's switch is the `disable_environment` entry in its manifest (the JSON listed under `HKLM\SOFTWARE\Khronos\Vulkan\ImplicitLayers` or `HKCU\...`). `VK_LOADER_DEBUG=layer` prints the layers that were actually inserted | |