Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect handling of Debug Marker functions #1286

Conversation

charles-lunarg
Copy link
Collaborator

The implementation for VK_KHR_maintenance_5 exposed a bug in how the function
for debug_marker functions were gotten. The bug was to only check if a
driver supports a physical device when querying for device function pointers,
which ignores the possibility of a layer supporting a device extension. This
is an issue for VK_EXT_debug_marker, which requires trampoline functions to
properly unwrap data passed in, resulting in the various debug marker functions
returning NULL instead of a valid function pointer.

The implementation for VK_KHR_maintenance_5 exposed a bug in how the function
for debug_marker functions were gotten. The bug was to only check if a
driver supports a physical device when querying for device function pointers,
which ignores the possibility of a layer supporting a device extension. This
is an issue for VK_EXT_debug_marker, which requires trampoline functions to
properly unwrap data passed in, resulting in the various debug marker functions
returning NULL instead of a valid function pointer.
@ci-tester-lunarg
Copy link

CI Vulkan-Loader build queued with queue ID 37128.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 2141 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 2141 failed.

@@ -197,7 +205,7 @@ struct loader_device {
bool ext_debug_marker_enabled;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be removed from driver_extensions?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because this is to determine if to call down from the terminator into the driver instead.

Copy link
Contributor

@ziga-lunarg ziga-lunarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, fixes my issue

@charles-lunarg charles-lunarg force-pushed the fix_device_extensions_enabled_in_layers branch from 7f77ef1 to ad7a526 Compare September 6, 2023 20:42
@ci-tester-lunarg
Copy link

CI Vulkan-Loader build queued with queue ID 37628.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 2142 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 2142 failed.

Debug utils, debug report, and debug marker are now supported directly in the
test layer, allowing easy testing of the behavior of layers which support
these debug extensions.

This allows testing the matrix of combinations between drivers, layers, and
loader support for these debug extensions.

This commit also adds a 'injected_extension' concept into the test_layer,
which allows recreating the behavior of layers which modify the extension
list returned by the driver.
@charles-lunarg charles-lunarg force-pushed the fix_device_extensions_enabled_in_layers branch from ad7a526 to 64055f0 Compare September 7, 2023 21:09
@ci-tester-lunarg
Copy link

CI Vulkan-Loader build queued with queue ID 38247.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 2143 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 2143 failed.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build queued with queue ID 38940.

Destroyed devices need to be removed from the test_layer's created_devices
vector, so that it doesn't accidentally mistake dead devices for alive ones
when checking for whether a device extension is supported or not.

This caused multiple days of debugging headache as it caused sporadic test
failures due to the re-use of VkDevice handle values (which is caused by
the memory manager reusing allocations). Since a second VkDevice could share
the handle value of the first, and the first wasn't removed from the vector,
test_layer would use the data assocated with the first device by mistake.
@charles-lunarg charles-lunarg force-pushed the fix_device_extensions_enabled_in_layers branch from 6e168be to bb30aec Compare September 8, 2023 20:31
@ci-tester-lunarg
Copy link

CI Vulkan-Loader build queued with queue ID 38951.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 2147 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 2147 passed.

@charles-lunarg charles-lunarg merged commit 7eb9da1 into KhronosGroup:main Sep 8, 2023
38 checks passed
@charles-lunarg charles-lunarg deleted the fix_device_extensions_enabled_in_layers branch September 8, 2023 21:56
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.

3 participants