diff options
| author | whoalin1 <207920491+whoalin1@users.noreply.github.com> | 2026-11-22 17:42:20 +0200 |
|---|---|---|
| committer | whoalin1 <207920491+whoalin1@users.noreply.github.com> | 2026-11-22 18:48:05 +0200 |
| commit | 0ec464b0e11fb5c945cd7e9edba52d4cd330df7a (patch) | |
| tree | cced16a943ce8cb55785276ac2e3354bc3ac9398 /scripts | |
| parent | 8d89bfa6471a8a95d8ef65fa8b458dc4701129f6 (diff) | |
GPU tests: bind the --pc-tail-ubo block, so 128-byte push-constant devices run the tests
With LEONIDA_PC_TAIL_UBO=1, build.py and run_gpu_tests.py translate with --pc-tail-ubo, and the test
programs (vk_compute_test, vk_store_test, vk_harness, vk_texture_test, vk_sampler_test, vk_bindless_test)
declare and push 128 bytes and, when a stage declares set 1, bind the tail block there
(runtime/test/vk_pc_tail.h: a host-visible buffer with one slot per dispatch or draw, bound as a dynamic
uniform buffer). vk_harness refuses --mesh-compute with the flag (exit 77): mesh_compute_vs.py's vertex
shader still reads its address from push constants. Without the variable nothing changes.
Step 2 of the uniform-buffer tail claimed in #1902.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/run_gpu_tests.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/run_gpu_tests.py b/scripts/run_gpu_tests.py index 698ec36d0..b945aa83d 100644 --- a/scripts/run_gpu_tests.py +++ b/scripts/run_gpu_tests.py | |||
| @@ -292,6 +292,11 @@ def w64_emulated() -> bool: | |||
| 292 | # subgroup, matching check.py (W64_EMULATED). Accepts "1"/"true"/"yes"/"on" and tolerates | 292 | # subgroup, matching check.py (W64_EMULATED). Accepts "1"/"true"/"yes"/"on" and tolerates |
| 293 | # the trailing space cmd.exe's `set VAR=1 &` leaves in the value. | 293 | # the trailing space cmd.exe's `set VAR=1 &` leaves in the value. |
| 294 | return (os.environ.get("LEONIDA_W64_EMULATE") or "").strip().lower() in ("1", "true", "yes", "on") | 294 | return (os.environ.get("LEONIDA_W64_EMULATE") or "").strip().lower() in ("1", "true", "yes", "on") |
| 295 | def pc_tail_ubo() -> bool: | ||
| 296 | # LEONIDA_PC_TAIL_UBO=1: translate with --pc-tail-ubo (s0..s31 in 128 push-constant bytes, the tail in a uniform | ||
| 297 | # block at set 1), for devices whose maxPushConstantsSize is 128. The test programs read the same variable | ||
| 298 | # (runtime/test/vk_pc_tail.h) and bind the block; same accepted values as LEONIDA_W64_EMULATE. | ||
| 299 | return (os.environ.get("LEONIDA_PC_TAIL_UBO") or "").strip().lower() in ("1", "true", "yes", "on") | ||
| 295 | def wavemask_check(vk_compute: str, spv: str, env: dict | None, emulated: bool) -> tuple[bool | None, str]: | 300 | def wavemask_check(vk_compute: str, spv: str, env: dict | None, emulated: bool) -> tuple[bool | None, str]: |
| 296 | """cs_wavemask, as in check.py: (passed, detail), passed None for a skip. The native build needs a 64-wide | 301 | """cs_wavemask, as in check.py: (passed, detail), passed None for a skip. The native build needs a 64-wide |
| 297 | subgroup and skips where the device has none; with LEONIDA_W64_EMULATE=1 it was translated with | 302 | subgroup and skips where the device has none; with LEONIDA_W64_EMULATE=1 it was translated with |
| @@ -718,6 +723,8 @@ def run_suite(a, work: str) -> int: | |||
| 718 | cmd.append("--texel-offset-fallback") | 723 | cmd.append("--texel-offset-fallback") |
| 719 | if MESH_COMPUTE: # mesh shaders as compute writing to a buffer, drawn by tools/mesh_compute_vs.py | 724 | if MESH_COMPUTE: # mesh shaders as compute writing to a buffer, drawn by tools/mesh_compute_vs.py |
| 720 | cmd.append("--mesh-compute") | 725 | cmd.append("--mesh-compute") |
| 726 | if pc_tail_ubo(): # 128 push-constant bytes; heap base and code base from a uniform block at set 1 | ||
| 727 | cmd.append("--pc-tail-ubo") | ||
| 721 | if os.environ.get("LEONIDA_FMA") in ("glsl", "khr"): # fused multiply-add: GLSL Fma or OpFmaKHR (docs/design.md) | 728 | if os.environ.get("LEONIDA_FMA") in ("glsl", "khr"): # fused multiply-add: GLSL Fma or OpFmaKHR (docs/design.md) |
| 722 | cmd += ["--fma", os.environ["LEONIDA_FMA"]] | 729 | cmd += ["--fma", os.environ["LEONIDA_FMA"]] |
| 723 | rc, out = run_cmd(cmd, gpu=False) | 730 | rc, out = run_cmd(cmd, gpu=False) |