Skip to content

layersvt: Key DebugMarker object names by device - #46

Merged
olehkuznetsov merged 1 commit into
android-graphics:pr-debugmarker-clock-pidfrom
olehkuznetsov:pr-debugmarker-device-key
Oct 26, 2026
Merged

olehkuznetsov merged 1 commit into
android-graphics:pr-debugmarker-clock-pidfrom
olehkuznetsov:pr-debugmarker-device-key

Conversation

@olehkuznetsov

Copy link
Copy Markdown

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

@olehkuznetsov
olehkuznetsov changed the base branch from main to pr-debugmarker-clock-pid October 15, 2026 16:06
@olehkuznetsov
olehkuznetsov force-pushed the pr-debugmarker-device-key branch from fd5e79b to 317d9f9 Compare October 19, 2026 09:12
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
@olehkuznetsov
olehkuznetsov force-pushed the pr-debugmarker-clock-pid branch from 6b4218f to 31f5e38 Compare October 19, 2026 09:18
@olehkuznetsov
olehkuznetsov force-pushed the pr-debugmarker-device-key branch from 317d9f9 to ce7f840 Compare October 19, 2026 09:18
Comment thread layersvt/debug_marker/debug_marker.h Resolved
Comment thread layersvt/test/test_debugmarker.cpp Resolved
@olehkuznetsov
olehkuznetsov merged commit f507037 into android-graphics:pr-debugmarker-clock-pid Oct 26, 2026
9 checks passed
olehkuznetsov added a commit to olehkuznetsov/VulkanTools that referenced this pull request Oct 26, 2026
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
olehkuznetsov added a commit to olehkuznetsov/VulkanTools that referenced this pull request Oct 26, 2026
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
olehkuznetsov added a commit to olehkuznetsov/VulkanTools that referenced this pull request Oct 28, 2026
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
olehkuznetsov added a commit to olehkuznetsov/VulkanTools that referenced this pull request Oct 28, 2026
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
olehkuznetsov added a commit that referenced this pull request Oct 28, 2026
…estroy (#50)

* layersvt: Key DebugMarker object names by device (#46)

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

* layersvt: Remove DebugMarker object names on null or empty name (#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

* layersvt: Remove DebugMarker object names on destruction (#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

* layersvt: Emit empty DebugMarker names on device destruction

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
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