[Tester] M2 Pro, 32 GB, macOS 27.2.1: window stays black, but the menus render into the UI target; present pass outputs black #26
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by cocobailey on 2026-11-26T09:47:14Z.
Mac
MacBook Pro, Apple M2 Pro (19-core GPU), 32 GB, macOS 27.2.1
Commit
3d4ca18(first runs atd9c4383, same result)How far did it get?
Window opened, stayed black
What happened
Summary: sound plays and the game runs at about 30 fps with no errors, but the window stays black apart from a short grey flash near the start. Image dumps show that the setup menus do render correctly into the 3840x2160 UI target. Only the presented swapchain image is black. Sandile-0511's M5 on macOS 26.5.1 (#13) sees the menus in the window, so this may be specific to the M2 (Apple8 GPU) or to macOS 27.
Default
run-native.shsettings (consoleseries-xon 32 GB), Apple Metal Shader Converter 4.0.3 from/usr/local/lib. All runs usedVICTORY_DATA_DIRandVICTORY_CACHE_DIRset to an external SSD, with a fresh data folder.What I measured:
no_pipeline=0 no_texture=0. No GPU timeout at about 53 s (#2) in any run, and noERRORlines. Same 22copies that do not settlepixel-piece warnings as #13.VICTORY_TRACE_TARGETS=1 VICTORY_DUMP_TARGETS=…, the 3840x2160 UI target at0x73f3b20000holds the correct setup screens (I could read the SUBTITLES screen in a dump). Dumps not attached, per the asset policy.draws 1 clears 1 PRESENTEDeach frame) are all zero in every dump I took, from 10 s to 66 s.VICTORY_DEBUG_PS_RED=1, the presented images turn solid red. So the present draw covers the target, and it's its pixel shader that writes black. That looks like the "black present" case from the ROADMAP (static samplers in the root layout), but on this machine.libmetalirconverter.dylibthat ships inside GPTK 4.0 beta 3's D3DMetal.framework (viaVICTORY_MSC_DYLIB). Apple's standalone Metal Shader Converter 4.0.3 gives the identical result.--console series-sis also black, and it also crashed about 26 s in withunhandled exception 0xc0000005 at image+0x55e56f8(first-chance access violation, null-looking args). I've only seen that crash once.a title texture format the host does not representwarnings (for example formats 26 and 42 at 1280x720, 115 at 2560x1440). They're probably the same as on other Macs, but listing them in case the present shader samples one.I'm happy to rerun with any trace switch you'd like, or test a branch.
AI-assisted testing and write-up, prepared with Claude Code. No game data attached.
Log
victory.log
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T10:52:51Z.
Thanks for the super thorough report and diagnostics, @cocobailey!
Confirming that the menus render cleanly into the 3840x2160 UI target (
0x73f3b20000) whileVICTORY_DEBUG_PS_RED=1turns the presented swapchain solid red narrows this down nicely: geometry/viewport/rasterization of the present pass work, and the present pixel shader itself is outputting black (despite ruling out MSC 4.0.3 vs D3DMetal and--console series-s). The contrast with #13 (M5 on macOS 26.5.1 showing menus in the window) makes Apple8 GPU vs Apple10 / macOS 27 a strong suspect—especially around static sampler / descriptor heap binding or sampling one of the present pass inputs.If you have time for one quick follow-up check:
VICTORY_TRACE_TARGETS=1log lines for one present frame (specifically thetrace_draw/ root-parameter / view lines for the draw targeting thefmt 28swapchain image—no image dumps or game assets needed)? That will show exactly which SRVs, samplers, and root params the present shader binds on your machine.mainsince3d4ca18—worth pulling if you re-run, though none specifically targeted Apple8 present sampling yet.Also great to see zero GPU timeouts over 120 s / 3,200 frames—added that data point to #2 as well.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by daidalos4 on 2026-11-26T11:42:31Z.
Data point from an M1 (16 GB, macOS 27.0.1), Series S,
mainat8bf47c3, with the game files on a slow network share (~1 MB/s).The 0xc0000005 at
image+0x55e56f8is a follow-on fault. The first fault, about 34 s in, is the title's hang watchdog: a deliberate write to 0 atimage+0x2215c35. Here it fires during "System Init" (the title's crash log reportsGame State: System Init [T:3264],Frame: 0). The watchdog thread (image+0x2215a60) reads the heartbeat at0x1471b6338once a second. After 30 unchanged samples it calls the crash callback, then writes to 0. Breakpad's handler then faults at+0x55e56f8, which is what the run reports.The heartbeat table at
0x146844a20(64 slots) is empty at the fault. The heartbeat at0x1471b6338is still 0, so the main thread never ticked once in 30 s of init. The pause flag at0x1471b6330is 0. The root-slot fix from #15 (ignoring slots of 64 or more inlist.rs::set) does not change it here. With slow storage, init simply takes longer than 30 s.As a debugging aid, a host thread that rewrites
0x1471b6330 = 1every 250 ms gets past it. The title then runs for minutes: 5,000+ frames encoded on Metal, WASAPI rendering, DirectStorage drained towaiting=0,data\ttdb\...files opened.Black present reproduced on Apple7 too, with a difference: late frames show only 1 to 2 draws per frame (
frame targets ... fmt 28 3840x2160 draws 1 clears 1plusfmt 19 3840x2160 draws 1). No UI target gets drawn, with or without scripted Enter presses. So on this machine the title is not at the menus yet; this is not the present shader. A thread dump at 120 s shows the main thread inWaitForSingleObjectfromimage+0x258dba6. That is a function at+0x258db70that sets bit 31 of a counter at+0x68and waits for outstanding users to drain. One title thread is busy at+0x4e8aaf0and the others are idle.For the trace you asked for in the first present frames: the present draw's table constant buffer (
addr 0x1c12ff80, 96 bytes) reads all zeros at record time:Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T13:28:36Z.
Thanks for the thorough M1 16 GB data point, @daidalos4!
image+0x2215c35->image+0x55e56f8is the title's 30 s hang watchdog firing when the main thread doesn't tick its heartbeat (here due to ~1 MB/s network storage rather than the root-slot table growth).draws 1 clears 1are the only draws per frame and the table constant buffer at0x1c12ff80is all zeros, the title indeed hadn't reached the menus yet in that trace (unlike @cocobailey's M2 Pro run where the 3840x2160 UI target already contains the rendered setup screens).main(preservingPresentorder behind held queue work and keeping unsatisfied fence waits off Metal).Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by sys-skye on 2026-11-26T14:24:08Z.
I think Claude found it:
Data point from an M2 Max (30-core GPU, 64 GB, macOS 27.3), on
mainataf380ca: same black window as reported above. The cause is static samplers, and a fix is in a pull request: (link).What happens. Apple's Metal Shader Converter does not build static samplers into the shader. For a root signature with static samplers, it adds one more entry to the top-level argument buffer, right after the root parameters: the address of a table of
IRDescriptorTableEntry(sampler, 0, LOD bias),s0first.IRRootSignatureGetResourceLocationslists it as a table resource with space and register0xFFFFFFFF, at offset 16 after 4 dwords of root constants, for example. The backend never writes that address. A shader with an immediate sampler therefore reads its sampler through whatever bytes follow its parameters. On Apple7/Apple8 (M1, M2) that samples zeros. Newer GPUs evidently tolerate it, which would explain why M5 machines show the menus.The present pixel shader samples the menu target with an immediate sampler, so it exports (0, 0, 0, 0). That fits what was measured here:
VICTORY_DEBUG_PS_REDturns the window red, the menus are correct in the UI target, and the swapchain image is all zeros, alpha included. Compute shaders with immediate samplers take the same path, so this may matter beyond the window.How it was narrowed down, with our own test code only:
VICTORY_TRACE_TARGETSnever reaches the present draw: it only covers the first six draws with vertex buffers. So the PR addsVICTORY_TRACE_PRESENT=<every>, which logs the draws into a presented texture: shaders, static samplers, root parameters, table entries, and how much of each texture is non-zero.VICTORY_DEBUG_PS=in1shows a correct UV gradient. The menu target is fully drawn at 70 s, and the present writes zeros.heap_ps.hlsl: texture fromResourceDescriptorHeap[index], static samplers0) reads[0, 0, 0, 0]on the M2 Max, with point or anisotropic samplers and in both residency modes. The same texture read withLoad, or sampled with a sampler from the sampler heap, reads correctly.IRCompilerSetMinimumGPUFamily(Apple7, 8 or 9) changes nothing.metal-objdump -don the converted fixture shows the sampler loaded through a pointer at top-level offset 16.With the fix, the frame presented at 71 s has the menus (its mean colour equals the UI target's), and the window shows them. Tests on the M2 Max:
victory-metalrender 6/6,victory-gpunative 77/77.It would be great if someone on an M5 could run
cargo test -p victory-metal --test renderon the branch, to confirm the new tests pass there too.Two side notes:
victory-metal/tests/resources.rs::srv_and_uav_through_a_descriptor_tablefails when the tests run as x86_64 under Rosetta. Its arena is2 * page_size()bytes, 8 KiB with Rosetta's 4 KiB pages, but it writes 16 KiB. It passes with arm64's 16 KiB pages. That's unrelated to this issue.With the window working, the title went on past the menus here and faulted about 2 min 20 s in, at
image+0x55bf26c: a read through a non-canonical pointer, right after new compute pipelines and two refused compute shaders. I'm looking into that separately.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T15:56:46Z.
Status: a fix is in PR #91 (static sampler table; confirmed by #99 on M2 Max: window shows the game). It has changes requested and is not merged. This issue closes when #91 lands.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T18:10:27Z.
#91 is merged (
b6f15be), so the static sampler fix is on main. Could you confirm the window is no longer black on current main? I'll close this once it's confirmed.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T18:46:45Z.
@cocobailey #91 is on main (
49e7c648). Could you check whether the window still stays black on your M2 Pro? Steps:git pull && tools/macos/native-setup.sh, thentools/macos/run-native.sh <game folder>. Please attachruns/<date>/victory.log, include the commit (git rev-parse --short HEAD), and add a line on what you saw on screen.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Stooovie on 2026-11-26T19:41:15Z.
M4 Max Studio 36GB on 27.2.1, window stays blank the entire time, I hear R* logo audio.
victory.log
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by cocobailey on 2026-11-27T00:16:42Z.
Confirmed fixed on my M2 Pro (32 GB, macOS 27.2.1) at
b16bd61, defaultrun-native.sh(Series X), Apple Metal Shader Converter 4.0.3. Thanks @sys-skye for tracking it down.VICTORY_TRACE_TARGETS=1+VICTORY_DUMP_TARGETSinstead of looking at the screen. The two swapchain images (fmt 28, 3840x2160) are black until about 60 s and lit from 81 s on. At 81 s they show the Rockstar logo screen, and from 121 s on the setup menus (NAVIGATION EXPERIENCE), with the same mean colour as the UI target. Before the fix, every swapchain dump was all zeros.run-summary.sh: 6,656 frames in 240 s, 28.2 fps overall, steady at 30 fps apart from about 15–25 fps between 55 s and 95 s while loading. No GPU errors, no refused shaders, no exception. The only warnings are 32a descriptor was not mirrored.VICTORY_KEYSstop at 80 s, and on this run the logo screen only came up at about 80 s.Logs from these runs to follow (I'm away from the Mac and will attach them when I'm back).
AI-assisted testing and write-up, prepared with Claude Code. No game data attached.