From 6b97641138ad8312292da25b163cabf5ec5bb6fa Mon Sep 17 00:00:00 2001 From: Chris Steinberg Date: Tue, 10 Nov 2026 14:54:38 -0600 Subject: [PATCH 1/2] Add support for dumping VkFrameBoundaryANDROID command --- layersvt/api_dump.h | 19 +++-- layersvt/api_dump_handwritten_functions.h | 59 +++++++++++++- layersvt/test/test_api_dump.cpp | 94 +++++++++++++++++++++-- 3 files changed, 158 insertions(+), 14 deletions(-) diff --git a/layersvt/api_dump.h b/layersvt/api_dump.h index e850d68ab9..286ca21e86 100644 --- a/layersvt/api_dump.h +++ b/layersvt/api_dump.h @@ -1384,7 +1384,8 @@ class ApiDumpInstance { // Called from vkQueuePresentKHR, from vkQueueSubmit/vkQueueSubmit2 when a chained // VkFrameBoundaryEXT marks the end of a frame (see checkFrameBoundaryInSubmit), and from - // vkFrameBoundaryANDROID. Always advances frame_count and the frame's own JSON markup, + // vkFrameBoundaryANDROID. All three write the call that ends the frame into the dump before + // calling this, so it is the last entry of the frame it closes. Always advances frame_count and the frame's own JSON markup, // regardless of capture_trigger_boundary - a frame boundary is a frame boundary independent of // what output_range/capture_trigger is currently counting. See notifyQueueSubmit for the // independent counter used for range/trigger decisions when the boundary is queue_submits. @@ -1446,13 +1447,17 @@ class ApiDumpInstance { // (GetCommandNumberAPIDUMP via GetInstanceProcAddr). void setFrameBoundaryAndroidFunction(PFN_vkFrameBoundaryANDROID fp) { next_frame_boundary_android = fp; } - // Hand-written interception for vkFrameBoundaryANDROID. Forwards to the resolved pointer so the - // app's call still reaches the driver - it is void, so there is nothing to fail even if no - // driver below actually implements it - then advances the real frame counter the same way any - // other genuine frame-boundary signal does. - void frameBoundaryAndroid(VkDevice device, VkSemaphore semaphore, VkImage image) { + // Forwards a vkFrameBoundaryANDROID to the resolved pointer so the app's call still reaches the + // driver - it is void, so there is nothing to fail even if no driver below actually implements it. + // + // Deliberately does not advance the frame counter: the interception (layer_vkFrameBoundaryANDROID) + // has to write the call into the dump first, so that it lands in the frame it ends, and only then + // call nextFrame() - the same order vkQueuePresentKHR uses. Without the entry in the dump, a frame + // that ends here has no visible reason to have ended, which is how an app whose UI renderer calls + // this on one thread while another thread presents ends up with frames that contain neither a + // present nor a submit. + void forwardFrameBoundaryAndroid(VkDevice device, VkSemaphore semaphore, VkImage image) { if (next_frame_boundary_android) next_frame_boundary_android(device, semaphore, image); - nextFrame(); } // The number assigned to the command currently being dumped. Only advanced in dump_function_head diff --git a/layersvt/api_dump_handwritten_functions.h b/layersvt/api_dump_handwritten_functions.h index 4c561a8034..eba916f5eb 100644 --- a/layersvt/api_dump_handwritten_functions.h +++ b/layersvt/api_dump_handwritten_functions.h @@ -149,6 +149,33 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDevice(VkPhysicalDevice physicalDevice, c return result; } +// vkFrameBoundaryANDROID is not in the generated dump code (see VK_ANDROID_frame_boundary.h), so its dump +// is written by hand, in the shape the generator gives every other void command. These are templates, +// so they have to sit outside the extern "C" block below that holds layer_vkFrameBoundaryANDROID. +template +void dump_params_vkFrameBoundaryANDROID(ApiDumpInstance& dump_inst, VkDevice device, VkSemaphore semaphore, VkImage image) { + const ApiDumpSettings& settings(dump_inst.settings()); + if (settings.showParams()) { + dump_pre_params_formatting(settings); + dump_VkDevice(device, settings, "VkDevice", "device", (Format == ApiDumpFormat::Json ? 4 : 1)); + dump_separate_members(settings); + dump_VkSemaphore(semaphore, settings, "VkSemaphore", "semaphore", (Format == ApiDumpFormat::Json ? 4 : 1)); + dump_separate_members(settings); + dump_VkImage(image, settings, "VkImage", "image", (Format == ApiDumpFormat::Json ? 4 : 1)); + dump_post_params_formatting(settings); + flush(settings); + } +} + +template +void dump_vkFrameBoundaryANDROID(VkDevice device, VkSemaphore semaphore, VkImage image) { + ApiDumpInstance& dump_inst = ApiDumpInstance::current(); + dump_pre_function_formatting(dump_inst.settings()); + dump_params_vkFrameBoundaryANDROID(dump_inst, device, semaphore, image); + dump_post_function_formatting(dump_inst.settings()); + flush(dump_inst.settings()); +} + extern "C" { VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vk_layerGetPhysicalDeviceProcAddr(VkInstance instance, const char* funcName) { @@ -226,9 +253,37 @@ EXPORT_FUNCTION VKAPI_ATTR VkResult VKAPI_CALL layer_vkEnumerateDeviceExtensionP // vkFrameBoundaryANDROID has no dispatch-table slot (see VK_ANDROID_frame_boundary.h), so unlike // every generated entry point it cannot be reached through device_dispatch_table(device)->X - it is // caught by name instead, in layer_vkGetInstanceProcAddr/layer_vkGetDeviceProcAddr below. +// +// The call is dumped like any other, and before the frame counter advances, so it is the last entry of +// the frame it ends - what lets a consumer of the dump see why the frame ended. VKAPI_ATTR void VKAPI_CALL layer_vkFrameBoundaryANDROID(VkDevice device, VkSemaphore semaphore, VkImage image) { - std::lock_guard lg(ApiDumpInstance::current().outputMutex()); - ApiDumpInstance::current().frameBoundaryAndroid(device, semaphore, image); + ApiDumpInstance& dump_inst = ApiDumpInstance::current(); + std::lock_guard lg(dump_inst.outputMutex()); + + dump_function_head(dump_inst, "vkFrameBoundaryANDROID", "device, semaphore, image", "void"); + if (dump_inst.settings().shouldPreDump() && dump_inst.settings().format() == ApiDumpFormat::Text && + dump_inst.shouldDumpOutput()) { + dump_before_pre_dump_formatting(dump_inst.settings()); + dump_params_vkFrameBoundaryANDROID(dump_inst, device, semaphore, image); + } + + dump_inst.forwardFrameBoundaryAndroid(device, semaphore, image); + + if (dump_inst.shouldDumpOutput()) { + switch (dump_inst.settings().format()) { + case ApiDumpFormat::Text: + dump_vkFrameBoundaryANDROID(device, semaphore, image); + break; + case ApiDumpFormat::Html: + dump_vkFrameBoundaryANDROID(device, semaphore, image); + break; + case ApiDumpFormat::Json: + dump_vkFrameBoundaryANDROID(device, semaphore, image); + break; + } + } + + dump_inst.nextFrame(); } EXPORT_FUNCTION VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties(uint32_t* pPropertyCount, diff --git a/layersvt/test/test_api_dump.cpp b/layersvt/test/test_api_dump.cpp index 636933515b..e2e45a0d47 100644 --- a/layersvt/test/test_api_dump.cpp +++ b/layersvt/test/test_api_dump.cpp @@ -79,6 +79,74 @@ TEST_F(ApiDumpTests, init_layer) { EXPECT_STREQ(file_start_content_read.c_str(), file_start_content_expected); } +// vkFrameBoundaryANDROID is not in the registry, so the generator never emitted a dump for it. The +// layer has to write the call itself, as the last entry of the frame it ends - otherwise a frame can +// end with nothing in the dump to say why. +TEST_F(ApiDumpTests, FrameBoundaryAndroidIsDumpedAsTheLastCallOfTheFrameItEnds) { + const char* filename_string = "api_dump_frame_boundary_android.json"; + std::remove(filename_string); + + VkBool32 use_file = VK_TRUE; + const char* output_format = "json"; + const std::vector settings = { + {kLayerName, "file", VK_LAYER_SETTING_TYPE_BOOL32_EXT, 1, &use_file}, + {kLayerName, "log_filename", VK_LAYER_SETTING_TYPE_STRING_EXT, 1, &filename_string}, + {kLayerName, "output_format", VK_LAYER_SETTING_TYPE_STRING_EXT, 1, &output_format}}; + + { + layer_test::VulkanInstanceBuilder inst_builder; + ASSERT_EQ(inst_builder.Init(settings), VK_SUCCESS); + + VkPhysicalDevice physical_device = VK_NULL_HANDLE; + if (inst_builder.GetPhysicalDevice(&physical_device) != VK_SUCCESS || physical_device == VK_NULL_HANDLE) { + GTEST_SKIP() << "no physical device to create a device on"; + } + + float priority = 1.0f; + VkDeviceQueueCreateInfo queue_info{VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO}; + queue_info.queueFamilyIndex = 0; + queue_info.queueCount = 1; + queue_info.pQueuePriorities = &priority; + VkDeviceCreateInfo device_info{VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO}; + device_info.queueCreateInfoCount = 1; + device_info.pQueueCreateInfos = &queue_info; + + VkDevice device = VK_NULL_HANDLE; + ASSERT_EQ(vkCreateDevice(physical_device, &device_info, nullptr, &device), VK_SUCCESS); + + // Resolved by name, like an app does: the layer answers for it whether or not the driver + // below implements the extension. + auto fp = reinterpret_cast( + vkGetDeviceProcAddr(device, "vkFrameBoundaryANDROID")); + ASSERT_NE(fp, nullptr); + fp(device, VK_NULL_HANDLE, VK_NULL_HANDLE); + + vkDestroyDevice(device, nullptr); + } + + std::ifstream stream(filename_string); + ASSERT_TRUE(stream.good()); + const std::string dump((std::istreambuf_iterator(stream)), std::istreambuf_iterator()); + stream.close(); + std::remove(filename_string); + + const size_t boundary_call = dump.find("\"name\" : \"vkFrameBoundaryANDROID\""); + ASSERT_NE(boundary_call, std::string::npos) << dump; + const size_t frame_one = dump.find("\"frameNumber\" : \"1\""); + ASSERT_NE(frame_one, std::string::npos) << dump; + + // Written into the frame it ends (frame 0), not the one that opens after it. + EXPECT_LT(boundary_call, frame_one); + const size_t frame_zero = dump.find("\"frameNumber\" : \"0\""); + ASSERT_NE(frame_zero, std::string::npos); + EXPECT_LT(frame_zero, boundary_call); + + // And the vkDestroyDevice after it belongs to frame 1. + const size_t destroy_call = dump.find("\"name\" : \"vkDestroyDevice\""); + ASSERT_NE(destroy_call, std::string::npos); + EXPECT_GT(destroy_call, frame_one); +} + // ConditionalFrameOutput parses output_range/output_range_queue_submits strings and answers // isFrameInRange for them. Neither needs a Vulkan device, so these test it directly rather than // through a full capture. @@ -346,16 +414,32 @@ TEST_F(ApiDumpInstanceTests, QueueSubmitIsNeverSetupContentInFramesBoundary) { EXPECT_FALSE(instance.currentCommandIsSetup()); } -TEST_F(ApiDumpInstanceTests, FrameBoundaryAndroidAdvancesFrameCountWithNoDriverResolved) { +static int g_frame_boundary_android_calls = 0; +static void VKAPI_CALL CountingFrameBoundaryAndroid(VkDevice, VkSemaphore, VkImage) { ++g_frame_boundary_android_calls; } + +TEST_F(ApiDumpInstanceTests, ForwardFrameBoundaryAndroidWithNoDriverResolvedDoesNotCrash) { // The driver-forwarding pointer is resolved separately at CreateDevice time (see - // api_dump_handwritten_functions.h); this only exercises the interception's own behavior, which - // must not crash and must still advance the real frame counter when nothing is resolved yet. + // api_dump_handwritten_functions.h); with nothing resolved yet the forward must be a no-op. + // It must not advance the frame counter either: layer_vkFrameBoundaryANDROID dumps the call first + // and only then calls nextFrame(), so the call is the last entry of the frame it ends. ApiDumpInstance instance; InitWithSettings(instance, {}); - instance.frameBoundaryAndroid(VK_NULL_HANDLE, VK_NULL_HANDLE, VK_NULL_HANDLE); + instance.forwardFrameBoundaryAndroid(VK_NULL_HANDLE, VK_NULL_HANDLE, VK_NULL_HANDLE); - EXPECT_EQ(instance.frameCount(), 1u); + EXPECT_EQ(instance.frameCount(), 0u); +} + +TEST_F(ApiDumpInstanceTests, ForwardFrameBoundaryAndroidReachesTheResolvedDriverFunction) { + ApiDumpInstance instance; + InitWithSettings(instance, {}); + g_frame_boundary_android_calls = 0; + instance.setFrameBoundaryAndroidFunction(CountingFrameBoundaryAndroid); + + instance.forwardFrameBoundaryAndroid(VK_NULL_HANDLE, VK_NULL_HANDLE, VK_NULL_HANDLE); + + EXPECT_EQ(g_frame_boundary_android_calls, 1); + EXPECT_EQ(instance.frameCount(), 0u); } // --------------------------------------------------------------------------------------------------- From 18250eb5156e2bc087f09f4047492177b46c5b0e Mon Sep 17 00:00:00 2001 From: Chris Steinberg Date: Wed, 11 Nov 2026 11:10:48 -0600 Subject: [PATCH 2/2] Pr feedback --- layersvt/api_dump.h | 54 +++++++++++++++++++-- layersvt/api_dump_handwritten_functions.h | 48 ++++++------------ layersvt/test/test_api_dump.cpp | 59 +++++++++++++++++++++++ 3 files changed, 123 insertions(+), 38 deletions(-) diff --git a/layersvt/api_dump.h b/layersvt/api_dump.h index 286ca21e86..262ec173f2 100644 --- a/layersvt/api_dump.h +++ b/layersvt/api_dump.h @@ -1384,8 +1384,10 @@ class ApiDumpInstance { // Called from vkQueuePresentKHR, from vkQueueSubmit/vkQueueSubmit2 when a chained // VkFrameBoundaryEXT marks the end of a frame (see checkFrameBoundaryInSubmit), and from - // vkFrameBoundaryANDROID. All three write the call that ends the frame into the dump before - // calling this, so it is the last entry of the frame it closes. Always advances frame_count and the frame's own JSON markup, + // vkFrameBoundaryANDROID. Each dumps the call that triggers the boundary before calling this, so + // that call lands in the frame it closes. That does not make it the only thing a frame can end on: + // a vkQueueSubmit2 with several end-flagged submits calls this once per submit, and the extra + // frames it closes are empty. Always advances frame_count and the frame's own JSON markup, // regardless of capture_trigger_boundary - a frame boundary is a frame boundary independent of // what output_range/capture_trigger is currently counting. See notifyQueueSubmit for the // independent counter used for range/trigger decisions when the boundary is queue_submits. @@ -1706,8 +1708,8 @@ class ApiDumpInstance { uint64_t command_count; // The next layer/driver's real vkFrameBoundaryANDROID, resolved once at CreateDevice - see - // setFrameBoundaryAndroidFunction/frameBoundaryAndroid. Null until then, and whenever nothing - // below actually implements it. + // setFrameBoundaryAndroidFunction/forwardFrameBoundaryAndroid. Null until then, and whenever + // nothing below actually implements it. PFN_vkFrameBoundaryANDROID next_frame_boundary_android = nullptr; std::mutex thread_mutex; @@ -2748,6 +2750,50 @@ inline void dump_function_head(ApiDumpInstance &dump_inst, const char *funcName, } } +// Everything the layer does for an app's vkFrameBoundaryANDROID, in order: dump the call, forward it +// to whatever implements it below, then close the frame - so the call is the last entry of the frame +// it ends, the same order vkQueuePresentKHR uses. Must be called with the output mutex held. +// +// Lives here, apart from the layer entry point, so the order and the frame advance can be tested +// without a device. The one part that cannot live here is writing the parameters, which need the +// generated dump functions this header cannot see: `params_dumper` is called as +// params_dumper.template operator()(dump_inst) and has to dump just the parameters. +template +inline void handle_frame_boundary_android(ApiDumpInstance &dump_inst, VkDevice device, VkSemaphore semaphore, VkImage image, + ParamsDumper &¶ms_dumper) { + dump_function_head(dump_inst, "vkFrameBoundaryANDROID", "device, semaphore, image", "void"); + if (dump_inst.settings().shouldPreDump() && dump_inst.settings().format() == ApiDumpFormat::Text && + dump_inst.shouldDumpOutput()) { + dump_before_pre_dump_formatting(dump_inst.settings()); + params_dumper.template operator()(dump_inst); + } + + dump_inst.forwardFrameBoundaryAndroid(device, semaphore, image); + + if (dump_inst.shouldDumpOutput()) { + switch (dump_inst.settings().format()) { + case ApiDumpFormat::Text: + dump_pre_function_formatting(dump_inst.settings()); + params_dumper.template operator()(dump_inst); + dump_post_function_formatting(dump_inst.settings()); + break; + case ApiDumpFormat::Html: + dump_pre_function_formatting(dump_inst.settings()); + params_dumper.template operator()(dump_inst); + dump_post_function_formatting(dump_inst.settings()); + break; + case ApiDumpFormat::Json: + dump_pre_function_formatting(dump_inst.settings()); + params_dumper.template operator()(dump_inst); + dump_post_function_formatting(dump_inst.settings()); + break; + } + flush(dump_inst.settings()); + } + + dump_inst.nextFrame(); +} + //==================================== Exposed Query Functions ======================================// // Lets other layers poll the commandNumber of the last command api_dump wrote, to correlate their diff --git a/layersvt/api_dump_handwritten_functions.h b/layersvt/api_dump_handwritten_functions.h index eba916f5eb..a3efab0a94 100644 --- a/layersvt/api_dump_handwritten_functions.h +++ b/layersvt/api_dump_handwritten_functions.h @@ -167,14 +167,17 @@ void dump_params_vkFrameBoundaryANDROID(ApiDumpInstance& dump_inst, VkDevice dev } } -template -void dump_vkFrameBoundaryANDROID(VkDevice device, VkSemaphore semaphore, VkImage image) { - ApiDumpInstance& dump_inst = ApiDumpInstance::current(); - dump_pre_function_formatting(dump_inst.settings()); - dump_params_vkFrameBoundaryANDROID(dump_inst, device, semaphore, image); - dump_post_function_formatting(dump_inst.settings()); - flush(dump_inst.settings()); -} +// What handle_frame_boundary_android (api_dump.h) calls to write the parameters, once per format. +struct FrameBoundaryAndroidParamsDumper { + VkDevice device; + VkSemaphore semaphore; + VkImage image; + + template + void operator()(ApiDumpInstance& dump_inst) const { + dump_params_vkFrameBoundaryANDROID(dump_inst, device, semaphore, image); + } +}; extern "C" { @@ -255,35 +258,12 @@ EXPORT_FUNCTION VKAPI_ATTR VkResult VKAPI_CALL layer_vkEnumerateDeviceExtensionP // caught by name instead, in layer_vkGetInstanceProcAddr/layer_vkGetDeviceProcAddr below. // // The call is dumped like any other, and before the frame counter advances, so it is the last entry of -// the frame it ends - what lets a consumer of the dump see why the frame ended. +// the frame it ends - what lets a consumer of the dump see why the frame ended. The sequence itself is +// handle_frame_boundary_android (api_dump.h), where it can be tested without a device. VKAPI_ATTR void VKAPI_CALL layer_vkFrameBoundaryANDROID(VkDevice device, VkSemaphore semaphore, VkImage image) { ApiDumpInstance& dump_inst = ApiDumpInstance::current(); std::lock_guard lg(dump_inst.outputMutex()); - - dump_function_head(dump_inst, "vkFrameBoundaryANDROID", "device, semaphore, image", "void"); - if (dump_inst.settings().shouldPreDump() && dump_inst.settings().format() == ApiDumpFormat::Text && - dump_inst.shouldDumpOutput()) { - dump_before_pre_dump_formatting(dump_inst.settings()); - dump_params_vkFrameBoundaryANDROID(dump_inst, device, semaphore, image); - } - - dump_inst.forwardFrameBoundaryAndroid(device, semaphore, image); - - if (dump_inst.shouldDumpOutput()) { - switch (dump_inst.settings().format()) { - case ApiDumpFormat::Text: - dump_vkFrameBoundaryANDROID(device, semaphore, image); - break; - case ApiDumpFormat::Html: - dump_vkFrameBoundaryANDROID(device, semaphore, image); - break; - case ApiDumpFormat::Json: - dump_vkFrameBoundaryANDROID(device, semaphore, image); - break; - } - } - - dump_inst.nextFrame(); + handle_frame_boundary_android(dump_inst, device, semaphore, image, FrameBoundaryAndroidParamsDumper{device, semaphore, image}); } EXPORT_FUNCTION VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties(uint32_t* pPropertyCount, diff --git a/layersvt/test/test_api_dump.cpp b/layersvt/test/test_api_dump.cpp index e2e45a0d47..07f8e11eb6 100644 --- a/layersvt/test/test_api_dump.cpp +++ b/layersvt/test/test_api_dump.cpp @@ -101,6 +101,14 @@ TEST_F(ApiDumpTests, FrameBoundaryAndroidIsDumpedAsTheLastCallOfTheFrameItEnds) if (inst_builder.GetPhysicalDevice(&physical_device) != VK_SUCCESS || physical_device == VK_NULL_HANDLE) { GTEST_SKIP() << "no physical device to create a device on"; } + // The call below passes null semaphore and image, which the layer forwards to whatever it + // resolved below itself at vkCreateDevice. Harmless where nothing implements the function, but + // where a driver or lower layer does (Android), that would be an invalid call into real code. + // The test only needs the layer to answer by name, so it does not run there. + if (layer_test::IsExtensionSupported(physical_device, "VK_ANDROID_frame_boundary")) { + GTEST_SKIP() << "something below the layer implements VK_ANDROID_frame_boundary; " + "not calling it with null handles"; + } float priority = 1.0f; VkDeviceQueueCreateInfo queue_info{VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO}; @@ -442,6 +450,57 @@ TEST_F(ApiDumpInstanceTests, ForwardFrameBoundaryAndroidReachesTheResolvedDriver EXPECT_EQ(instance.frameCount(), 0u); } +// The frame count as each step of handle_frame_boundary_android saw it. The helper is what +// layer_vkFrameBoundaryANDROID runs, and unlike the layer entry point it needs no device - so this is +// the device-free check that a vkFrameBoundaryANDROID dumps the call, forwards it, and only then +// advances the frame. (The parameter dump itself is generated code the test cannot include; it is +// stood in for here, and covered end to end by ApiDumpTests.FrameBoundaryAndroid...) +static ApiDumpInstance* g_boundary_instance = nullptr; +static std::vector g_frame_count_at_dump; +static std::vector g_frame_count_at_forward; + +static void VKAPI_CALL RecordingFrameBoundaryAndroid(VkDevice, VkSemaphore, VkImage) { + g_frame_count_at_forward.push_back(g_boundary_instance->frameCount()); +} + +struct RecordingParamsDumper { + template + void operator()(ApiDumpInstance& dump_inst) const { + g_frame_count_at_dump.push_back(dump_inst.frameCount()); + } +}; + +TEST_F(ApiDumpInstanceTests, FrameBoundaryAndroidIsDumpedAndForwardedBeforeTheFrameAdvances) { + ApiDumpInstance instance; + InitWithSettings(instance, {}); + g_boundary_instance = &instance; + g_frame_count_at_dump.clear(); + g_frame_count_at_forward.clear(); + instance.setFrameBoundaryAndroidFunction(RecordingFrameBoundaryAndroid); + + handle_frame_boundary_android(instance, VK_NULL_HANDLE, VK_NULL_HANDLE, VK_NULL_HANDLE, RecordingParamsDumper{}); + + // Both happen while the call's own frame (0) is still the current one, and exactly once each... + EXPECT_EQ(g_frame_count_at_forward, std::vector{0}); + EXPECT_EQ(g_frame_count_at_dump, std::vector{0}); + // ...and then the frame advances, which only this helper does for vkFrameBoundaryANDROID. + EXPECT_EQ(instance.frameCount(), 1u); + g_boundary_instance = nullptr; +} + +TEST_F(ApiDumpInstanceTests, FrameBoundaryAndroidStillAdvancesTheFrameWithNoDriverResolved) { + ApiDumpInstance instance; + InitWithSettings(instance, {}); + g_frame_count_at_dump.clear(); + + handle_frame_boundary_android(instance, VK_NULL_HANDLE, VK_NULL_HANDLE, VK_NULL_HANDLE, RecordingParamsDumper{}); + handle_frame_boundary_android(instance, VK_NULL_HANDLE, VK_NULL_HANDLE, VK_NULL_HANDLE, RecordingParamsDumper{}); + + // Each call is dumped into the frame it ends: 0, then 1. + EXPECT_EQ(g_frame_count_at_dump, (std::vector{0, 1})); + EXPECT_EQ(instance.frameCount(), 2u); +} + // --------------------------------------------------------------------------------------------------- // Asynchronous file writes (async_write / buffer_size_kb), and the formatting helpers that were made // cheaper alongside them. Everything here has to produce exactly what the code it replaced produced.