Track bounded depth/stencil writes per depth snapshot cache entry so
fb_depth_snap blits only the dirty rectangles written since the previous
snapshot instead of copying the entire attachment on every game barrier
(see #3227).
Controlled by DM_NVN_FB_DEPTH_RECT via sw_mode (default 0; 1 enables, ab
alternates under DM_AB for matched-thermal/matched-upload testing before
enabling globally):
- Keys incremental state by root MTLTexture and MTLHeap plus
nvn_sparse_gen(), recording draw writes right before emission and
scissored depth-stencil clears in clear_ds_tri.
- Snaps dirty rects outward to 16-pixel tile boundaries and merges any
overlapping rects so Metal 4's concurrent copy encoder blits strictly
disjoint tiles (falling back to a single whole copy when multiple
rects cover at least 75% of the level).
- Skips the copy and keeps the render pass open when nothing wrote depth
since the previous snapshot.
- Enforces full-copy fallbacks for non-Load or layered passes,
enc_r_begin, MSAA resolveTexture, blits/uploads, heap aliases, sparse
pools/remaps, waiting clears, DM_NVN_FB_SNAP=all, point primitives
beyond scissor (bounded by scissor only), mesh-task draws, and
unbounded viewports.
- Adds GPU readback tests in dm/gfx/tests/t_feedback.m covering partial
tiles, overlapping merges, aliased serials, no-write skips, and all
full-copy fallbacks.
Co-authored-by: crt-000 <[email protected]>
Splatoon Raiders' Slosher airborne ink disappeared because its alpha-tested depth vertex shader reads attribute 12.W while the draw binds only attributes 0-9. Both the native vertex-descriptor fallback and the pulling vertex fetch returned (0, 0, 0, 0) instead of NVN/Maxwell's default float vector (0, 0, 0, 1.0) in raw register bits, dropping opacity to 0 and leaving the paired depth-EQUAL color pass empty.
Root-cause fix in both NVN vertex-fetch paths:
- nvn_mtl.m: store (0, 0, 0, 1.0) at offset 16 of slot 30's 64-byte vertex_constants buffer and bind absent attributes (!ka.fmt) there in pso_desc, keeping offset 0 (zeros) for inactive shadow inputs and unknown non-zero formats; keep non-zero formats in pull_layout_fill for streams without buffers so dm_fetch distinguishes them from absent attributes.
- dmsh_pull.metal: return uint4(0u, 0u, 0u, 0x3f800000u) for format 0 in dm_fetch and uint4(0u) for invalid or unmapped streams, regenerating dmsh_chain.h.
- Tests and docs: add t_default_attrib (float/uint/int absent attributes, unknown format, and shadow-input pipelines), extend t_pull, and record the finding in docs/reference/rendering.md, docs/agents/symptoms.md, and dm/games/0400380020056000/README.md.
Checked on Apple M6 (macOS 27.2.1): t_default_attrib (12/12), t_pull (454/454), t_pull_inv (6/6), t_vbuf (143/143 x2), t_float_pad (16/16), t_vin (14/14), test_dmsh_pull.py (8/8, macOS and iOS Metal compile), test_docs.py, test_nsp_chain.py, LLVM 23.1.4 clang-tidy (0 ratchet changes), Mac host build, and regress.py check on The Binding of Isaac: Rebirth (01009BC00C38A000, CHANGED on the expected 9 pulling variants, 19/19 shaders, 0 RED, 59.4 fps). Splatoon Raiders airborne ink was confirmed by the PR author on M4 MacBook Air (macOS 27.0.1); iOS gameplay remains unchecked.
Fixes#3181
Co-authored-by: kaz3tt <[email protected]>
A draw sampling its own attachment through a level or slice range got a new
Metal texture view at every draw (fb_prepare), retired after the
submission. Mip-chain passes do this at every level, every frame: Donkey
Kong Bananza's bloom and environment chains spent about 1 % of the replay
thread creating views.
fb_view makes the same view and keeps it in the texture's view cache
(vc_get), with a key marker that keeps it apart from a registration's own
views. VC_WAYS goes from 4 to 8, so a chain's per-level views do not evict
the registrations' views.
Tested by dm/gfx/tests/t_view_reuse.m (the same view found again, its own
view per level, never a registration's view, nothing cached for an
invalid or released texture). The reference entry is in
docs/reference/frame-rate.md, with a line in Donkey Kong Bananza's note;
the view cache's entry in docs/reference/rendering.md now says 8.
Dual-source blending for NVN pixel shaders relied on per-game dual_want.tsv
lists to emit a separate main0_d entry point into <key>_b. Nine profiles had
accumulated 542 keys, and PR #2736 found 7 more /gamedata/nvn/branch_shader/*.fpo
shaders drawn only during FINAL FANTASY XII limit breaks (with 45 more .fpo
shaders still unlisted).
- dmsh_abi.h / dmsh_entry.py: add DMSH_TYPED_DUAL_FC (234, dm_du) to main0_u in
the lazily-loaded side library <key>_bx whenever colours 0 and 1 share a width
and every colour >= 1 is typed. With dm_du on, colour 1 is returned as
[[color(0), index(1)]] and colours 1..7 are absent, while the alpha test
(dm_at) still composes. Remove fs_dual and DUAL_WANT / dual_want.tsv handling
from dmsh_build.py, dmsh_chain.py, dmsh_live.py, pack_app.py and
build_ipa_from_nsp.py.
- nvn_mtl.m: load entry_u_dual, route SRC1-blended pipelines through typed_fn
(ignoring integer target 0 in pso_reads_src1 where blending is disabled), mark
attachments 1..7 unwritten when dual_fn is active, simplify at_fn to fn only,
and remove fn_d and DM_NVN_DUAL_WANT.
- Profiles and docs: delete all 9 dual_want.tsv files, add PR #2736's iPhone Duo
validation and raw_shaders re-split bullets to FFXII's note, and update game
notes, reference docs, env_switches.tsv and symptoms.md.
Checked: unit/ABI/packaging/docs suites (test_dmsh_abi, test_dmsh_code_fp,
test_nsp_chain, test_shader_toolchain_cache, test_shader_rewrites,
test_game_profile, test_dmsh_pairs, test_nsp_mac_app, test_dmsh_typed,
test_dmsh_alpha, test_dmsh_logic, test_dmsh_side, test_dmsh_fetch, test_docs),
GPU replay (t_typed_outputs on Metal 4 and DM_PSO_MTL4=0, t_alpha, and
t_missing_src1's dual-source checks), all 72 FFXII branch_shader/*.fpo shaders
built for Mac and iOS (72/72 entry_u_dual + entry_u_side, 0 lost), and
regress.py check on The Binding of Isaac: Rebirth (PASS).
Front-ends: break: shader libraries must be rebuilt for chain b94eb3685250.
Co-authored-by: Gabriel Tran <[email protected]>
Promote legacy desktop GLSL (#version 110/120/130) to #version 450 core in gl_shaders.py and rewrite texture3D/texture3DLod/texture3DProj so desktop implicit int-to-float conversions and sampler3D translate cleanly. Record explicit sampler layout(binding = N) units on GL shader table rows and initialize u->unit from them in glLinkProgram while leaving unqualified samplers at unit 0. Implement GL_TEXTURE_SWIZZLE_RGBA in glTexParameteriv/glTexParameterfv.
In profile_guess.py and build_ipa_from_nsp.py, stop suppressing DM_GL_CAPTURE when main embeds GLSL strings alone or the RomFS contains non-standalone .glsl snippets, honor gl_capture.tsv/vk_capture.tsv when present, and fall back to Mac GL capture when offline translation yields no RomFS shaders.
Verified with 121 Python unit/invariant tests, Mac host build, and Metal GPU readback tests (gl-imports with MTL_DEBUG_LAYER=1 on Apple M6). Addresses #3021 and incorporates findings from PR #2034.
Co-authored-by: Cloud <[email protected]>
Co-authored-by: Ali <[email protected]>
Implement mismatched-size multisample nvnCommandBufferDownsample in
copy_t2t_enc (DM_COPY_RESOLVE): when a multisample source resolves into a
single-sample destination of the same pixel format with different mip-level
dimensions (such as Digimon Story Time Stranger's 1920x1080 4x -> 1280x720 1x
handheld resolve), resolve into a 4-slot cached private staging texture
matching the source level and blit the common (0, 0) corner unscaled into the
destination. Add 16x12 4x -> 8x6 1x and 8x6 4x -> 16x12 1x checks to
t_tiled_resolve.
Add the repository profile for Digimon Story Time Stranger (010062E01FE0C000,
update 1.2.2 / v262144) with stdalloc_cap 0xc0000000 (avoiding the provisional
1 GB title-load OOM), depth_mode zero, base+update shader tables (19,280
shaders, 6,047 pairs), zero rewriter cuts, game note, and updated docs.
Refs #872
Co-authored-by: RikyXerez <[email protected]>
geo_mesh_draw passes a synthetic VS/FS-only raster program and di = NULL
into draw(), so draw_()'s ubd_conflict cannot see the lean geometry
kernel's stage-2 bindings or an indexed draw's index buffer.
Check ubd_conflict_sh(lean, 2) and any indexed draw's di->ibuf range
before encoding the mesh draw, landing conflicting inline updates while
preserving shadow deferral for non-conflicting and shadowable stage-2
uniform reads.
Extend check_t_geometry_mesh with inline updates targeting both stage-2
storage counters and indexed mesh draw index buffers, and document the
dependency rule in docs/reference/rendering.md.
Refs #1314
Co-authored-by: Eliran Zach <[email protected]>
Replace the direct-mapped running-write page tables with 128-byte-aligned
7-way set-associative tables and a separate per-set over_fence so 2-page
hash collisions no longer collapse a slot to ~0ull and latch it across
subsequent single-page writes while GPU work stays in flight.
Merge g_gw into g_gwx plus a g_um page check (um_page_live), shrink g_gwr
to a 1,024-set fast-reject filter for the 4,096-entry report ring, grow
g_sbwp/g_sbw_list dynamically at <=50% load from 16,384 slots, and widen
SBW_WN to 256 so high-draw scenes with thousands of writable storage
buffers do not set g_sbw_over/g_gw_all and taint conditional renders or
partial uniform shadows.
Fixes#2699
Co-authored-by: LZ <[email protected]>
Record the Mario Kart World replay and completion stacks, the
current lock split, and how to collect device diagnostics.
Refs #2098
Co-authored-by: Oliver Ames <[email protected]>
Explain how to recover saved spindump stacks and document the effect of
removing fragment ordering in the diagnostic build. Record the six
observed save slots and the caption.sav layout for the tested build.
Refs #3106, #2658
Co-authored-by: David Padron-Harris <[email protected]>
Co-authored-by: Dawn <[email protected]>
Select a cached sRGB view of each window image when GL_FRAMEBUFFER_SRGB
is enabled. Present and read back the stored bytes through the raw view.
Cover the default framebuffer with pixel tests for clears, draws and
blending, including the transition between conversion states.
Refs #2416
Co-authored-by: Guilherme Reis <[email protected]>
Register the Switch update's profile and use the existing EGL backend. Add
integer attributes and texture formats, timestamp queries, multiple draw
and read buffers, and the atlas copy and readback paths it calls. Translate
samplerBuffer to native Metal texture buffers so terrain masks read the
bound buffer correctly.
Verify the first tutorial on an Apple M6 at 1080p, build and CRC-check the
unsigned IPA, and cover the shared OpenGL paths with Metal validation and
a DOOM 3 quick baseline comparison.
- Implement glGetShaderSource in dm/gfx/gl/hle_gl.m with SP_CHECK, negative-size GL_INVALID_VALUE, NULL-buffer/zero-size guards, and spec-accurate GL_SHADER_SOURCE_LENGTH for empty shaders.
- Read nn::oe::GetDisplayVersion directly from control.nacp (+0x3060) via shared dm_control_read in hle.h (falling back to profile build rows when control.nacp is absent) and preserve raw NACP display versions (such as '1.0.2 b723') in nacp.display_version() and build_ipa_from_nsp.py surveys/derived profiles while keeping Apple bundle versions numeric. This fixes Fate/hollow ataraxia REMASTERED's savedata version gate (723 >= 438 instead of truncated 2 < 438) with zero game-specific patches.
- Add the Fate/hollow ataraxia REMASTERED (010070E022546000) game profile with its 78-shader gl_capture.tsv list, unit tests, and reference documentation.
Fixes#2930
Co-authored-by: Beeven <[email protected]>
The SPIRV-Cross layout includes declarations the shader never reads.
Tomb Raider 1.1.4 got a valid location for an unused joint array and
passed a null source to glUniform4fv during startup.
Use glslang's active-uniform reflection for the default block's exposed
names. Keep the Metal buffer size, offsets and strides from SPIRV-Cross.
On an M4 Pro, Tomb Raider rebuilt all 131 shaders and rendered past
1,200 frames with GL stubs off. The reflection test, GPU GL suites,
Python lint and docs checks passed. Well Dweller's full regression run
built all 93 shaders, with changes limited to reflection metadata.
Refs #2416. The format query and further gameplay validation are open.
Co-authored-by: Guilherme Reis <[email protected]>
The host tracked GL_FRAMEBUFFER_SRGB without using it for Metal
attachments. With conversion disabled, clearing red to 0.25 stored
137 where OpenGL expects 64.
Use a cached linear view of the same storage while conversion is
disabled. Finish pending work before switching formats and discard
cached views when storage changes. Texture sampling keeps sRGB decoding.
On an M4 Pro, the 54 pixel checks and the CPU and GPU GL import suites
pass. The fixture catches stale texture and renderbuffer views and
sampling through the linear view. The full Well Dweller regression
comparison passes.
Addresses the framebuffer conversion reported in #2416. The remaining
Tomb Raider failures are still open.
Co-authored-by: Eliran Zach <[email protected]>
nvnCommandBufferSetDepthBounds was an empty implementation, and the
Vulkan layer reported depthBoundsTestEnable and vkCmdSetDepthBounds as
unimplemented. Metal has a depth bounds test on Apple10 GPUs and later
(setDepthTestMinBound:maxBound:).
- nvn_dbnd.h: one resolver for both layers: off, bounds to test, or
bounds no stored depth meets (min above max, out of range, NaN).
- NVN: SetDepthBounds is recorded as OP_DEPTH_BOUNDS (capture op 64)
and kept in the replay state; draw_ sends the bounds to the encoder,
direct or deferred (RO_R_DBND), only on a pass with a depth
attachment, skips draws whose bounds pass nothing, and an in-pass
clear triangle turns the test off. The op is carried through the
deferred unbind, the compute hoist, the same-target scan and the
load/clear scan. Depth-writing draws with bounds leave mesh runs.
- Vulkan: static pipeline bounds and VK_DYNAMIC_STATE_DEPTH_BOUNDS /
vkCmdSetDepthBounds, reset when a pass is opened or reopened.
- GPUs below Apple10 ignore the bounds, as before, with an
informational line. DM_NVN_DEPTH_BOUNDS=0 turns the test off; ab
alternates with DM_AB.
Measured on an Apple M6 (Apple11 GPU): Breath of the Wild (Great
Plateau, 5,700 frames), Tears of the Kingdom (opening cave, 5,700
frames) and Pokemon Scarlet (outdoors, 2,400 frames) call SetDepthBounds
23 to 67 times a frame, every call with the test off and (0, 1): no draw
was tested, no GPU time changed on those routes.
Checks: t_depth_bounds (new, 85 checks under the Metal validation
layer, encode thread off and on: pixels passed and rejected on the GPU),
t_capture, t_vk_desc, t_geometry_mesh, t_registration; regress.py check
--quick on Hades: PASS.
Ported from PR #2866 (kencalx/NX18).
Co-authored-by: Oliver Ames <[email protected]>
Co-authored-by: kenCalx <[email protected]>
South Park's UI binds a 4 MiB range from successive offsets into the
vertex pool. The full-range lookup skipped indexed draws whose fetches
were mapped, hiding the loading indicator and flickering at the title.
Prove the needed range from the direct draw's CPU-readable indices
and base vertex after the full lookup fails. Leave ranges with pending
writes or unproven bounds rejected. Use the same proof for pulling.
The Mac title went from 504 dark frames out of 600 to zero. The Metal
vertex binding and pulling tests pass, and The Binding of Isaac:
Rebirth passes its quick NVN regression.
Follow-up to PR #843.
Register update 1.05 and its 4,614 shaders. Decode bare-zlib Snowdrop
caches and verify their block sizes. Match the compact Snowdrop
allocator across the base and update, and match the older SDK's
allocator functions across their reviewed implementations.
The memory changes work around the iPhone alias limit. The Mac build
reaches character creation with the preview and all six supplied DLC
licenses. The unsigned iOS build matches its separate RomFS image.
Kingdom Battle reaches language selection with identical shader output.
Co-authored-by: Nuno Ferreira <[email protected]>
Co-authored-by: Ishtiaq Ul Haq Syed <[email protected]>
The kept vertex conversion copied the source edges into an unchecked
allocation. Allocate the edge copy before write-protecting the source.
If allocation fails, let the caller convert into the frame arena and
retry the cache on the next submission.
On an M4 Pro, t_vconv_keep and a forced allocation failure verified
the retry, the conversion contents, and that failure leaves the
source pages writable.
Co-authored-by: Oliver Ames <[email protected]>
Co-authored-by: kenCalx <[email protected]>
A partial archive write could hold the Metal serialization gate while a
windowed game needed a new pipeline. The host keeps serialization apart
from compilation because overlapping them can crash Metal.
Let the windowed timer claim the gate only when no frame was presented
in the last ten seconds and no compile is running. Keep the capture
period in place until it can be written immediately. Headless timers,
full periods, and explicit saves use the existing flush path.
The timer fixture reproduces a write after presentation resumes on the
original PR and passes 24 checks on the revision. The archive suite,
documentation tests, changed-file clang-tidy, and full Cuphead regression
passed on an M4 Pro with Xcode 27.2. The original Mario Kart World v1.0
benchmark on M3 Max saw the longest frames after ten seconds fall from
1,340 and 1,609 ms to 158 and 91 ms.
Co-authored-by: Arthur tinseau <[email protected]>
Fate/stay night REMASTERED disables legacy lights and texture-coordinate
generators while setting up its GLSL renderer. The host logged five red
lines even though those disables had no rendering effect.
Ignore disables for lights 0 through 7, texture-coordinate generation,
colour material and normal normalization, as the host already does for
lighting and fog. Keep the missing-support warning when a game enables
one of those capabilities.
The GL import test captures the log for all 14 capabilities and checks
the supported alpha-test and blend state. It fails with the old host
code and with the enable warning suppressed. GPU and CPU modes passed
with stubs on and off on an M4 Pro, along with the docs and targeted
lint checks. The contributor's Fate run went from five red lines to
zero on an M4 MacBook Air.
Co-authored-by: KingProNoob2 <[email protected]>
The Metal device calls can abort on missing required functions before
returning a pipeline error. Return that error at the host boundary for
a missing vertex function or a missing native mesh or mesh fragment
function. Depth-only classic rendering can still omit its fragment
function, and a native mesh pipeline can omit its object function.
Tested with the Ocarina of Time profile on macOS 27.2.1. Pipeline
warmup passed in both Metal modes, the archive and compiler-death
checks passed, and all eight admission modes passed. The separate
assertion inside Apple's archive lookup remains open in #2825.
Co-authored-by: Manuel Pérez Mayol <[email protected]>
Witcher 3.7 records its histogram clear and fill without a barrier.
Replaying its shaders on Metal 4 lost histogram counts. One wait
before the fill preserved every count across 800 runs.
Add the verified NSO stub as an opt-in patch for the 3.7 provisional
profile. On the stock Mac host, the patched game records the wait
before filling and retains its existing wait before reducing.
Issue #3048 remains open for the 4.04 builds.
Co-authored-by: nsklaus <[email protected]>
Single-stage graphics programs bound with all graphics bits (e.g. Little Busters!
Converted Edition calling BindProgram(vs, 0x1f) then BindProgram(ps, 0x1f)) had
the pixel bind replace S.bst[0] with a program that has no vertex shader,
dropping every draw in pso_get_ to a black screen.
Track each program's stage bits in NvProg.stages (including distinct bits for
NVN2 mesh in slot 4 and unresolved stages) and query them lazily in bind_stages
via prog_stage_mask without triggering prog_get/shader_get during command
replay or lookahead scans. Clear bit 0 only for non-null graphics programs that
carry another graphics stage, neither a vertex nor an NVN2 mesh shader, and no
unresolved stages. Fragment, geometry, tessellation, NVN2 mesh, compute-only,
partially unmapped and NULL binds keep updating or unbinding every bit they
name (verified against live audits on Xenoblade Chronicles 2, Mario Kart World
and Ocarina of Time).
Add CPU-only ASan/UBSan unit test dm/gfx/tests/t_bind_stages.m and wire it into
CI.
Co-authored-by: lasscat <[email protected]>
Register builds 1.0.0 and 1.0.3 with 386 shader keys, 187 cover pairs and 12 compute facts. Document the verified SDK crash-report call path, general GPU fixes and current validation separately from historical contributor results.
Mac match loading and the corrected controller glyph were user-tested on M6. All 386 libraries build for Mac/iOS and the unsigned IPA builds. There are 125 passing Python/docs checks and 75 oe checks; C lint has no new findings.
Isaac and Catherine reach their frame targets with unchanged shaders and no new red-log categories. Their raw screenshot gates remain REGRESSION, reproduced by identical-main controls (random rooms and different movie progress). Existing allocation and Python-lint findings remain documented. Match-end and iOS/M1 device retests remain unverified.
Co-authored-by: ZZG <[email protected]>
Partial vkCmdClearAttachments commands previously returned without changing
any pixels. Keep the whole-attachment load-action fast path and draw the
host's precompiled clear triangle in load/store passes for partial regions.
Preserve typed values, view-relative mip/layer selection, other attachments
and depth/stencil aspects, game state and command order. Accumulate Metal
visibility results so earlier encoder slots survive a resumed pass.
Pass 18 focused GPU cases under Metal validation, 12 integer-clear checks,
51 Vulkan command checks, RenderDragon GPU checks and six documentation
tests on Apple M6. The full Hades regression against 8a06d255 passes both
95-second routes with 74 unchanged shaders and no new red diagnostics:
59.8 to 59.9 fps and 2,227 to 2,234 MB peak, within tolerance.
Document the distinction between the proven API defect and Minecraft's
observed full clears: the unmodified menu-to-world route reached 30,900
frames without an unsupported-clear diagnostic. No additional Minecraft
gameplay qualification is pending for this API fix; iOS is untested.
Follow up the RenderDragon bring-up from PR #1652.
Co-authored-by: Aoba_d1snet <[email protected]>
Register the 1.10.0 update and its 98,315 base and update shader keys.
The build with 17 add-ons uses a derived shader profile and builds
all 99,299 shaders. The signed Mac app loads its bundled files, opens
a saved Episode IV game and runs with the Metal HUD enabled. The
opening corridor renders at about 30 fps on an M4 Pro.
Later chapters, co-op, and iOS gameplay remain untested.
Represent ADD with source ONE and destination ZERO for both color
and alpha as a direct write on float attachments. With blending
enabled, Skywalker Saga's packed-float bloom target held infinity
in all 90,400 texels. Direct writes gave all finite texels and the
Boarding Party corridor rendered on an M4 Pro. The lower-level
Metal trigger in the live pipeline remains open.
Metal blend tests and the Mario Kart World quick regression pass.
Skywalker Saga clears and reads its histogram through float image
arguments and accumulates through integer atomics. Bind matching
views over the same buffer to preserve the bits and coordinate bias.
The buffer image, image type, and sRGB image tests pass under Metal
validation on an M4 Pro.
Minecraft 1.26.62 has 198 ForwardPBR fragment shaders with 25-29 resource
entries. The host kept only 24, dropping 522 live sampler bindings and
leaving missing or stale sampler state at draw time.
Allocate each shader's complete resource list during table loading. Read
complete lines, retain the existing table grammar and legacy argument IDs,
and validate numeric fields and resource ranges. Reject an invalid row as
a whole rather than exposing a partially parsed shader through lookup.
Keep the resource lists for the loaded table's lifetime; draw loops and
shader assets are unchanged.
Pass 1,060 Vulkan checks under Metal validation, the RenderDragon GPU
checks, 55 Python tests and 35 sanitized loader checks on Apple M6. All
1,828 Minecraft shaders load all 13,857 entries without truncation. Rebuild
the Mac host and refresh the verified signed app.
The full Hades regression against b526a50b passes both 95-second runs:
74 unchanged shaders, 5,400 frames each and no new red-log categories.
FPS is 60.6 to 61.4; peak memory is 2,208 to 2,218 MB, within tolerance.
Minecraft ForwardPBR gameplay and iOS runtime remain unverified.
Found while following up the RenderDragon support from PR #1652.
Co-authored-by: Aoba_d1snet <[email protected]>
Fresh captures start without a packaged shader library. Compile each
missing GLSL stage with the same translator and Metal compiler used
for packing, and load its reflection and function for normal linking
and rendering. Reuse compiled stages within the capture run and stop
compiler children with the host.
Remove the uniform fallback from PR #1864. nsklaus identified the
MojoShader viewport-flip failure that blocked Timespinner's capture.
On Apple M6 with macOS 27.2.1, fresh captures matched all 14
Timespinner stages and all 66 DOOM 3 stages byte for byte. The full
DOOM 3 regression, Metal readback, and 161 Python tests passed.
Co-authored-by: nsklaus <[email protected]>
Trace Minecraft 1.26.62's remaining native vertex layouts and capability
writes. Every affected a_indices input binds R16_UINT; deferred layouts
copy the legacy format, while the debug and chunk paths have no affected
bone input. Record the construction and format mappings in the game note.
Repair the material's signed scalar input in SPIR-V before translation.
Load unsigned values and bitcast them under the original signed result IDs
so high-bit indices widen correctly and signed consumers remain intact.
Keep the original shader keys and remove the Metal variant and selector.
Build all 1,828 Mac shaders and validate the 133 repaired modules. Pass 55
focused tests and Metal-validation readback for 0x8000 and 0xffff on Apple
M6. Rebuild the host and refresh the signed Mac app. Gameplay was skipped
at the user's request; iOS remains untested. Existing ForwardPBR resource
limits and unrelated Python lint findings are unchanged. Preserve the
viewport lowering added on main; all 51 Vulkan command GPU checks pass,
and every Minecraft SPIR-V and selected Metal source matches the validated
build after rebasing.
Follow up the RenderDragon support from PR #1652.
Co-authored-by: Aoba_d1snet <[email protected]>
Promote GLSL 1.10 and 1.20 and lower the built-in varyings used by
MojoShader. Give programs without an executable uniform locations
only during explicit capture. Add the remaining GL entries FNA needs
and encode deferred clears before the framebuffer attachment changes.
Timespinner 1.0.0 captured and translated all 14 shaders and reached
the first playable scene on an Apple M6 Mac running macOS 27.2.1.
Focused Metal validation and the full DOOM 3 regression passed.
Co-authored-by: nsklaus <[email protected]>
Metal has no geometry stage. Re:ZERO's shadow shader forwards each
triangle unchanged and uses InstanceIndex to select a viewport. Prove
that behavior from the SPIR-V and select a vertex variant for matching
triangle-list pipelines. Replay static viewport and scissor arrays
and retain dynamic updates at their original indices.
All 41 Re:ZERO shader modules passed the Mac and iPhone builds. Both
shadow pipelines compiled during a Mac Metal-validation boot that
reached 600 frames without skipped draws or dispatches. The 991 GPU
checks and 66 Python tests passed. All 74 Hades shader outputs matched
main. Visible shadows in gameplay and iPhone runtime remain unverified.
Resolve named Vulkan functions after guest lookup, extract the embedded
RenderDragon SPIR-V, and replay the required commands on Metal. Preserve
transfer usage, regions and layers in blits and resolves. Use a material
shader variant for the scalar a_indices input only when its location is
bound as R16_UINT, so high-bit values survive the conversion to int.
Package and register update 1.26.62. Check unsigned high-bit inputs,
partial resolve, scaled blit, compute dispatch and query-result copies
under Metal validation. The Mac playtest reached a local world before
the actor fix. Hades passed its runtime smoke route and Sunshine's
Vulkan shaders matched main. iOS and other graphics modes are untested.
The named loader and materials work draws on PR #1652.
Co-authored-by: Aoba_d1snet <[email protected]>
Add the missing Vulkan commands and refuse a graphics pipeline when its
requested fragment shader cannot be built. Copy query results at the
recorded transfer and use the existing fan conversion for indirect draws.
Resolve the Metal prefix when replay needs results or GPU-written counts.
Translate compute workgroups and use native texel buffers. Keep push
constants separate by shader stage. Allocate nonoverlapping Metal argument
IDs and carry them alongside the original Vulkan bindings in the shader
table. Preserve the existing 1D image lowering and layout lifetimes.
Register the Mac-tested Re:ZERO 1.0.2 build (0100D800117F4000) without
executable patches. The revised build compiled 40 shaders for Mac and iOS.
The geometry stage and iPhone runtime remain open. All 1,645 focused GPU
checks and 76 Python tests passed. All 74 Hades shaders produced identical
Metal and resource tables. No further gameplay was run.
Reworks PR #1371 and PR #1539 for current main.
Co-authored-by: Lennart Kotzur <[email protected]>
The present queue waits on the event signaled by the OpenGL or Vulkan
renderer. An unscaled screenshot can read the texture on a separate
queue before that event, capturing stale pixels.
Wait for the presented frame's producer event once per captured frame.
Skip the capture when the event times out or the Metal readback fails.
A delayed producer made both screenshot request paths save black PNGs
on the baseline. Both returned the expected pixels with the fix.
UnMetal saved 86 captures with zero black images on each build on the
M4 Pro. The Metal present and crop suite passed on the rebased tree.
Co-authored-by: Oleh Khomei <[email protected]>
Use the sole reflected SPIR-V entry point, handle DXC push-constant type
names after SPIRV-Cross sanitizes them, and only build dual-source variants
for matching color outputs at locations 0 and 1. Keep the one-row 2D
lowering for Vulkan 1D textures. Recognize vkGetInstanceProcAddr as Vulkan
evidence when the RomFS carries SPIR-V and the imports exclude EGL and NVN.
On Re:ZERO 1.0.2 (0100D800117F4000), 2 of 41 modules translated before and
26 compiled for Mac Metal with this change. Seven stages are skipped and
eight modules still need argument buffers. Hades generated identical
MSL for all 74 shaders on the Apple M6. Synthetic tests and the Python
lint and docs checks cover the shared tooling.
Consolidates PR #1370 and the named Vulkan entry-point change from PR #2546.
Co-authored-by: Lennart Kotzur <[email protected]>
Co-authored-by: HenWorks <[email protected]>
UnMetal 1.2.0 uses EGL and OpenGL 1.x client arrays, matrices and
texture state. Use a built-in Metal program in contexts that support
fixed function when no guest program is bound. Detect fixed-function
games when packing and add the UnMetal profile.
Reject GL_TEXTURE_ENV_COLOR in scalar glTexEnvf and glTexEnvi before
reading any vector data. Keep RGBA handling in the vector entry points.
On the M4 Pro, a fresh game with subtitles off reached the first cell
after the full intro and again via the in-game skip. Document why
UnMetal presents black while out of focus during an unattended run.
Well Dweller passed its full regression route with all 93 shaders
unchanged. The focused OpenGL and Python checks passed.
Front-ends: new: UnMetal 1.2.0 is supported by the existing NSP build and launch flow.
Co-authored-by: Oleh Khomei <[email protected]>
Expose glGetActiveAttrib and GL_ACTIVE_ATTRIBUTE_MAX_LENGTH using the
linked program's vertex input table. Use the existing GL error flag and
preserve outputs on invalid input. Register the supported Slay the Spire
1.0 base build alongside its verification notes.
With the same v0 dump and shader library, main returned a null GL entry
and aborted. The revised host reached the Act I map from a fresh save
on an Apple M6. GL import and reflection tests pass in both stub modes.
Co-authored-by: Saveli Victor <[email protected]>
Slay the Spire 1.0 keeps glShaderSource in UTF-16LE. Count that encoding
under the existing EGL rule. Use the same RomFS reader for packing and
translation, and require a standalone shader of each stage in the same
directory before .vs and .fs files can suppress runtime capture.
Verified v0 on an Apple M6. Main classified it as NVN. The new packer
translated 14 RomFS files into 11 shaders without capture. Mega Man
Legacy Collection kept all 10 translations and identical MSL.
Co-authored-by: Saveli Victor <[email protected]>
On an M4 iPad Air, applying the setting at Play can miss Metal's
process-wide HUD initialization. Read the saved on choice before
UIApplicationMain, honoring explicit overrides and DM_SAVED_CHOICES=0.
If that saved choice enabled the process HUD, turning it off before
Play disables the overlay on the game layer.
Checked 16 launch and layer cases against main and ran 36 focused
tests. Both iOS sources compile for player and diagnostic builds.
Co-authored-by: Gabriel CORRAL <[email protected]>
Composed mesh shaders reuse the lean compute argument layout. Mesh
composition replaces four scratch accesses with local operations, but
the host still counted their zero slots as missing GPU addresses. Check
live mesh arguments and retain the complete check for compute geometry.
The GPU fixtures pass for geometry replay and gathered, single-draw,
and threaded mesh encoding. The fault fixture covers missing live
mesh bindings and compute scratch. Pinned LLVM 23.1.4 matches all 186
findings on main, including its existing OpenGL fixture warning.
The PR's matched Bananza runs on M4 Max remove 16 false reports per
run, with 58.5 FPS on both candidate runs.
Co-authored-by: Mathias <[email protected]>
Use one four-byte source element for GL_UNSIGNED_INT_2_10_10_10_REV
and GL_UNSIGNED_INT_10F_11F_11F_REV. The one-byte fallback skipped
unpack byte swapping and truncated R11F_G11F_B10F rows.
Exercise both formats through glTexImage2D and exact Metal readback
with swapping enabled and disabled and a skipped word between rows.
Co-authored-by: Eliran Zach <[email protected]>
Layton uploads its chroma plane as two-channel data into RGB storage.
Expand RED and RG texels when the backing format has four channels.
Respect the source type, row length, alignment and byte order on both
2D upload paths. Use the existing scalar conversion for wider types.
Checked the upload cases and GL rendering with Metal validation.
Layton played the opening in colour with the GL fix alone. DOOM 3
passed a quick regression check on an Apple M6 Mac.
Co-authored-by: Sergio Santos <[email protected]>
Bayonetta 3's depth prepass writes the visibility count used by later
indexed indirect draws. The prescan copies the initial zero, and the
primitive barrier leaves that copy valid, so the opaque body draws are
masked out. Expire the copies on the host's existing GAME_BARRIER_FULL
mask when shader writes have occurred since the copies were made.
On an M4 Pro, the three primitive-barrier cases fail on the baseline
and all ten cases pass with the fix in both Metal encoder modes.
Mario Kart World 1.8.0 recorded zero indirect-mask splits in the sampled
Grand Prix route on both revisions with deferred Metal encoding. Both
stock runs hit the same existing startup crash before the race. The PR
author verified the opaque draws in Bayonetta 3 on an M4 Max and an
iPhone 17 Pro Max.
Co-authored-by: Bruno Correa <[email protected]>
The classic Metal fallback leaves both shared residency sets nil.
Graphics shutdown creates a classic command buffer, and passing an
absent set to useResidencySet: throws before the buffer can drain.
Check each shared set at the attachment point. Extend the existing
Metal initialization fixture to drain after classic initialization.
On an M4 Pro with macOS 27.2.1, forced classic mode and the masked
Metal 4 capability check each drained three times with zero attachments.
Normal Metal 4 mode drained three times with both shared sets attached.
Use the resolved physical attachment mask for both raster and store tracking. GPU readback covers masked outputs, absent outputs and remapped writes. A matched Kokiri Forest frame on Apple M6 saved 55.4 MiB of attachment stores.
Co-authored-by: David Padron-Harris <[email protected]>
SIGTERM during startup can run the graphics drain while the first NVN
pool is being registered. Both callers can pass the unsynchronized
device check, then replace each other's feedback queues. The crash
lands in the ARC release of the previous queue.
Guard the complete initialization with dispatch_once so both callers
see the finished device, queues and residency state. Keep the classic
fallback request atomic while initialization is in progress.
The new fixture holds the first device request while graphics suspend
or a second classic device request starts. It catches duplicate
initialization on the old code. In NieR 1.0.3 on an M4 Pro with macOS
27.2.1, early SIGTERM trapped in 16 of 24 launches on efd1bddd and
exited cleanly in all 24 fixed launches. A 100-second opening-flight
run also reached frame 5977 and shut down cleanly.
Track depth and stencil feedback by the plane the texture view reads.
Preserve ordering for overlapping reads, draws, and clears. Continue
identical depth-only bindings and resolve vertex texture handles through
the vertex stage while keeping attachment aliases as pass boundaries.
On the reporter's M4 Mac mini, the three rules reduced the Orbitals
split-screen workload from 283 to 150 passes per frame and GPU p50/p95
from 57/59 to 38/40 ms against 87422462 at fixed resolution.
Metal replay on Apple M6 checks pass counts and GPU pixels for all
three rules, including clear ordering. All 350 checks pass in each of
four direct/deferred encoding and unbind-deferral configurations.
The focused graphics checks and targeted lint pass. Xenoblade Chronicles
2 passes the full 65-second regression against e4b0d9b7 with unchanged
shader outputs, passing screenshots, and no new red lines.
Refs #2806
Co-authored-by: settobox-crypto <[email protected]>