feat(gpu): implement GPU texture copies for CopyResource and CopyTextureRegion #183
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/183"
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 Sheffy007 on 2026-11-26T23:15:23Z.
Summary
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 policyImported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T23:58:06Z.
Review: APPROVED
Reviewed and tested together with the other open PRs on main (macOS x86_64 workspace tests, the setup shell tests, and Windows clippy). Thanks!