layersvt: Refactor DebugMarker to inherit from LayerBase - #32
Open
olehkuznetsov wants to merge 2 commits into
Open
layersvt: Refactor DebugMarker to inherit from LayerBase#32olehkuznetsov wants to merge 2 commits into
olehkuznetsov wants to merge 2 commits into
Conversation
Implement the common layer support library (layersvt_common) as an OBJECT library to provide shared, thread-safe infrastructure across Vulkan layers: - DeviceInstanceTracker: thread-safe VkPhysicalDevice to VkInstance mapping using std::shared_mutex with eager device enumeration (EagerMapDevices). - DispatchTableManager: thread-safe instance and device dispatch table storage with DispatchDownstream compile-time dispatch helper and loader callback tracking. - LayerManifest: declarative layer metadata container with downstream extension merging and Android b/143293104 compatibility workaround. - LayerBase: standardized layer lifecycle implementation with runtime loader chain validation, teardown ordering, and extensible virtual hooks for custom command interception. - layer_keep_alive: Android RTLD_NODELETE self-pinning with explicit EnsureLayerKeepAlive() to prevent static linker dead-stripping. - log.h: cross-platform VT_LOGI, VT_LOGW, VT_LOGE logging macros. - Unit test suite (test_common_layer) covering all common components, eager mapping, and lifecycle execution under a mock loader. Bug: Test: new tests Change-Id: Id6bb4faeb1e545003242b61cbdf491356a6a6964
Refactor the DebugMarker layer to inherit from LayerBase, replacing handwritten Vulkan lifecycle boilerplate and dispatch bookkeeping with shared layersvt_common infrastructure: - Inherit DebugMarker from LayerBase and configure LayerManifest with VK_EXT_debug_marker and VK_EXT_debug_utils extensions. - Replace manual instance and device dispatch tables and physical device tracking with DispatchTableManager and DeviceInstanceTracker. - Remove handwritten vkCreateInstance, vkDestroyInstance, vkCreateDevice, vkDestroyDevice, and extension enumeration boilerplate from debug_marker_handwritten_dispatch.cpp. - Implement GetLayerSpecificInstanceFunction and GetLayerSpecificDeviceFunction virtual hooks to dispatch debug marker and debug utils commands via DispatchDownstream. - Override PostDestroyDevice to automatically clean up tracked debug objects associated with destroyed logical devices. - Delete debug_marker_handwritten_functions.h header. - Add unit tests in test_debugmarker.cpp covering manifest queries, LayerBase lifecycle, object tracking cleanup, and dispatch fallback. Bug: Test: new tests - DebugMarkerTests Change-Id: I5ad00681e85f15d0779ad5dcea806b8e6a6a6964
olehkuznetsov
force-pushed
the
pr-debugmarker
branch
from
September 2, 2026 19:52
fb5ec25 to
ad83236
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Dependent PR: This PR is stacked on top of #31 (
layersvt_commonfoundation). Please review and merge #31 first.The changes specific to this PR are in
layersvt/debug_marker/andlayersvt/test/test_debugmarker.cpp.Refactor the DebugMarker layer to inherit from
LayerBase, replacing handwritten Vulkan lifecycle boilerplate and dispatch bookkeeping with sharedlayersvt_commoninfrastructure:LayerBase: inheritDebugMarkerfromLayerBaseand configureLayerManifestwithVK_EXT_debug_markerandVK_EXT_debug_utilsextensions.DispatchTableManagerandDeviceInstanceTracker.vkCreateInstance,vkDestroyInstance,vkCreateDevice,vkDestroyDevice, and extension enumeration boilerplate fromdebug_marker_handwritten_dispatch.cpp.GetLayerSpecificInstanceFunctionandGetLayerSpecificDeviceFunctionvirtual hooks to dispatch debug marker and debug utils commands viaDispatchDownstream.PostDestroyDeviceto automatically clean up tracked debug objects associated with destroyed logical devices.debug_marker_handwritten_functions.hheader.test_debugmarker.cppcovering manifest queries,LayerBaselifecycle, object tracking cleanup, and dispatch fallback.Bug:
Test: new tests - DebugMarkerTests