Commit Graph

16 Commits

Author SHA1 Message Date
nmzik 7a7b39e9b9 shader cfg: canonicalize native loop structure
Trace the invalid SPIR-V emitted for the real 0x6c326400 and
0x090291ef00 compute shaders back to natural-loop construction. A guest
conditional could serve as both an OpLoopMerge and OpSelectionMerge
header, while multiple native latches could produce more than one SPIR-V
backedge for a loop.

Canonicalize those RDNA2 control-flow shapes before merge splitting:
- join multiple latches through one empty continue block
- put an internal guest-header selection behind an empty loop header
- rebuild CFG analyses after each bounded rewrite

This follows shadPS4's dedicated loop header/continue architecture
without introducing a dispatcher or compatibility fallback. Add focused
CFG and SPIR-V validation tests for both real failure shapes.

Validation:
- shader_cfg_tests --loop-canonicalization-only
- shader_cfg_tests --loop-break-merge-only
- shader_recompiler_compute_tests
- spirv-val Vulkan 1.1 for regenerated 0x6c326400 and 0x090291ef00
- launch.json runtime advanced continuously to frame 846 without fatal,
  crash, or Vulkan validation error

The no-argument CFG suite still exposes the independently reproducible,
loop-free cube descriptor identity failure in the concurrent dirty tree.
2026-08-02 03:15:26 +02:00
nmzik 0267f42b43 shader cfg: model direct loop control branches
Emit innermost break, continue, and repeat conditionals without selection
merges, matching SPIR-V structured-loop rules and shadPS4's control-flow
model. Split nested construct merges that would otherwise alias an outer
merge or continue target, using the full dominance-defined construct.

Add focused regressions for early loop control, nested local and nonlocal
exits, conditional latches, illegal mixed exits, and acyclic exit tails.

The focused suite passes embedded Vulkan 1.2 validation. The real
0x6c341200 compute shader now structurizes to 61 blocks and its dumped
98,650-word module passes standalone spirv-val.
2026-08-02 03:14:39 +02:00
nmzik d8a4c83cc7 format src and tests with clang-format 2026-07-31 11:36:12 +02:00
nmzik 68be13345a fix(shader): support multisampled depth image loads 2026-07-31 11:36:12 +02:00
nmzik 212282d693 fix(shader): preserve packed UINT16 MRT exports 2026-07-31 11:36:12 +02:00
Nikos 3b75a5659a shader: specialize cube image descriptors (#134)
* shader: specialize cube image descriptors

Track whether image descriptors refer to cube maps during resource specialization, and apply the coordinate offset conversion when sampling cube maps as 2D image arrays in SPIR-V emission.

* shader: fix cube array coordinate lowering

---------

Co-authored-by: nmzik <Nmzik@mail.ru>
2026-07-31 03:59:10 +02:00
nmzik a21d1aaa47 fix 2026-07-29 00:31:09 +02:00
nmzik a6b61d7aa0 refactor(graphics): split renderer and recompiler into focused modules 2026-07-29 00:30:24 +02:00
nmzik 7351eae117 graphics: add 1D image descriptor support 2026-07-27 14:10:51 +02:00
nmzik a20cf5d298 refactor renderer 2026-07-27 02:27:29 +02:00
nmzik 0a5f78c727 graphics: refactoring #2 2026-07-21 07:37:52 +02:00
nmzik 7905f2d12f graphics: migrate Vulkan backend to Vulkan-Hpp 2026-07-18 12:33:21 +02:00
nmzik da6cee924b Revert "Implement vertex swizzle"
This reverts commit f4b52cea2b.
2026-07-18 06:21:00 +02:00
nmzik f4b52cea2b Implement vertex swizzle 2026-07-18 03:36:09 +02:00
nmzik 0abe03af94 Support reverse RGBA16F render targets 2026-07-17 12:54:28 +02:00
nmzik 147188b143 Initial commit 2026-07-16 10:21:41 +02:00