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

Vulkan: Fix trace crash with Vulkan loaders #1799

Merged
merged 1 commit into from
Apr 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/vulkan/vk_virtual_swapchain/cc/layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ namespace swapchain {
// Sets the key of the dispatch tables used in lower layers of the parent
// dispatchable handle to the new child dispatchable handle. This is necessary
// as lower layers may use that key to find the dispatch table, and a child
// handles should share the same dispatch table key. E.g. VkCommandBuffer is a
// handle should share the same dispatch table key. E.g. VkCommandBuffer is a
// child dispatchable handle of VkDevice, all the VkCommandBuffer dispatching
// functions are actually device functions (resolved by VkGetDeviceProcAddress).
// ref: https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/blob/master/loader/LoaderAndLayerInterface.md#creating-new-dispatchable-objects,
// Ref: https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/blob/master/loader/LoaderAndLayerInterface.md#creating-new-dispatchable-objects,
static inline void set_dispatch_from_parent(void* child, void* parent) {
*((const void**)child) = *((const void**)parent);
}
Expand Down Expand Up @@ -252,4 +252,4 @@ Context &GetGlobalContext();

} // swapchain

#endif // VK_VIRTUAL_SWAPCHAIN_LAYER_H
#endif // VK_VIRTUAL_SWAPCHAIN_LAYER_H
6 changes: 6 additions & 0 deletions gapii/cc/vulkan_mid_execution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ class StagingCommandBuffer {

device_functions_.vkAllocateCommandBuffers(device, &allocate_info,
&command_buffer_);
// Set the key of the dispatch tables used in lower layers of the parent
// dispatchable handle to the new child dispatchable handle. This is
// necessary as lower layers may use that key to find the dispatch table,
// and a child handle should share the same dispatch table key.
// Ref: https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/blob/master/loader/LoaderAndLayerInterface.md#creating-new-dispatchable-objects
*((const void**)command_buffer_) = *((const void**)device_);

VkCommandBufferBeginInfo begin_info = {
VkStructureType::VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, // sType
Expand Down