diff --git a/MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp b/MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp index 2890a878..6e45da15 100644 --- a/MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp +++ b/MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp @@ -4482,6 +4482,12 @@ void main() { } Bool VulkanRenderer::InitializeBlitResources() { +#if MOBILEGL_BUILD_DISAGGREGATED + // P5f fv: both window and headless transports use WireFramebuffer's native + // operations. These hidden programs are frontend objects, so even creating + // them on the server would retain a client compiler/allocator dependency. + if (MG_Config::Transport != MG_Config::TransportMode::Monolith) return true; +#endif ShutdownBlitResources(); auto vertexShader = MakeShared(ShaderStage::Vertex, kHiddenBlitVertexShaderId); @@ -4574,6 +4580,12 @@ void main() { } Bool VulkanRenderer::InitializeDepthMipmapResources() { +#if MOBILEGL_BUILD_DISAGGREGATED + // P5f fv: both window and headless transports use WireFramebuffer's native + // operations. These hidden programs are frontend objects, so even creating + // them on the server would retain a client compiler/allocator dependency. + if (MG_Config::Transport != MG_Config::TransportMode::Monolith) return true; +#endif ShutdownDepthMipmapResources(); auto vertexShader = MakeShared(ShaderStage::Vertex, diff --git a/MobileGL/MG_Test/Wire/ServerLoopTest.cpp b/MobileGL/MG_Test/Wire/ServerLoopTest.cpp index bdcd0e24..ef0b73ee 100644 --- a/MobileGL/MG_Test/Wire/ServerLoopTest.cpp +++ b/MobileGL/MG_Test/Wire/ServerLoopTest.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -2293,6 +2294,33 @@ namespace { }; } +namespace { + // Exercise the real hidden-resource constructors without adding a production test API. + // Explicit template instantiation permits naming a private member ([temp.explicit]). + using FvRenderer = MG_Backend::DirectVulkan::VulkanRenderer; + struct FvBlitInitTag { + using type = Bool (FvRenderer::*)(); + friend type FvPrivateMember(FvBlitInitTag); + }; + struct FvMipmapInitTag { + using type = Bool (FvRenderer::*)(); + friend type FvPrivateMember(FvMipmapInitTag); + }; + template struct FvMemberAccess { + friend typename Tag::type FvPrivateMember(Tag) { return Member; } + }; + template struct FvMemberAccess; + template struct FvMemberAccess; +} + +TEST(P5fReverseChannel, TransportDoesNotConstructHiddenFrontendPrograms) { + // No Vulkan device, program factory or client GLContext is supplied. A transport + // initialization must not need any of them merely to skip these monolith resources. + FvRenderer renderer({}); + EXPECT_TRUE((renderer.*FvPrivateMember(FvBlitInitTag{}))()); + EXPECT_TRUE((renderer.*FvPrivateMember(FvMipmapInitTag{}))()); +} + TEST(P5fReverseChannel, GlErrorsUseTheOwnedCallbackWithoutAResidualPull) { FvGlobals restore; MG_Config::Ipc.StrictErrors = true;