Commit Graph

3 Commits

Author SHA1 Message Date
8dc07b3a4b d3d12, test: unify f16 halves linking helper and pass top_location in lazy stage_words (RT-LAZY-PIPELINE-F16-TOP-LOCATION)
Move per-pipeline f16 halves linking into a shared helper PipelineState::link_f16_halves
called by both eager create_graphics() and lazy stage_words() paths, always passing
device_.f16_half_top_location. Previously, stage_words() omitted top_location, causing
it to default to 29 and relocate outputs beyond the device limit on hardware where
maxVertexOutputComponents < 124 (e.g. top_location = 14 on 64-component limits).

Add f16_half_top_location to VulkanDeviceInfo (0 = read from device limits; non-zero =
override for testing low-limit devices).
Expose rt::d3d12::pipeline_stage_words() to allow inspecting linked lazy pipeline SPIR-V.
In runtime/test/d3d12_f16_halves_test.cpp, add low top_location = 14 tests verifying that
out-of-budget pipelines are rejected at CreateGraphicsPipelineState, in-budget pipelines
relocate within location 14 and execute correctly through the lazy path on first draw, and
explicitly verify that the linked SPIR-V stage modules' highest Location does not exceed 14.
Keep unit check #11 in runtime/test/spirv_f16_halves_test.cpp.

Tested:
- spirv_f16_halves_test (passed)
- python -I scripts/check_no_game_data.py runtime/shims/d3d12_com.h runtime/shims/d3d12_vulkan_device.cpp runtime/test/d3d12_f16_halves_test.cpp (clean)
No retail game data or keys.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-26 01:25:22 +03:00
c48a663a82 d3d12/spirv_f16_halves: fix linker fast-path, Private decorations, and device location budget
Fixes four bugs in --f16-interp-fallback per-pipeline linking:
1. link_f16_halves() no longer skips patching on its fast path when static
   VS/PS half locations exceed top_location or when an unused VS static half
   collides with a raw PS input location.
2. Demoting an unused VS static half Output variable to Private now strips
   all interface-only decorations (NoPerspective, Flat, Patch, Centroid,
   Sample, Invariant, Location, Component), avoiding invalid SPIR-V.
3. keep_ps_locs now preserves raw PS input locations (ps_raw_locs) when
   picking relocation slots.
4. CreateGraphicsPipelineState now runs link_f16_halves() when only VS
   declares f16_halves and derives top_location from the physical device's
   min(maxVertexOutputComponents, maxFragmentInputComponents) instead of
   hardcoding 29.

Adds regression tests (cases 6-10) and interface-only decoration validation
in runtime/test/spirv_f16_halves_test.cpp.

AI-assisted (Antigravity).
2026-11-23 23:18:39 +01:00
64b24f69fd SHADER-378: dynamic --f16-interp-fallback packing and per-pipeline SPIR-V half linking 2026-11-22 13:57:55 -03:00