feat(gpu): implement GPU texture copies for CopyResource and CopyTextureRegion #183
No reviewers
Labels
No labels
accessibility
bug
claimed
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
tester report
urgent
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LakshanSivakumar--Native-Victory-macOS!183
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/183/head"
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?
@Sheffy007 on GitHub · 2026-11-26 23:15 UTC · original
Sheffy007:feat/native-texture-copies→main· +979 −13 · 9 files · 1 commits · merged 2026-11-26 23:58 UTCSummary
CopyResourcebetween textures andCopyTextureRegionon macOS previously logged"a texture copy or resolve"and dropped all operations (texture_copiescounter). This implements GPU-side texture copies inPass::BlitviaMTLBlitCommandEncoder:crates/victory-backend/src/resources.rs: addBlitOp::CopyTexture,BlitOp::CopyBufferToTexture, andBlitOp::CopyTextureToBuffer.crates/victory-metal/src/gfx.rs: encodeMTLBlitCommandEncodertexture-to-texture, buffer-to-texture, and texture-to-buffer copies with bounds, pitch/offset alignment, castable format view casting (newTextureViewWithPixelFormat), and depth-buffer transfer guards.crates/victory-gpu/src/native/list.rs,host.rs,glue.rs,crates/victory-gpu/src/list.rs: record and scheduleCopyResource(texture-to-texture) andCopyTextureRegion(subresource-to-subresource and placed footprint <-> subresource) on macOS, falling back todropped_oponly for unsupported transfers (B4G4R4A4_UNORM/depth buffer transfers or out-of-range subresources/planes).crates/victory-metal/tests/resources.rs,crates/victory-gpu/src/native/texture_tests.rs: add Metal API validation tests covering buffer <-> texture and castable format texture-to-texture copies through both the backend and D3D12 list vtable.docs/native-host.md: document native texture copy behavior.Verification
MTL_DEBUG_LAYER=1 cargo test -p victory-hle -p victory -p victory-gpu -p victory-metal -p victory-shader -p xtaskcargo clippy --workspace --all-targets --target x86_64-pc-windows-gnullvm -- -D warningscargo xtask policy@LakshanSivakumar on GitHub · 2026-11-26 23:58 UTC · original · approved these changes
Reviewed and tested together with the other open PRs on main (macOS x86_64 workspace tests, the setup shell tests, and Windows clippy). Thanks!