Load Metal shader libraries from memory #654

Open
github-bot wants to merge 1 commit from github-bot/gh-650 into main AGit
Owner

@⁠fruvs on GitHub · 2026-11-29 04:10 UTC · original
fruvs:codex/in-memory-metal-libraries → main · +7 −17 · 3 files · 1 commits · draft

Refs #653

Load metallib bytes with MTLDevice.newLibraryWithData using an owned dispatch-data buffer. The common loader no longer creates a temporary file for vertex, pixel, mesh or compute libraries. The existing compiled-library cache and Metal error reporting still apply.

Verification

Verified on an Apple M5 Pro using an upstream main control and the three-file patch applied to the same revision.

  • The synthetic metal::tests::queue_b_waits_for_queue_a_over_the_same_buffer test passed on main with a writable temporary directory and failed with Operation not permitted (os error 1) when process writes were denied.
  • Under the same write restriction, the patch passed the compute test and indexed_draw_with_depth_test_and_depth_sampling. Both tests check GPU outputs.

To reproduce, build the existing synthetic tests with cargo test --locked --release -p victory-metal --lib --test render --no-run. Set VICTORY_MSC_DYLIB to the installed Metal Shader Converter and VICTORY_NO_PIPELINE_ARCHIVE=1. Invoke each test executable through sandbox-exec -p '(version 1) (allow default) (deny file-write*)', passing the corresponding test name and --exact.

**@⁠fruvs** on GitHub · 2026-11-29 04:10 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/650) `fruvs:codex/in-memory-metal-libraries` → `main` · +7 −17 · 3 files · 1 commits · draft Refs #653 Load metallib bytes with `MTLDevice.newLibraryWithData` using an owned dispatch-data buffer. The common loader no longer creates a temporary file for vertex, pixel, mesh or compute libraries. The existing compiled-library cache and Metal error reporting still apply. ### Verification Verified on an Apple M5 Pro using an upstream main control and the three-file patch applied to the same revision. - The synthetic `metal::tests::queue_b_waits_for_queue_a_over_the_same_buffer` test passed on main with a writable temporary directory and failed with `Operation not permitted (os error 1)` when process writes were denied. - Under the same write restriction, the patch passed the compute test and `indexed_draw_with_depth_test_and_depth_sampling`. Both tests check GPU outputs. To reproduce, build the existing synthetic tests with `cargo test --locked --release -p victory-metal --lib --test render --no-run`. Set `VICTORY_MSC_DYLIB` to the installed Metal Shader Converter and `VICTORY_NO_PIPELINE_ARCHIVE=1`. Invoke each test executable through `sandbox-exec -p '(version 1) (allow default) (deny file-write*)'`, passing the corresponding test name and `--exact`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 04:13:21 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/654/head:github-bot/gh-650'
git switch 'github-bot/gh-650'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-650'
git switch 'github-bot/gh-650'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-650'
git switch 'github-bot/gh-650'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-650'
git switch 'main'
git merge --squash 'github-bot/gh-650'
git switch 'main'
git merge --ff-only 'github-bot/gh-650'
git switch 'main'
git merge 'github-bot/gh-650'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.