diff options
| author | DANISBR1 <210478648+DaniSBR1@users.noreply.github.com> | 2026-11-21 21:38:58 -0600 |
|---|---|---|
| committer | DANISBR1 <210478648+DaniSBR1@users.noreply.github.com> | 2026-11-22 16:37:21 -0600 |
| commit | 1291a6878c0e2b34a8bb22edc820775c4407459e (patch) | |
| tree | 717f9ecfdeed3802a93476f55d05c7a90cda5498 /docs/testing.md | |
| parent | aa2988cc555bad7ecd508b48a702adbb32fe7c95 (diff) | |
GPU tests: raw barycentrics under perspective (ps_persp_bary, vs_persp)
The raw-barycentric tests draw with vs_ids, where clip w = 1 at every vertex, so nothing checked that the raw
i/j (and the attributes) follow perspective-correct weights. vs_persp draws one triangle at screen (5,8),
(57,16), (21,55) with clip w = 1, 2, 4 and per-vertex attr0; ps_persp_bary is ps_bary's code drawn with it.
check.py's bary_persp_problem compares every pixel with CPU weights p_k = (l_k / w_k) / sum(l_m / w_m) from the
screen-space weights l_k, checks that pixels outside stay clear, and requires the affine weights to differ by
more than 100x the tolerance on every judged pixel, so a NoPerspective regression can't pass. run_gpu_tests.py
uses the same reference (PIXEL_VS, DRAWN_WITH). Suggested by Vonsek in #794.
On main it runs the native BaryCoordKHR path (it skips without VK_KHR_fragment_shader_barycentric, like
ps_bary); any barycentric fallback that lands (#804) is exercised by it too. Checked on an RX 5700 XT (RADV)
through a GS fallback: passes at wave32 and wave64; with NoPerspective on the fallback's input, all 1149
covered pixels fail while the interpolated attributes still match. New tests/test_bary_persp_oracle.py.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs/testing.md')
| -rw-r--r-- | docs/testing.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/testing.md b/docs/testing.md index fc695d014..824f987bd 100644 --- a/docs/testing.md +++ b/docs/testing.md | |||
| @@ -301,8 +301,8 @@ LEONIDA_BARY_FALLBACK=1 python -I scripts/run_gpu_tests.py --build runtime/build | |||
| 301 | With Mesa 25.2 (llvmpipe, LLVM 20) the first run passes 52 of 88 and skips 36, the second passes 37 of 39 and | 301 | With Mesa 25.2 (llvmpipe, LLVM 20) the first run passes 52 of 88 and skips 36, the second passes 37 of 39 and |
| 302 | skips 2. The skips are expected: llvmpipe has 8-wide subgroups (so every wave64 test skips without emulation, and | 302 | skips 2. The skips are expected: llvmpipe has 8-wide subgroups (so every wave64 test skips without emulation, and |
| 303 | the 32-lane tests `ps_bitmask_perm`, `cs_wqm_w32` and `cs_w32_lane_wrap` skip in both runs), no | 303 | the 32-lane tests `ps_bitmask_perm`, `cs_wqm_w32` and `cs_w32_lane_wrap` skip in both runs), no |
| 304 | `VK_KHR_fragment_shader_barycentric` (`ps_bary`, `ps_uniform_branch`, `ps_scc_mask32`) and no | 304 | `VK_KHR_fragment_shader_barycentric` (`ps_bary`, `ps_persp_bary`, `ps_uniform_branch`, `ps_scc_mask32`) and no |
| 305 | `VK_KHR_maintenance8` (`ps_texoff`). The third run draws those three barycentric tests through the fallback below | 305 | `VK_KHR_maintenance8` (`ps_texoff`). The third run draws those four barycentric tests through the fallback below |
| 306 | (with Mesa 26.0.8 it passes 123 of 189, the first run 120), and CI fails it unless every shader that got a fallback | 306 | (with Mesa 26.0.8 it passes 123 of 189, the first run 120), and CI fails it unless every shader that got a fallback |
| 307 | geometry shader passes. With | 307 | geometry shader passes. With |
| 308 | `LEONIDA_W64_EMULATE=1` the mesh tests abort inside llvmpipe's compiler ("LLVM ERROR: Cannot emit physreg copy | 308 | `LEONIDA_W64_EMULATE=1` the mesh tests abort inside llvmpipe's compiler ("LLVM ERROR: Cannot emit physreg copy |
| @@ -312,9 +312,9 @@ differences. | |||
| 312 | 312 | ||
| 313 | ## GPUs without fragment barycentrics (NVIDIA Volta, Pascal and older) | 313 | ## GPUs without fragment barycentrics (NVIDIA Volta, Pascal and older) |
| 314 | 314 | ||
| 315 | `ps_bary`, `ps_uniform_branch` and `ps_scc_mask32` read raw barycentrics, which need | 315 | `ps_bary`, `ps_persp_bary`, `ps_uniform_branch` and `ps_scc_mask32` read raw barycentrics, which need |
| 316 | `VK_KHR_fragment_shader_barycentric`. NVIDIA has it from Turing on; Volta (V100, Titan V) and older lack it, as do | 316 | `VK_KHR_fragment_shader_barycentric`. NVIDIA has it from Turing on; Volta (V100, Titan V) and older lack it, as do |
| 317 | llvmpipe and some other drivers. Where the device lacks it those three are skipped; that's expected, not a failure. | 317 | llvmpipe and some other drivers. Where the device lacks it those four are skipped; that's expected, not a failure. |
| 318 | To test the fallback that runs them anyway, set `LEONIDA_BARY_FALLBACK=1`, **for both `build.py` and `check.py`** | 318 | To test the fallback that runs them anyway, set `LEONIDA_BARY_FALLBACK=1`, **for both `build.py` and `check.py`** |
| 319 | (or for `run_gpu_tests.py`; CI does this on llvmpipe). The shaders are then translated with `--bary-fallback` and | 319 | (or for `run_gpu_tests.py`; CI does this on llvmpipe). The shaders are then translated with `--bary-fallback` and |
| 320 | drawn through a pass-through geometry shader that supplies the barycentrics (`docs/design.md`, "Barycentric | 320 | drawn through a pass-through geometry shader that supplies the barycentrics (`docs/design.md`, "Barycentric |