Commit Graph

12 Commits

Author SHA1 Message Date
9c09a6749b spirv_metal_set0: synthesize uint, retype helper calls, expand decoration groups, and capture spirv-as stderr (SHADER-METAL-SET0-FIX) 2026-11-24 16:32:44 +01:00
10ff86d5ea Merge pull request #4472 from leather147
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:15:03 -05:00
66d7cfadea spirv_metal_set0: retype aliases of resized descriptors
AI-assisted (Codex).
2026-11-23 04:37:40 +03:00
51a6feece1 Merge main into test-windows-nonascii
hw_oracle's vcvars script is fixed on main by #2667 (UTF-8 + chcp 65001), so this
branch takes main's runner.py and drops its own 8.3-name version. Two of main's
new hw_oracle tests decoded that UTF-8 script as ASCII, which fails when %TEMP%
holds a non-ASCII user name; they now decode it as UTF-8.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:28:03 +03:00
a9f7e3e9ab tests: pass the no-game Python tests on Windows with a non-ASCII profile path
Five tests that only the Linux CI runs fail on Windows:

- test_report_paths: the darwin patch kept Windows' os.path.normcase,
  which lowercases; use posixpath.normcase there too.
- test_audio_wav, test_audio_stage_resume: cmd.exe decodes the fake
  ffmpeg.cmd with the OEM code page, not UTF-8; write non-ASCII paths as
  their 8.3 short names, the file in the OEM code page.
- test_make_game_submodule, tools/spirv_metal_set0.py: text=True decodes
  UTF-8 child output with the ANSI code page and the reader thread dies;
  errors="replace".
- test_spirv_metal_set0_cli_errors: read the Python child's stderr in the
  locale encoding it writes, not UTF-8.

AI-assisted (Claude Code).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 22:01:03 +03:00
5d39742d0f Merge pull request #2370 from Vonsek 2026-11-22 13:14:19 -05:00
67a8fff932 fix(tools): order Metal array lengths after their integer type
The rewrite must preserve declaration-before-use when it adds sized arrays to SPIR-V modules whose uint type is declared late.
2026-11-22 17:49:03 +01:00
272678ef5a spirv_metal_set0: a missing or failing spirv-dis/spirv-as is one ERROR line, not a traceback
`spirv_metal_set0.py in.spv out.spv` ended in a traceback when spirv-dis
or spirv-as was not on PATH (FileNotFoundError) or rejected its input, such
as a missing or non-SPIR-V in.spv (CalledProcessError).

The command line now goes through cli(), which reports either as one line
and exit 1: the program, its exit status and the first line it wrote, or
the program that could not be started with a hint about PATH and
SPIRV_DIS / SPIRV_AS (Windows does not name the program in that error, so
_run() adds it). main() still raises as before; the existing tests that
call it are unchanged and pass.

tests/test_spirv_metal_set0_cli_errors.py needs no SPIRV-Tools: SPIRV_DIS
and SPIRV_AS point at the Python interpreter or at a missing path. All 7
tests fail on the tool as it was.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-22 11:08:41 -05:00
b0b0500d4e spirv_metal_set0: close header file and emit unique SSA IDs for aliased bindings 2026-11-22 15:29:22 +01:00
92f8b7c0c5 spirv tools: answer -h/--help with exit 0
spirv_gs_to_compute.py and spirv_metal_set0.py parse argv by hand, so
--help fell into the arity check and printed the usage line to stderr
with exit 2. Answer it with the usage on stdout and return 0, before
reading vulkan_bindless.h in spirv_metal_set0, and pin both with a test.
2026-11-22 21:10:18 +08:00
f698bf2206 tools: a path outside the console's code page no longer crashes a tool's output
On Windows a redirected stdout uses the console's ANSI code page, and python -I ignores PYTHONUTF8 and
PYTHONIOENCODING, so a caller path with a character outside that code page ended a run with
UnicodeEncodeError as soon as a tool printed it. #1406 fixed make_game.py; every CLI tool in tools/ now starts
its __main__ block the same way (stdout errors="replace").

tests/test_tool_stdout_encoding.py checks every tool's __main__ block and reruns two measured crashes
(analyze_4240_full.py, meshlet_page.py) with a private-use-named input. Found by @abilliontokens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:27:00 +00:00
93f81fd959 tools: spirv_metal_set0.py gives set 0 fixed Metal argument-buffer IDs (SHADER-161)
SPIRV-Cross 1.4.363.0 puts every runtime descriptor array of an argument
buffer at one ID and comments all but one out as "Overlapping binding", so a
native Metal shader can't reach set 0's images or samplers. The tool sizes the
runtime arrays from runtime/src/vulkan_bindless.h and moves each binding to
its own ID range, for spirv-cross --msl-decoration-binding. The Vulkan module
and layout are unchanged. All 17 set-0 test shaders convert with no overlap
and compile; cs_imgstore writes all 3x64 texels correctly in a native Metal
dispatch on an Apple A18 Pro.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:04:52 +03:00