From e6571e61e4f3c69ed785e4f574a6b3cdc2b1047f Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Sat, 19 Sep 2026 22:53:35 -0400 Subject: [PATCH] [MG_Backend] (Disaggregated): P5f fm - keep wire endpoint and transform checks role local --- MobileGL/MG_Backend/BackendObject.h | 7 ++++++- .../MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp | 9 ++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/MobileGL/MG_Backend/BackendObject.h b/MobileGL/MG_Backend/BackendObject.h index 13a6d626..c759e038 100644 --- a/MobileGL/MG_Backend/BackendObject.h +++ b/MobileGL/MG_Backend/BackendObject.h @@ -41,7 +41,12 @@ namespace MobileGL { #endif Bool IsRenderbuffer() const { return Renderbuffer != nullptr; } - Bool Exists() const { return Texture != nullptr || Renderbuffer != nullptr; } + Bool Exists() const { +#if MOBILEGL_BUILD_DISAGGREGATED + if (!MG_Pipe::MGPipeHandleIsNull(TextureHandle)) return true; +#endif + return Texture != nullptr || Renderbuffer != nullptr; + } }; enum class FormatCapability : Uint64 { diff --git a/MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp b/MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp index c05b46b1..2890a878 100644 --- a/MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp +++ b/MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp @@ -3155,9 +3155,12 @@ void main() { inline ProgramFactory::CompileOptionFlags GetShaderTransformFlags(VkSurfaceTransformFlagBitsKHR preTransform) { ProgramFactory::CompileOptionFlags flags = ProgramFactory::CompileOptionBit::PositionZRemap; #if MOBILEGL_BUILD_DISAGGREGATED - const auto* wireFbo = MG_Config::Transport != MG_Config::TransportMode::Monolith ? MG_Pipe::MGPipeApplier().DrawFramebuffer() : nullptr; - const Bool isDefault = wireFbo ? wireFbo->IsDefault : - MGB_CTX->GetFramebufferBindingSlot(FramebufferTarget::Draw).GetBoundObject()->IsDefaultFramebuffer(); + const Bool wire = MG_Config::Transport != MG_Config::TransportMode::Monolith; + const auto* wireFbo = wire ? MG_Pipe::MGPipeApplier().DrawFramebuffer() : nullptr; + const auto currentDrawFBO = wire ? SharedPtr{} : + MGB_CTX->GetFramebufferBindingSlot(FramebufferTarget::Draw).GetBoundObject(); + const Bool isDefault = wire ? (wireFbo && wireFbo->IsDefault) : + (currentDrawFBO && currentDrawFBO->IsDefaultFramebuffer()); #else const auto& currentDrawFBO = MGB_CTX->GetFramebufferBindingSlot(FramebufferTarget::Draw).GetBoundObject(); const Bool isDefault = currentDrawFBO != nullptr && currentDrawFBO->IsDefaultFramebuffer();