From 8c9f655b8db923bef966b7d7e7e9d258e197e473 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Sun, 20 Sep 2026 04:14:01 -0400 Subject: [PATCH] [MG_Test, MG_Backend] (Disaggregated): keep required replies outside run-ahead holds --- MobileGL/MG_Backend/DirectVulkan/Renderer/WireDraw.inc | 2 +- .../MG_IntegrationTest/Scenarios/MagmaRunAheadScenario.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/MobileGL/MG_Backend/DirectVulkan/Renderer/WireDraw.inc b/MobileGL/MG_Backend/DirectVulkan/Renderer/WireDraw.inc index d94cb14e..e1c11152 100644 --- a/MobileGL/MG_Backend/DirectVulkan/Renderer/WireDraw.inc +++ b/MobileGL/MG_Backend/DirectVulkan/Renderer/WireDraw.inc @@ -56,7 +56,7 @@ // Only shutdown/swapchain replacement calls this, after device idle. if (m_wireDrawPass && m_frameContext.GetFrameCount() != 0) { auto& frame = m_frameContext.GetCurrent(); - if (frame.isCommandRecording && VkRenderPassManager::GetActiveRenderPass() == m_wireDrawPass.get()) + if (frame.isCommandRecording && VkRenderPassManager::GetActiveRenderPass()) VkRenderPassManager::EndRenderPass(frame.commandBuffer); } m_wireDrawPass.reset(); diff --git a/MobileGL/MG_IntegrationTest/Scenarios/MagmaRunAheadScenario.cpp b/MobileGL/MG_IntegrationTest/Scenarios/MagmaRunAheadScenario.cpp index c629514d..9d7d6484 100644 --- a/MobileGL/MG_IntegrationTest/Scenarios/MagmaRunAheadScenario.cpp +++ b/MobileGL/MG_IntegrationTest/Scenarios/MagmaRunAheadScenario.cpp @@ -168,6 +168,11 @@ void main(){vec2 p[3]=vec2[3](vec2(-1,-1),vec2(3,-1),vec2(-1,3));gl_Position=vec HeldApply hold; ASSERT_NO_FATAL_FAILURE(HoldNextBatch()); DrawTile(0); glBufferSubData(GL_ARRAY_BUFFER,0,sizeof(g),g.data()); DrawTile(1); + ExpectQueued(2); hold.Release(); + // Resource creation requires a reply, and storage definitions may require an + // allocation acknowledgement. Do not hold the apply owner across those legal + // waits. There is still no GPU readback/Finish before all four draws, so the + // old GPU store must survive respecify and deletion until its draws complete. glBufferData(GL_ARRAY_BUFFER,sizeof(b),b.data(),GL_STREAM_DRAW); DrawTile(2); glDeleteBuffers(1,&buffer); // Request the recycled name through the public allocator. Record reuse must @@ -179,7 +184,6 @@ void main(){vec2 p[3]=vec2[3](vec2(-1,-1),vec2(3,-1),vec2(-1,3));gl_Position=vec glBindBuffer(GL_ARRAY_BUFFER,replacement); glBufferData(GL_ARRAY_BUFFER,sizeof(y),y.data(),GL_DYNAMIC_DRAW); glVertexAttribPointer(0,4,GL_FLOAT,GL_FALSE,16,nullptr); DrawTile(3); - ExpectQueued(4); hold.Release(); ExpectPixel(4,4,red,"original buffer version"); ExpectPixel(12,4,green,"SubData version"); ExpectPixel(20,4,blue,"respecified store"); ExpectPixel(28,4,yellow,"recreated GL name"); }