macOS (Apple Silicon, CrossOver + D3DMetal): menus at 30 fps, into the world, scene mostly dark #1128
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#1128
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?
@Ahmet-Dedeler on GitHub · 2026-11-24 16:01 UTC · original
VIctory runs on a Mac under CrossOver, with Apple's D3DMetal as the D3D12. It gets through the menus and the intro video at about 30 fps and into the world, where the first mission's title card and opening credits draw over a scene that is still mostly dark. Posting what it took and what stops it, since I haven't seen a macOS report here and most of it is Apple specific.
Host: MacBook Pro, Apple M5 Max, 64 GB, macOS 27.3, CrossOver 26.3 (Wine + Rosetta 2 + D3DMetal). Cross-built with mingw (
x86_64-pc-windows-gnu), which needed no source changes. No Windows machine or AMD / NVIDIA GPU involved.Code: an older version of the Mac patch is public, 14 commits on
015d45b: Ahmet-Dedeler:mac-crossover. The numbers below are from a newer one, 13 commits on top ofBeachesOfViceCity/VIctory-Linuxatf1e94ce(mainffe310eplus their Wine/Proton commits). That one isn't published yet. I know PRs are limited to collaborators, so tell me if a branch on currentmainwould be more useful and which parts you'd want.How far it gets
+0x63966f. I don't know yet what that site checks.What stops it
dxcompiler.dllanddxil.dllnext to the exe (#178's route). After that 0 indirect executions are dropped for a missing clamp and 2,100 to 2,900 draws reach the host per frame, but the picture is the same. Still dropped per world frame in one 140 s run: 445 to 911 where the compute shader doesn't translate (same as Windows), 255 indirect draws with "prepare failed" although the pipeline exists, 124 to 151 compute pipelines that need 64-lane waves, 60 to 81 where the mesh shader doesn't translate, 43 for a pixel shader. I haven't worked out which of these keeps the lit scene from showing.WaveSize(64)compute pipeline into a no-op, silently. That is 321 of the 1,685 translated compute shaders. I have a 32-lane translation written (off by default), checked with Apple's IR verifier only. None of it has run on the GPU.main. Onffe310eplus the same patch the world ends about 40 s in: macOS logskIOGPUCommandBufferCallbackErrorHangand the runtime reports "the host GPU did not finish a submission of 26 lists in 12 s". With VIctory-Linux's bounded one-view tables for root SRVs / UAVs it didn't happen in the runs I made. I haven't isolated the cause.Things about Apple's stack that may save someone time
Not tested
The title's network is blocked on every run, and the terms page was accepted by hand.
@pickles976 on GitHub · 2026-11-24 16:03 UTC · original
Sibling-runtime hypothesis for the dark scene, cheap to falsify on exactly this host. D3DMetal is an impedance shim over Metal, and Metal's SIMD-group is hard 32 lanes — yet a DXGI/D3D12 shim is free to advertise whatever max wave size it wants. If your runtime believes a 64 from D3DMetal and legalizes wave64 without remap, every cross-lane compute result is wrong on an otherwise perfectly healthy GPU — which is the exact silent class your #1086 row 2 documents for NVIDIA native Wave32, arriving here through a third driver. Dark-scene-with-working-menus also matches your #1062/#1085/#1119 dropped-pipeline family, so two suspects, one test:\n\n1. Log what wave range the runtime receives from the D3DMetal device (the same diagnostic we standardized on in xcl#1407 — the line should say the received range, not just the decision).\n2. One forced run with wave64 emulation on regardless of what was advertised. If the scene changes (lighting appears, artifacts move, or it hangs elsewhere), the shim lied about lanes and this issue becomes platform-policy: Apple must be assumed wave32-capable-at-best, never trust the reported max — the same fail-safe direction our side takes for unknown ranges ("assume split").\n\nNote for cohort triage: xcl today trusts a reported device wave range for compute (split is forced only when the range includes/equals 32 or is unknown) — so a lying shim is a live risk on our side too on this platform, and your run is the first data point we have. If ① shows a reported 64 on Apple Silicon, we will add a D3DMetal-specific fail-safe rather than debate the general default.
@MichaelSmithAI on GitHub · 2026-11-24 16:12 UTC · original
For comparison, the same-frame captures in #841 showed a lit 2560×1440 world target alongside a zero 3840×2160 target and zero presented frames on an RTX 3090. Your horizon, lights, title card and credits establish that some world-frame content reaches the display on the Mac. A capture from one of those frames showing the internal scene target and the actual presentation source, with their sizes or resource IDs, would help locate where the dark regions first appear.
One detail for interpreting the 255 indirect drops: in the public draw path,
prepare failedcan also occur when the indirect command expects a different pipeline kind. The fullindirect kind N: prepare failed (compute X, mesh Y)line, plus any descriptor-allocation message for that operation, would help distinguish a kind mismatch from a table that could not be bound. Which of those paths the measured Mac build took remains open.@Ahmet-Dedeler on GitHub · 2026-11-24 16:33 UTC · original
@pickles976 good guess on the class of bug, but the shim doesn't lie about lanes here. D3DMetal's adapter reports 32-lane waves, and the runtime believes it. The catch is one step later: a compute pipeline that declares
WaveSize(64)is accepted and then does nothing, with no error. That's blocker 3 above, 321 of the 1,685 translated compute shaders, and 124 to 151 dropped dispatches per world frame.So the test you describe is the right one, just for a different reason. I have the 32-lane translation of those programs written and off by default, and it has never run on the GPU. Turning it on for one world run and seeing if the lighting changes is the next thing I'll try. I'll post what the picture does either way.
@MichaelSmithAI both fair asks. I don't have a same-frame capture of the internal scene target next to what gets presented yet, I'll add one from a world frame with sizes. And I'll paste the full
indirect kind N: prepare failed (compute X, mesh Y)lines for the 255, with any descriptor allocation message next to them. My note said "suspected rectangle lists", which was a guess, so a pipeline kind mismatch is just as likely until I look.One number above is already out of date. The 6 s per frame was mostly not the GPU: the title clears memory with
clzeroone 64-byte line at a time in every worker job, and under Rosetta 2 each one was an emulated instruction at about 110 µs. With those sites rewritten into calls of ordinary code, the world is at 0.6 to 0.9 s per frame in the quiet first minute and 1.3 to 3.6 s once the credits run. Loading screens went from under 3 fps to 24 to 30. The picture is the same.@Ahmet-Dedeler on GitHub · 2026-11-24 17:36 UTC · original
Results for the three things asked above. Same host, tree is VIctory-Linux f1e94ce plus the Mac commits, every run is 295 s from boot into the opening of the world. D3DMetal reports
WaveLaneCountMin/Max = 32/32.1. Wave-64 programs on a 32-lane host (@pickles976)
So turning it on does change what the GPU does, but not the presented picture yet. With #439 the culling passes (
CS_Prop_BatchCull,CS_Tree_BatchCull),depth_pyramid:*, the tiled lighting setup (CS_GenerateMaterialMasks,CS_MaterialTilesInitial,CS_ClusterLightsWorldSpace) andshader_binning_utils:*now execute. Before, about 89% of the mesh indirect draws had zero group counts because their culling pass was one of the refused ones, and depth varied on 1 to 3% of the pixels. After, the G-buffer holds props, a fence, signs and a low-detail character, with depth varying on up to 29% of the pixels in one captured frame. Lighting still doesn't appear, that's a later stage (see 3).Offline over the shader archive with
--host-lanes 32-32, compute programs usable on a 32-lane host go from 2,180 to 2,434 with #439 (+254, none lost), and all 254 pass Apple's Metal shader converter. The 4 of the 74 that are left are groups of more than 64 threads and whole-wave sections.Dropped dispatches per frame is not a stable number (one untranslated pipeline can be dispatched 30+ times in one frame and not at all in the next), so the table counts distinct pipelines.
2. The ~255 "prepare failed" indirect draws (@MichaelSmithAI)
They are rectangle lists. My first guess was right, and it's not a kind mismatch or a table that couldn't be bound.
The full line:
dropped 256.0/frame without a host pipeline: indirect kind 0: prepare failed (compute false, mesh false). Kind 0 is a non-indexed draw and the bound pipeline is a graphics pipeline that is neither compute nor mesh, so the kinds agree. No descriptor allocation or heap message next to them.Per draw in one world frame: 180 are
VS_TiledLighting+TL_PS_<material>(the deferred lighting, one pair per material), 64 areVS_TiledWeathering, 12 areVS_TiledLighting+PS_SSSResolve. All have topology 17, no vertex buffer, records like[720, 1, 0, 0](240 tiles of 3 vertices). The draw path refuses indirect rectangle lists because its rectangle expansion rewrites vertex buffers, and these have none, the corners come fromSV_VertexID.With a geometry-shader variant of the pipeline written from the vertex shader's output signature (what #1020 does), used for indexed draws too, the count goes from 256 per frame to 0. D3DMetal does run these geometry shaders: a diagnostic that makes the variants write one colour fills whole targets.
3. Scene target next to what is presented, same frame
The scene target itself is dark. Nothing is lost at composite or present, and there's no size mismatch like in #841.
A read-back recorded into the title's own list just before a pass shows the scene colour target all zero before the first tiled-lighting draw, all zero after the last one, and holding only the horizon lights (0.9% of the pixels) before the coronas are drawn. So the first dark stage is the tiled deferred lighting.
What I found broken on the way to it:
CS_GenerateMaterialMasksandCS_MaterialTilesInitialwrite a material number per pixel into the depth plane (R16 view) and the stencil plane (R8_UINT view) of a 16-bit depth target with stencil, through unordered access views. D3DMetal refuses unordered access to a depth target, so both planes stayed zero. The lighting draws then test depth "equal" against that plane, one draw per material with z = number / 65535. Same refusal forshadowSmartBlit:CS_DepthCopy(5 per frame into 16-bit shadow maps) and for R32_FLOAT views of two 2560x1440 D32S8 targets. #469 (a twin texture) covers the depth-only cases. The targets with stencil need a twin per plane, and "equal" at 16 bits needs a 16-bit host depth, since 24-bit depth with stencil rounds.CS_GenerateShadowMasks_*run and write zero), the per-tile directional light texture (CS_ShadowRevealTiles, so the directional variant of each material draws no tile, which #1020's author also saw on NVIDIA), and the indirect light (indirect_light_probes:*don't translate).Only statistics and resource numbers from my own captures here, no game data.
@dylanliuh2o on GitHub · 2026-11-24 18:12 UTC · original
Amazing!👍
@pedrofort on GitHub · 2026-11-24 18:25 UTC · original
Hey @Ahmet-Dedeler!
Great progress on Apple Silicon. I've been working on
the same platform using an M5 MacBook Pro with 16 GB RAM.
My experimental unified integration is available in #1007,
now updated to commit
631fff9.It integrates several complementary areas:
Your finding that D3DMetal can accept native Wave64
pipelines without executing them correctly is particularly
interesting, because we independently encountered unexpected
native Wave64 PSO acceptance.
Our earlier graphics candidate recorded 84 verified GPU
executions and 8,064 verified output words using synthetic
fixtures. These are historical component-level results,
not results from the current integrated commit.
The current draft passes 116 native shader tests, and
the updated GPU harness supports numerical readback
validation. Integrated GPU verification remains in progress.
Would you be interested in collaborating?
Your real-title execution results and our synthetic GPU
conformance work could complement each other. Comparing
our implementations against a common upstream revision
might help address Wave64, indirect execution, memory
and synchronization bottlenecks.
I'd be happy to exchange synthetic tests and coordinate
development while preserving all contributors' authorship.
#1007
AI-assisted development with ChatGPT. No commercial game
assets are included in our submitted work.
@Ahmet-Dedeler on GitHub · 2026-11-24 18:27 UTC · original
@pedrofort hey, yes, happy to compare notes. Nice to see someone else on this host.
I think the two sides fit like this. I have a title running into the world on D3DMetal but almost no synthetic coverage: my 32-lane work was only checked with Apple's IR verifier until today. You have a GPU harness with numerical readback and no title run yet. So the most useful thing you have for me is that readback harness for wave-64 programs on D3DMetal. And what I can give you is which programs the real title needs first, so your suite can go after those instead of guessing. From today's runs that list starts with
InstanceCulling:CS_Prop_BatchCull/CS_Tree_BatchCull,depth_pyramid:*and thetiled_lighting:CS_*setup passes. Nothing in the world draws properly until those run.Two things from my runs that may save you time in #1007:
I'll read #1007 properly. A common upstream revision to compare on makes sense. My tree is on
VIctory-Linuxf1e94ce right now because plainmainhangs the Apple GPU about 40 s into the world for me (blocker 5 above), so that's the first thing I'd want to know about yours: does it get into the world, and on which base?@Ahmet-Dedeler on GitHub · 2026-11-24 18:40 UTC · original · edited 2026-11-24 19:14 UTC
Follow-up on "the lighting draws run and still write nothing" from my results above. It's narrowed down to the indirect path, but not yet to whose fault it is.
The tiled lighting draws are non-indexed
ExecuteIndirectcalls on a pipeline that has a geometry shader (the rectangle variant). Nothing is drawn for that combination here. Measured with three diagnostic switches on the rectangle variants (one colour instead of the pixel shader, depth test off, the first rectangle of a draw covering the whole target):PS_CompositeIndirectDrawBlend, 14,580 instances) also fills the targetViewport and scissor are the full 2560x1440, the list's indirect budget isn't spent, and no two of the 340 textures the frame's draws name share title memory at one address, so same-address aliasing isn't behind this stage here.
Edit: I first wrote that this is D3DMetal's. That was too strong. What isn't separated yet is whether D3DMetal drops a non-indexed indirect draw with a geometry stage, or the runtime's copy of the indirect record is wrong for this case. Both fit the three measurements above. I'll post which one it is.
Separately, the lighting vertex shader places no tile even as a direct draw, and the lighting's other inputs are still all zero in the same frame (shadow masks, the per-tile directional light texture, indirect light probes). So fixing the indirect path alone won't light the scene.
For the record, the PR heads my runs above were built from: #189 at
b472733, #439 atc153b21. Both have newer pushes since.@Ahmet-Dedeler on GitHub · 2026-11-24 19:42 UTC · original
End of day update. The code is public now, and I'm taking back one more thing I said about the lighting.
Branches on Ahmet-Dedeler/VIctory:
mac-on-latest: the Mac host commits onmainffe310e(9 commits). The one to read if you want to know what a Mac host needs.mac-on-linux-fork: the same onBeachesOfViceCity/VIctory-Linuxf1e94ce (17 commits).mac-perf: plus the frame-time work (41 commits in all). This is what I play. World is 0.7 to 0.8 s per frame median on this Mac.mac-lit:mac-perfplus 21 commits of the dark-scene work: trial applications of #439, #469, #1020 and some shader PRs, the per-plane depth twin, the rectangle variants, diagnostics. Its picture is black. It's there as evidence for what I wrote above, not as a build to run.mac-crossoveris the old one from last night.Lighting, corrected again. A probe outside the title, same process and bottle: one triangle over an 8x8 target, through a pipeline without and with a geometry shader, drawn directly, by non-indexed
ExecuteIndirectfrom a CPU-mapped buffer, the same after the argument clamp ran over the record, from a plain GPU buffer, and indexed. All ten cases cover 64 of 64 pixels. So D3DMetal does run a non-indexed indirect draw through a geometry-shader pipeline, and the suspicion I posted earlier is withdrawn. The earlier run that seemed to blame the indirect path usedSV_PrimitiveIDin the diagnostic geometry shader and couldn't separate that from the vertex shader placing nothing.What fails for the lighting draws is something in the runtime's own path for them, or in the shader. Not separated yet.
The current candidate, found offline and not yet run in the world: the translated
VS_TiledLightingholdsWaveReadLaneFirst(the console'sv_readfirstlane_b32of a reciprocal it divides the vertex number by), and Apple's Metal shader converter turns that intosimd_broadcast_firstinside a vertex function. 493 of the 2,165 translated vertex programs in the shader archive hold it. A change that lowers it to the vertex's own value in vertex programs is onmac-lit. Untested on the picture.The crash after about 15 minutes (
+0x63966f): it's a fixed pool of 25,000 placement elements running out. They're returned when a map section unloads. It also happens at 5 times the frame rate, so slow frames aren't the cause. The actual cause isn't proven yet.@pedrofort on GitHub · 2026-11-24 20:09 UTC · original
Thanks @Ahmet-Dedeler! Your new branches and measurements
are extremely helpful.
Our latest #1007 commit is
9f2177c, based on upstreamffe310eb20.We have not yet established a successful real-title world
run on this integration.
The latest synthetic validation on Apple M5, 16 GB RAM:
One important caveat: MoltenVK appears in the startup logs,
so we are investigating the actual D3D12 backend before
attributing those results specifically to D3DMetal.
Your #439 versus #189 comparison is particularly useful.
We are examining the console-flow implementation alongside
our existing coverage, including dynamic EXEC masks and
64/128/256-thread synthetic cases.
The culling, depth-pyramid and tiled-lighting workloads
you identified give us concrete priorities for new
synthetic regression tests.
We'll compare mac-perf and mac-lit against our integration
without blindly merging incompatible translator changes.
Thanks for publishing your work. We'll preserve attribution
and share reproducible results as we obtain them.
AI-assisted development and analysis with ChatGPT.
@Marvisak on GitHub · 2026-11-25 10:05 UTC · original
Automated triage for the maintainers.
Thanks for the detailed write-up. VIctory targets Windows hosts. A macOS host (CrossOver, D3DMetal, Rosetta 2) needs its own patch set, and most of the blockers here are specific to Apple's stack: the mesh output limit, wave64 pipelines that silently do nothing, store merging in Metal's DXIL converter, no unordered access to depth targets, and fences that signal early. A port to another platform is out of scope for this tracker.
Some findings also apply on Windows, and where they still matter on current
mainthey belong in Windows reports or pull requests (open to everyone now):mainby683ad7a, which landed afterffe310e.execute_indirectincrates/victory-gpu/src/draw.rsruns them when the pipeline has the generated geometry shader (see #255).Proposed close: out of scope (macOS port). This issue will be closed in 48 hours unless the reporter replies or a maintainer removes the label.
Generated by Claude Code