From 2c7d99d5e8199d260319d77a21d6a9c14ce0e91a Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Tue, 29 Sep 2026 06:33:36 -0400 Subject: [PATCH] [Test] (P11 M): the server half of a split eglSwapInterval - Magma's backend object carries the request into its table's SetSwapInterval (null before dev@c60639db) --- MobileGL/MG_Test/SanityTest.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/MobileGL/MG_Test/SanityTest.cpp b/MobileGL/MG_Test/SanityTest.cpp index c210723c..233b8c1e 100644 --- a/MobileGL/MG_Test/SanityTest.cpp +++ b/MobileGL/MG_Test/SanityTest.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -321,6 +322,22 @@ TEST(DirectVulkanSanity, AdvertisesUniformBufferObjectAndStencilTexturing) { extensions.end()); } +// P11 M: THE SERVER HALF OF A SPLIT eglSwapInterval. The client's emit-table slot forwards the +// call as one control frame (ServerLoopTest.TheEmitTableSwapIntervalSlotCrossesAsOneDispatchedFrame, +// P10 B) and the server answers it with backend->SetEGLSwapInterval, whose base implementation +// calls the backend table's SetSwapInterval. Magma's slot was null until dev@c60639db, so the +// request was dropped there on every arm. Through the backend object, as the server calls it: +// the request has to land where the next renderer and Present read it. No renderer exists here, +// so nothing is rebuilt. +TEST(DirectVulkanSanity, SetEglSwapIntervalReachesTheBackendTable) { + MobileGL::MG_Backend::DirectVulkan::BackendObject_DirectVulkan backend; + ASSERT_NE(backend.GetBackendFunctions().SetSwapInterval, nullptr); + backend.SetEGLSwapInterval(0); + EXPECT_EQ(MobileGL::MG_Backend::DirectVulkan::GetRequestedSwapInterval(), MobileGL::Optional(0)); + backend.SetEGLSwapInterval(1); + EXPECT_EQ(MobileGL::MG_Backend::DirectVulkan::GetRequestedSwapInterval(), MobileGL::Optional(1)); +} + // Voxy only ever needed the extensions, which stay advertised whatever the version is; the version // assertion just pins what the backend really reports, now that V_OpenGL40 is in the list. TEST(DirectGLESSanity, AdvertisesVoxyRequiredRenderingExtensions) {