Skip to content

Metal: texture readback, allocation failure reporting and batched clear rects - #113

Closed
navjack wants to merge 1 commit into
renderbag:mainfrom
navjack:metal-texture-readback-alloc-failures
Closed

navjack wants to merge 1 commit into
renderbag:mainfrom
navjack:metal-texture-readback-alloc-failures

Conversation

@navjack

@navjack navjack commented Sep 15, 2026

Copy link
Copy Markdown
  • Copy texture regions into CPU-visible buffers so texture readback works
    on the Metal backend, as it does on D3D12 and Vulkan.
  • createTexture and createBuffer return nullptr when the Metal allocation
    fails instead of handing back an object wrapping a null resource, so
    callers can fall back.
  • clearDepthStencil submits rect lists longer than the per-call limit in
    batches, as the D3D12 backend does, instead of asserting.

Notes

Extracted from the LostOdysseyRecomp macOS Metal port. Two project-specific pieces of the original change (a device-level shaderFormat capability and a RenderSwapChain::getFormat() override) are intentionally left out, so this applies to main on its own.

Testing

  • Used during gameplay in the LostOdysseyRecomp macOS Metal port (Apple M4 Pro, macOS 27, Xcode 27), which reads back resolved textures and clears with long rect lists.
  • -fsyntax-only compile of plume_metal.cpp on arm64 macOS against current main passes.

🤖 Generated with Claude Code

…ar rects

- Copy texture regions into CPU-visible buffers so texture readback works
  on the Metal backend, as it does on D3D12 and Vulkan.
- createTexture and createBuffer return nullptr when the Metal allocation
  fails instead of handing back an object wrapping a null resource, so
  callers can fall back.
- clearDepthStencil submits rect lists longer than the per-call limit in
  batches, as the D3D12 backend does, instead of asserting.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@DarioSamo

Copy link
Copy Markdown
Contributor

AI-generated contributions are not accepted, especially ones with Claude as the co-author. No copyright will be given to Anthropic in any of my projects.

@DarioSamo DarioSamo closed this Sep 15, 2026
@renderbag renderbag locked as spam and limited conversation to collaborators Sep 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants