Skip to content

layersvt: Add debugmarker device key, remove on null, and remove on destroy - #50

Merged
olehkuznetsov merged 4 commits into
android-graphics:mainfrom
olehkuznetsov:pr-debugmarker-remove-on-destroy
Oct 28, 2026
Merged

olehkuznetsov merged 4 commits into
android-graphics:mainfrom
olehkuznetsov:pr-debugmarker-remove-on-destroy

Conversation

@olehkuznetsov

Copy link
Copy Markdown

This PR merges the remaining changes from the stacked debugmarker PR chain (#46, #47, #48) into main:

@olehkuznetsov
olehkuznetsov force-pushed the pr-debugmarker-remove-on-destroy branch from e12a3c3 to f03feff Compare October 26, 2026 17:34
@olehkuznetsov
olehkuznetsov requested review from jimblacklercorp and removed request for jimblacklercorp October 26, 2026 17:36
@olehkuznetsov
olehkuznetsov changed the base branch from main to fix-perfetto-deprecated-declarations October 26, 2026 18:29
@olehkuznetsov
olehkuznetsov force-pushed the pr-debugmarker-remove-on-destroy branch from f03feff to 3a69d95 Compare October 26, 2026 18:30
@olehkuznetsov
olehkuznetsov force-pushed the pr-debugmarker-remove-on-destroy branch from 3a69d95 to e35f9ed Compare October 28, 2026 00:26
@olehkuznetsov
olehkuznetsov changed the base branch from fix-perfetto-deprecated-declarations to main October 28, 2026 00:26
Comment thread layersvt/test/test_debugmarker.cpp Outdated
Comment thread layersvt/test/test_debugmarker.cpp Outdated
Comment thread layersvt/test/test_debugmarker.cpp Outdated
Comment thread layersvt/test/test_debugmarker.cpp Outdated
Comment thread layersvt/test/test_debugmarker.cpp
Comment thread layersvt/test/test_debugmarker.cpp
Comment thread layersvt/debug_marker/debug_marker.cpp Outdated
Comment thread layersvt/debug_marker/debug_marker.cpp
Comment thread layersvt/debug_marker/debug_marker.cpp
Comment thread layersvt/debug_marker/debug_marker.cpp
olehkuznetsov and others added 4 commits October 28, 2026 13:56
Non-dispatchable handles are only unique within their VkDevice, so
two devices in one process can return the same handle value. Naming
an object on one device overwrote the name of an unrelated object on
another, and the lost name was missing from later session replays.
Key stored names by device as well as object type and handle.

Bug:
Test: new tests - DebugMarkerTests#SameHandleOnDifferentDevicesTest
Change-Id: I8c0edd4d958451aebf1fbd17df1cb0cb6a6a6964
…oid-graphics#47)

VK_EXT_debug_utils defines a null or empty pObjectName as removing the
object's name. DebugMarker stored and emitted the literal "NULL"
instead, so cleared objects appeared as "NULL" in traces and were
replayed under that name on every later session start.

Erase the stored name instead and emit an empty name, so trace
consumers treat the object as unnamed from that point on. The removal
is a separate method so object destruction can reuse it.

Bug:
Test: new tests - DebugMarkerTests#NullOrEmptyNameRemovesNameTest
Change-Id: Ia6d7df2386b911a0b50911ebc7c5e9176a6a6964
…phics#48)

DebugMarker kept object names until the device was destroyed. Drivers
can reuse handle values for new objects, so a new resource inherited
the stale name and trace consumers misattributed it.

Erase an object's name when its destroy or free command is called,
before dispatching downstream, so a handle reused by another thread
cannot pick up the old name. Extension destroy commands are
intercepted only when the device exposes them.

Bug:
Test: new tests - DebugMarkerTests#DestroyedObjectNamesRemovedTest, DebugMarkerTests#DestroyedObjectNamesOfOtherTypesRemovedTest, DebugMarkerTests#ExtensionDestroyCommandRequiresDownstreamTest
Change-Id: Iad9147fca27b76c329450f0b9f01802a6a6a6964
Destroying a device erased the names of its objects without telling
trace consumers. Object names are now removed one by one with an empty
name packet, so after device destruction the trace processor still
showed the old names. Its lookup has no device key, so an object with
the same handle value on a later device could resolve a stale name.

Emit an empty name packet for each object name that the device owned,
using the same packet as per-object removal. The packets are emitted
after the lock is released, because the tracing session start
observer takes the same lock to replay all names.

Bug:
Test: new tests - DebugMarkerTests#DestroyDeviceEmitsEmptyNamePacketsTest
Change-Id: I5676ac7a0fe723f32b22c19a05cfe3ef6a6a6964
@olehkuznetsov
olehkuznetsov force-pushed the pr-debugmarker-remove-on-destroy branch from e35f9ed to 96be52b Compare October 28, 2026 15:41
@olehkuznetsov
olehkuznetsov merged commit c94db40 into android-graphics:main Oct 28, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants