Outputs: Defensive checks, and don't wait for a Metal drawable twice in a frame

- Metal: when a layer has no drawable to give (it can take a second to
  say so), don't ask again in the same frame for every pass to it.
- Swapchains other than the primary are created, resized and destroyed
  between frames (Metal asserts it), and destroyed with the last
  reference to them (ReleaseAssertLast, Metal and Vulkan).
- BindFramebufferSamplesAsTexture asserts it isn't given a swapchain,
  like BindFramebufferAsTexture.
- An offscreen Metal swapchain can't be resized, asserted.
- VulkanRenderManager asserts that no additional swapchain outlives it.
- Native_RemoveOutputAndWait asserts it isn't called on the thread that
  handles the requests, where it would always time out.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-22 23:08:52 +02:00
1 parent ba55ee7e5f
commit da33eab776
6 files changed
+26 -3

No files matched your search

@@ -759,6 +759,8 @@ void VulkanRenderManager::CheckNothingPending() {
VulkanRenderManager::~VulkanRenderManager() {
INFO_LOG(Log::G3D, "VulkanRenderManager destructor");
// Their owners (the outputs) destroy them first, on device loss. Left over, they'd outlive the device.
_dbg_assert_(extraSwapchains_.empty());
{
std::unique_lock<std::mutex> lock(compileQueueMutex_);