gpu: run an indirect DispatchMeshX instead of dropping it #291
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/291"
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 m0rff on 2026-11-27T09:01:51Z.
Refs #290
DispatchMeshXwith an argument address now runs as a one-record meshExecuteIndirectinstead of being dropped.list.rs,state::dispatch_mesh_x):State::execute_indirect(list, (10, 12, 1), indirect, None). "indirect mesh dispatches dropped" is still logged, but only when that returns false.glue::execute_indirect(this, Command::DispatchMesh, 12, 1, indirect, None), which is a Metal indirect mesh draw reading the record in title memory. With no address, or if that fails, it goes todropped_mesh_x.dropped_mesh, so they are counted and warned once. Themesh/mesh_indirectcounters in "native draws so far" were always 0 before.resource.rs), soindirectis passed through unchanged.Guesses (marked in the code and in
docs/native-host.md, not confirmed on a console): the record isD3D12_DISPATCH_MESH_ARGUMENTS(three 32-bit group counts, 12 bytes);xis unused when the address is set;flagsandpayloadchange nothing the host needs.Test:
texture_tests::an_indirect_dispatch_mesh_x_draws_the_groups_its_record_holdscalls 0x310 through the list's method table, with a hand-assembled mesh program bound and a render target set. It checks that a mesh draw of that record is recorded, then runs it on a queue. A record of(1, 1, 1)colours the target. A record of(0, 0, 0)leaves it black. It fails on main, where no draw is recorded.Relation to #258: not shown to be related, and this does not claim to fix it. In #258 the mesh draws with zero group counts come through
ExecuteIndirectsignatures (glue::execute_indirect, unchanged here). Their records are zero because the cullers read null heap views and never write counts. That happens before the draw, and this path does not touch it. Whether the title callsDispatchMeshXwith an address at all in the world has not been measured. No game run was done for this PR.Checks:
cargo test -p victory-gpu(native arm64, 317 passed),-p victory-hle -p victory -p xtask, Windows-target clippy-D warnings,cargo build --release --target x86_64-apple-darwin -p victory,cargo xtask policy.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T10:46:21Z.
Thank you. Merged.
I ran these five together on my Mac before merging (#101, #267, #288, #289, #291 on main, M5 Pro 48 GB, Series S, warm cache, three runs): two runs stayed in the world until the time limit (139 s and 202 s there, about 2 fps, no failed command buffer, no fault); one ended at the start of the world with a title fault I had not seen before (first chance at image+0x4fafef8, a read of 0x30000065c), with no GPU error before it. I could not tie that one to any of the five. If you see it, please say so.