Commit 74f6c655 by Alexis Hetu Committed by Alexis Hétu

Add basic support for VK_EXT_debug_utils

This first implementation ignores all optional functionality, so this is a very bare-bones implementation of VK_EXT_debug_utils. Bug: b/119321052 Change-Id: I8ef189b957b6d1b433846de945b7852c3d6e8190 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/46968 Presubmit-Ready: Alexis Hétu <sugoi@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 42518953
...@@ -64,6 +64,7 @@ swiftshader_source_set("swiftshader_libvulkan_headers") { ...@@ -64,6 +64,7 @@ swiftshader_source_set("swiftshader_libvulkan_headers") {
"VkCommandBuffer.hpp", "VkCommandBuffer.hpp",
"VkCommandPool.hpp", "VkCommandPool.hpp",
"VkConfig.hpp", "VkConfig.hpp",
"VkDebugUtilsMessenger.hpp",
"VkDescriptorPool.hpp", "VkDescriptorPool.hpp",
"VkDescriptorSet.hpp", "VkDescriptorSet.hpp",
"VkDescriptorSetLayout.hpp", "VkDescriptorSetLayout.hpp",
...@@ -111,6 +112,7 @@ swiftshader_shared_library("swiftshader_libvulkan") { ...@@ -111,6 +112,7 @@ swiftshader_shared_library("swiftshader_libvulkan") {
"VkBufferView.cpp", "VkBufferView.cpp",
"VkCommandBuffer.cpp", "VkCommandBuffer.cpp",
"VkCommandPool.cpp", "VkCommandPool.cpp",
"VkDebugUtilsMessenger.cpp",
"VkDescriptorPool.cpp", "VkDescriptorPool.cpp",
"VkDescriptorSet.cpp", "VkDescriptorSet.cpp",
"VkDescriptorSetLayout.cpp", "VkDescriptorSetLayout.cpp",
......
...@@ -31,6 +31,8 @@ set(VULKAN_SRC_FILES ...@@ -31,6 +31,8 @@ set(VULKAN_SRC_FILES
VkCommandPool.cpp VkCommandPool.cpp
VkCommandPool.hpp VkCommandPool.hpp
VkConfig.hpp VkConfig.hpp
VkDebugUtilsMessenger.cpp
VkDebugUtilsMessenger.hpp
VkDescriptorPool.cpp VkDescriptorPool.cpp
VkDescriptorPool.hpp VkDescriptorPool.hpp
VkDescriptorSet.cpp VkDescriptorSet.cpp
......
...@@ -1785,6 +1785,21 @@ void CommandBuffer::drawIndexedIndirect(Buffer *buffer, VkDeviceSize offset, uin ...@@ -1785,6 +1785,21 @@ void CommandBuffer::drawIndexedIndirect(Buffer *buffer, VkDeviceSize offset, uin
addCommand<::CmdDrawIndexedIndirect>(buffer, offset, drawCount, stride); addCommand<::CmdDrawIndexedIndirect>(buffer, offset, drawCount, stride);
} }
void CommandBuffer::beginDebugUtilsLabel(const VkDebugUtilsLabelEXT *pLabelInfo)
{
// Optional debug label region
}
void CommandBuffer::endDebugUtilsLabel()
{
// Close debug label region opened with beginDebugUtilsLabel()
}
void CommandBuffer::insertDebugUtilsLabel(const VkDebugUtilsLabelEXT *pLabelInfo)
{
// Optional single debug label
}
void CommandBuffer::submit(CommandBuffer::ExecutionState &executionState) void CommandBuffer::submit(CommandBuffer::ExecutionState &executionState)
{ {
// Perform recorded work // Perform recorded work
......
...@@ -133,6 +133,10 @@ public: ...@@ -133,6 +133,10 @@ public:
void drawIndirect(Buffer *buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); void drawIndirect(Buffer *buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride);
void drawIndexedIndirect(Buffer *buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); void drawIndexedIndirect(Buffer *buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride);
void beginDebugUtilsLabel(const VkDebugUtilsLabelEXT *pLabelInfo);
void endDebugUtilsLabel();
void insertDebugUtilsLabel(const VkDebugUtilsLabelEXT *pLabelInfo);
// TODO(sugoi): Move ExecutionState out of CommandBuffer (possibly into Device) // TODO(sugoi): Move ExecutionState out of CommandBuffer (possibly into Device)
struct ExecutionState struct ExecutionState
{ {
......
// Copyright 2020 The SwiftShader Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "VkDebugUtilsMessenger.hpp"
namespace vk {
DebugUtilsMessenger::DebugUtilsMessenger(const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo, void *mem)
: messageSeverity(pCreateInfo->messageSeverity)
, messageType(pCreateInfo->messageType)
, pfnUserCallback(pCreateInfo->pfnUserCallback)
, pUserData(pCreateInfo->pUserData)
{
}
void DebugUtilsMessenger::destroy(const VkAllocationCallbacks *pAllocator)
{
}
size_t DebugUtilsMessenger::ComputeRequiredAllocationSize(const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo)
{
return 0;
}
void DebugUtilsMessenger::submitMessage(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageTypes, const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData)
{
(*pfnUserCallback)(messageSeverity, messageTypes, pCallbackData, pUserData);
}
} // namespace vk
// Copyright 2020 The SwiftShader Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef VK_DEBUG_UTILS_MESSENGER_HPP_
#define VK_DEBUG_UTILS_MESSENGER_HPP_
#include "VkObject.hpp"
namespace vk {
class DeviceMemory;
class DebugUtilsMessenger : public Object<DebugUtilsMessenger, VkDebugUtilsMessengerEXT>
{
public:
DebugUtilsMessenger(const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo, void *mem);
void destroy(const VkAllocationCallbacks *pAllocator);
static size_t ComputeRequiredAllocationSize(const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo);
void submitMessage(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageTypes, const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData);
private:
VkDebugUtilsMessageSeverityFlagsEXT messageSeverity = (VkDebugUtilsMessageSeverityFlagsEXT)0;
VkDebugUtilsMessageTypeFlagsEXT messageType = (VkDebugUtilsMessageTypeFlagsEXT)0;
PFN_vkDebugUtilsMessengerCallbackEXT pfnUserCallback = nullptr;
void *pUserData = nullptr;
};
static inline DebugUtilsMessenger *Cast(VkDebugUtilsMessengerEXT object)
{
return DebugUtilsMessenger::Cast(object);
}
} // namespace vk
#endif // VK_DEBUG_UTILS_MESSENGER_HPP_
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "VkBufferView.hpp" #include "VkBufferView.hpp"
#include "VkCommandBuffer.hpp" #include "VkCommandBuffer.hpp"
#include "VkCommandPool.hpp" #include "VkCommandPool.hpp"
#include "VkDebugUtilsMessenger.hpp"
#include "VkDevice.hpp" #include "VkDevice.hpp"
#include "VkDeviceMemory.hpp" #include "VkDeviceMemory.hpp"
#include "VkEvent.hpp" #include "VkEvent.hpp"
......
...@@ -313,4 +313,16 @@ void Device::removeSampler(const SamplerState &samplerState) ...@@ -313,4 +313,16 @@ void Device::removeSampler(const SamplerState &samplerState)
samplerIndexer->remove(samplerState); samplerIndexer->remove(samplerState);
} }
VkResult Device::setDebugUtilsObjectName(const VkDebugUtilsObjectNameInfoEXT *pNameInfo)
{
// Optionally maps user-friendly name to an object
return VK_SUCCESS;
}
VkResult Device::setDebugUtilsObjectTag(const VkDebugUtilsObjectTagInfoEXT *pTagInfo)
{
// Optionally attach arbitrary data to an object
return VK_SUCCESS;
}
} // namespace vk } // namespace vk
...@@ -160,6 +160,9 @@ public: ...@@ -160,6 +160,9 @@ public:
#endif // ENABLE_VK_DEBUGGER #endif // ENABLE_VK_DEBUGGER
} }
VkResult setDebugUtilsObjectName(const VkDebugUtilsObjectNameInfoEXT *pNameInfo);
VkResult setDebugUtilsObjectTag(const VkDebugUtilsObjectTagInfoEXT *pTagInfo);
private: private:
PhysicalDevice *const physicalDevice = nullptr; PhysicalDevice *const physicalDevice = nullptr;
Queue *const queues = nullptr; Queue *const queues = nullptr;
......
...@@ -83,6 +83,18 @@ static const std::unordered_map<std::string, PFN_vkVoidFunction> instanceFunctio ...@@ -83,6 +83,18 @@ static const std::unordered_map<std::string, PFN_vkVoidFunction> instanceFunctio
MAKE_VULKAN_INSTANCE_ENTRY(vkGetPhysicalDeviceQueueFamilyProperties2KHR), MAKE_VULKAN_INSTANCE_ENTRY(vkGetPhysicalDeviceQueueFamilyProperties2KHR),
MAKE_VULKAN_INSTANCE_ENTRY(vkGetPhysicalDeviceMemoryProperties2KHR), MAKE_VULKAN_INSTANCE_ENTRY(vkGetPhysicalDeviceMemoryProperties2KHR),
MAKE_VULKAN_INSTANCE_ENTRY(vkGetPhysicalDeviceSparseImageFormatProperties2KHR), MAKE_VULKAN_INSTANCE_ENTRY(vkGetPhysicalDeviceSparseImageFormatProperties2KHR),
// VK_EXT_debug_utils
MAKE_VULKAN_INSTANCE_ENTRY(vkCmdBeginDebugUtilsLabelEXT),
MAKE_VULKAN_INSTANCE_ENTRY(vkCmdEndDebugUtilsLabelEXT),
MAKE_VULKAN_INSTANCE_ENTRY(vkCmdInsertDebugUtilsLabelEXT),
MAKE_VULKAN_INSTANCE_ENTRY(vkCreateDebugUtilsMessengerEXT),
MAKE_VULKAN_INSTANCE_ENTRY(vkDestroyDebugUtilsMessengerEXT),
MAKE_VULKAN_INSTANCE_ENTRY(vkQueueBeginDebugUtilsLabelEXT),
MAKE_VULKAN_INSTANCE_ENTRY(vkQueueEndDebugUtilsLabelEXT),
MAKE_VULKAN_INSTANCE_ENTRY(vkQueueInsertDebugUtilsLabelEXT),
MAKE_VULKAN_INSTANCE_ENTRY(vkSetDebugUtilsObjectNameEXT),
MAKE_VULKAN_INSTANCE_ENTRY(vkSetDebugUtilsObjectTagEXT),
MAKE_VULKAN_INSTANCE_ENTRY(vkSubmitDebugUtilsMessageEXT),
#ifndef __ANDROID__ #ifndef __ANDROID__
// VK_KHR_surface // VK_KHR_surface
MAKE_VULKAN_INSTANCE_ENTRY(vkDestroySurfaceKHR), MAKE_VULKAN_INSTANCE_ENTRY(vkDestroySurfaceKHR),
...@@ -261,6 +273,15 @@ static const std::unordered_map<std::string, PFN_vkVoidFunction> deviceFunctionP ...@@ -261,6 +273,15 @@ static const std::unordered_map<std::string, PFN_vkVoidFunction> deviceFunctionP
MAKE_VULKAN_DEVICE_ENTRY(vkDestroyDescriptorUpdateTemplate), MAKE_VULKAN_DEVICE_ENTRY(vkDestroyDescriptorUpdateTemplate),
MAKE_VULKAN_DEVICE_ENTRY(vkUpdateDescriptorSetWithTemplate), MAKE_VULKAN_DEVICE_ENTRY(vkUpdateDescriptorSetWithTemplate),
MAKE_VULKAN_DEVICE_ENTRY(vkGetDescriptorSetLayoutSupport), MAKE_VULKAN_DEVICE_ENTRY(vkGetDescriptorSetLayoutSupport),
// Device level VK_EXT_debug_utils functions
MAKE_VULKAN_DEVICE_ENTRY(vkCmdBeginDebugUtilsLabelEXT),
MAKE_VULKAN_DEVICE_ENTRY(vkCmdEndDebugUtilsLabelEXT),
MAKE_VULKAN_DEVICE_ENTRY(vkCmdInsertDebugUtilsLabelEXT),
MAKE_VULKAN_DEVICE_ENTRY(vkQueueBeginDebugUtilsLabelEXT),
MAKE_VULKAN_DEVICE_ENTRY(vkQueueEndDebugUtilsLabelEXT),
MAKE_VULKAN_DEVICE_ENTRY(vkQueueInsertDebugUtilsLabelEXT),
MAKE_VULKAN_DEVICE_ENTRY(vkSetDebugUtilsObjectNameEXT),
MAKE_VULKAN_DEVICE_ENTRY(vkSetDebugUtilsObjectTagEXT),
#ifdef __ANDROID__ #ifdef __ANDROID__
MAKE_VULKAN_DEVICE_ENTRY(vkGetSwapchainGrallocUsageANDROID), MAKE_VULKAN_DEVICE_ENTRY(vkGetSwapchainGrallocUsageANDROID),
MAKE_VULKAN_DEVICE_ENTRY(vkGetSwapchainGrallocUsage2ANDROID), MAKE_VULKAN_DEVICE_ENTRY(vkGetSwapchainGrallocUsage2ANDROID),
......
...@@ -13,12 +13,14 @@ ...@@ -13,12 +13,14 @@
// limitations under the License. // limitations under the License.
#include "VkInstance.hpp" #include "VkInstance.hpp"
#include "VkDebugUtilsMessenger.hpp"
#include "VkDestroy.hpp" #include "VkDestroy.hpp"
namespace vk { namespace vk {
Instance::Instance(const VkInstanceCreateInfo *pCreateInfo, void *mem, VkPhysicalDevice physicalDevice) Instance::Instance(const VkInstanceCreateInfo *pCreateInfo, void *mem, VkPhysicalDevice physicalDevice, DebugUtilsMessenger *messenger)
: physicalDevice(physicalDevice) : physicalDevice(physicalDevice)
, messenger(messenger)
{ {
} }
...@@ -68,4 +70,12 @@ VkResult Instance::getPhysicalDeviceGroups(uint32_t *pPhysicalDeviceGroupCount, ...@@ -68,4 +70,12 @@ VkResult Instance::getPhysicalDeviceGroups(uint32_t *pPhysicalDeviceGroupCount,
return VK_SUCCESS; return VK_SUCCESS;
} }
void Instance::submitDebugUtilsMessage(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageTypes, const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData)
{
if(messenger)
{
messenger->submitMessage(messageSeverity, messageTypes, pCallbackData);
}
}
} // namespace vk } // namespace vk
...@@ -19,12 +19,14 @@ ...@@ -19,12 +19,14 @@
namespace vk { namespace vk {
class DebugUtilsMessenger;
class Instance class Instance
{ {
public: public:
static constexpr VkSystemAllocationScope GetAllocationScope() { return VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE; } static constexpr VkSystemAllocationScope GetAllocationScope() { return VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE; }
Instance(const VkInstanceCreateInfo *pCreateInfo, void *mem, VkPhysicalDevice physicalDevice); Instance(const VkInstanceCreateInfo *pCreateInfo, void *mem, VkPhysicalDevice physicalDevice, DebugUtilsMessenger *messenger);
void destroy(const VkAllocationCallbacks *pAllocator); void destroy(const VkAllocationCallbacks *pAllocator);
static size_t ComputeRequiredAllocationSize(const VkInstanceCreateInfo *) { return 0; } static size_t ComputeRequiredAllocationSize(const VkInstanceCreateInfo *) { return 0; }
...@@ -33,8 +35,11 @@ public: ...@@ -33,8 +35,11 @@ public:
VkResult getPhysicalDeviceGroups(uint32_t *pPhysicalDeviceGroupCount, VkResult getPhysicalDeviceGroups(uint32_t *pPhysicalDeviceGroupCount,
VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties) const; VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties) const;
void submitDebugUtilsMessage(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageTypes, const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData);
private: private:
VkPhysicalDevice physicalDevice = VK_NULL_HANDLE; VkPhysicalDevice physicalDevice = VK_NULL_HANDLE;
DebugUtilsMessenger *messenger = nullptr;
}; };
using DispatchableInstance = DispatchableObject<Instance, VkInstance>; using DispatchableInstance = DispatchableObject<Instance, VkInstance>;
......
...@@ -250,4 +250,19 @@ VkResult Queue::present(const VkPresentInfoKHR *presentInfo) ...@@ -250,4 +250,19 @@ VkResult Queue::present(const VkPresentInfoKHR *presentInfo)
} }
#endif #endif
void Queue::beginDebugUtilsLabel(const VkDebugUtilsLabelEXT *pLabelInfo)
{
// Optional debug label region
}
void Queue::endDebugUtilsLabel()
{
// Close debug label region opened with beginDebugUtilsLabel()
}
void Queue::insertDebugUtilsLabel(const VkDebugUtilsLabelEXT *pLabelInfo)
{
// Optional single debug label
}
} // namespace vk } // namespace vk
...@@ -56,6 +56,10 @@ public: ...@@ -56,6 +56,10 @@ public:
VkResult present(const VkPresentInfoKHR *presentInfo); VkResult present(const VkPresentInfoKHR *presentInfo);
#endif #endif
void beginDebugUtilsLabel(const VkDebugUtilsLabelEXT *pLabelInfo);
void endDebugUtilsLabel();
void insertDebugUtilsLabel(const VkDebugUtilsLabelEXT *pLabelInfo);
private: private:
struct Task struct Task
{ {
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "VkCommandBuffer.hpp" #include "VkCommandBuffer.hpp"
#include "VkCommandPool.hpp" #include "VkCommandPool.hpp"
#include "VkConfig.hpp" #include "VkConfig.hpp"
#include "VkDebugUtilsMessenger.hpp"
#include "VkDescriptorPool.hpp" #include "VkDescriptorPool.hpp"
#include "VkDescriptorSetLayout.hpp" #include "VkDescriptorSetLayout.hpp"
#include "VkDescriptorUpdateTemplate.hpp" #include "VkDescriptorUpdateTemplate.hpp"
...@@ -303,6 +304,7 @@ static const VkExtensionProperties instanceExtensionProperties[] = { ...@@ -303,6 +304,7 @@ static const VkExtensionProperties instanceExtensionProperties[] = {
{ VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME, VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION }, { VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME, VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION },
{ VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME, VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_SPEC_VERSION }, { VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_EXTENSION_NAME, VK_KHR_EXTERNAL_SEMAPHORE_CAPABILITIES_SPEC_VERSION },
{ VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION }, { VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION },
{ VK_EXT_DEBUG_UTILS_EXTENSION_NAME, VK_EXT_DEBUG_UTILS_SPEC_VERSION },
#ifndef __ANDROID__ #ifndef __ANDROID__
{ VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_SURFACE_SPEC_VERSION }, { VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_SURFACE_SPEC_VERSION },
#endif #endif
...@@ -411,11 +413,22 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo *pCre ...@@ -411,11 +413,22 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo *pCre
} }
} }
VkDebugUtilsMessengerEXT messenger = { VK_NULL_HANDLE };
if(pCreateInfo->pNext) if(pCreateInfo->pNext)
{ {
const VkBaseInStructure *createInfo = reinterpret_cast<const VkBaseInStructure *>(pCreateInfo->pNext); const VkBaseInStructure *createInfo = reinterpret_cast<const VkBaseInStructure *>(pCreateInfo->pNext);
switch(createInfo->sType) switch(createInfo->sType)
{ {
case VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT:
{
const VkDebugUtilsMessengerCreateInfoEXT *debugUtilsMessengerCreateInfoEXT = reinterpret_cast<const VkDebugUtilsMessengerCreateInfoEXT *>(createInfo);
VkResult result = vk::DebugUtilsMessenger::Create(pAllocator, debugUtilsMessengerCreateInfoEXT, &messenger);
if(result != VK_SUCCESS)
{
return result;
}
}
break;
case VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO: case VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO:
// According to the Vulkan spec, section 2.7.2. Implicit Valid Usage: // According to the Vulkan spec, section 2.7.2. Implicit Valid Usage:
// "The values VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO and // "The values VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO and
...@@ -435,12 +448,14 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo *pCre ...@@ -435,12 +448,14 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateInstance(const VkInstanceCreateInfo *pCre
VkResult result = vk::DispatchablePhysicalDevice::Create(pAllocator, pCreateInfo, &physicalDevice); VkResult result = vk::DispatchablePhysicalDevice::Create(pAllocator, pCreateInfo, &physicalDevice);
if(result != VK_SUCCESS) if(result != VK_SUCCESS)
{ {
vk::destroy(messenger, pAllocator);
return result; return result;
} }
result = vk::DispatchableInstance::Create(pAllocator, pCreateInfo, pInstance, physicalDevice); result = vk::DispatchableInstance::Create(pAllocator, pCreateInfo, pInstance, physicalDevice, vk::Cast(messenger));
if(result != VK_SUCCESS) if(result != VK_SUCCESS)
{ {
vk::destroy(messenger, pAllocator);
vk::destroy(physicalDevice, pAllocator); vk::destroy(physicalDevice, pAllocator);
return result; return result;
} }
...@@ -3339,12 +3354,104 @@ VKAPI_ATTR void VKAPI_CALL vkGetDescriptorSetLayoutSupport(VkDevice device, cons ...@@ -3339,12 +3354,104 @@ VKAPI_ATTR void VKAPI_CALL vkGetDescriptorSetLayoutSupport(VkDevice device, cons
VKAPI_ATTR void VKAPI_CALL vkCmdSetLineStippleEXT(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern) VKAPI_ATTR void VKAPI_CALL vkCmdSetLineStippleEXT(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern)
{ {
TRACE("(VkCommandBuffer commandBuffer = %p, uint32_t lineStippleFactor = %u, uint16_t lineStipplePattern = %u", TRACE("(VkCommandBuffer commandBuffer = %p, uint32_t lineStippleFactor = %u, uint16_t lineStipplePattern = %u)",
commandBuffer, lineStippleFactor, lineStipplePattern); commandBuffer, lineStippleFactor, lineStipplePattern);
UNSUPPORTED("VkPhysicalDeviceLineRasterizationFeaturesEXT::stippled*Lines"); UNSUPPORTED("VkPhysicalDeviceLineRasterizationFeaturesEXT::stippled*Lines");
} }
VKAPI_ATTR void VKAPI_CALL vkCmdBeginDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT *pLabelInfo)
{
TRACE("(VkCommandBuffer commandBuffer = %p, const VkDebugUtilsLabelEXT* pLabelInfo = %p)",
commandBuffer, pLabelInfo);
vk::Cast(commandBuffer)->beginDebugUtilsLabel(pLabelInfo);
}
VKAPI_ATTR void VKAPI_CALL vkCmdEndDebugUtilsLabelEXT(VkCommandBuffer commandBuffer)
{
TRACE("(VkCommandBuffer commandBuffer = %p)", commandBuffer);
vk::Cast(commandBuffer)->endDebugUtilsLabel();
}
VKAPI_ATTR void VKAPI_CALL vkCmdInsertDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT *pLabelInfo)
{
TRACE("(VkCommandBuffer commandBuffer = %p, const VkDebugUtilsLabelEXT* pLabelInfo = %p)",
commandBuffer, pLabelInfo);
vk::Cast(commandBuffer)->insertDebugUtilsLabel(pLabelInfo);
}
VKAPI_ATTR VkResult VKAPI_CALL vkCreateDebugUtilsMessengerEXT(VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkDebugUtilsMessengerEXT *pMessenger)
{
TRACE("(VkInstance instance = %p, const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo = %p, const VkAllocationCallbacks* pAllocator = %p, VkDebugUtilsMessengerEXT* pMessenger = %p)",
instance, pCreateInfo, pAllocator, pMessenger);
if(pCreateInfo->flags != 0)
{
// Vulkan 1.2: "flags is reserved for future use." "flags must be 0"
UNSUPPORTED("pCreateInfo->flags %d", int(pCreateInfo->flags));
}
return vk::DebugUtilsMessenger::Create(pAllocator, pCreateInfo, pMessenger);
}
VKAPI_ATTR void VKAPI_CALL vkDestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger, const VkAllocationCallbacks *pAllocator)
{
TRACE("(VkInstance instance = %p, VkDebugUtilsMessengerEXT messenger = %p, const VkAllocationCallbacks* pAllocator = %p)",
instance, static_cast<void *>(messenger), pAllocator);
vk::destroy(messenger, pAllocator);
}
VKAPI_ATTR void VKAPI_CALL vkQueueBeginDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT *pLabelInfo)
{
TRACE("(VkQueue queue = %p, const VkDebugUtilsLabelEXT* pLabelInfo = %p)",
queue, pLabelInfo);
vk::Cast(queue)->beginDebugUtilsLabel(pLabelInfo);
}
VKAPI_ATTR void VKAPI_CALL vkQueueEndDebugUtilsLabelEXT(VkQueue queue)
{
TRACE("(VkQueue queue = %p)", queue);
vk::Cast(queue)->endDebugUtilsLabel();
}
VKAPI_ATTR void VKAPI_CALL vkQueueInsertDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT *pLabelInfo)
{
TRACE("(VkQueue queue = %p, const VkDebugUtilsLabelEXT* pLabelInfo = %p)",
queue, pLabelInfo);
vk::Cast(queue)->insertDebugUtilsLabel(pLabelInfo);
}
VKAPI_ATTR VkResult VKAPI_CALL vkSetDebugUtilsObjectNameEXT(VkDevice device, const VkDebugUtilsObjectNameInfoEXT *pNameInfo)
{
TRACE("(VkDevice device = %p, const VkDebugUtilsObjectNameInfoEXT* pNameInfo = %p)",
device, pNameInfo);
return vk::Cast(device)->setDebugUtilsObjectName(pNameInfo);
}
VKAPI_ATTR VkResult VKAPI_CALL vkSetDebugUtilsObjectTagEXT(VkDevice device, const VkDebugUtilsObjectTagInfoEXT *pTagInfo)
{
TRACE("(VkDevice device = %p, const VkDebugUtilsObjectTagInfoEXT* pTagInfo = %p)",
device, pTagInfo);
return vk::Cast(device)->setDebugUtilsObjectTag(pTagInfo);
}
VKAPI_ATTR void VKAPI_CALL vkSubmitDebugUtilsMessageEXT(VkInstance instance, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageTypes, const VkDebugUtilsMessengerCallbackDataEXT *pCallbackData)
{
TRACE("(VkInstance instance = %p, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity = %d, VkDebugUtilsMessageTypeFlagsEXT messageTypes = %d, const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData = %p)",
instance, messageSeverity, messageTypes, pCallbackData);
vk::Cast(instance)->submitDebugUtilsMessage(messageSeverity, messageTypes, pCallbackData);
}
#ifdef VK_USE_PLATFORM_XCB_KHR #ifdef VK_USE_PLATFORM_XCB_KHR
VKAPI_ATTR VkResult VKAPI_CALL vkCreateXcbSurfaceKHR(VkInstance instance, const VkXcbSurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface) VKAPI_ATTR VkResult VKAPI_CALL vkCreateXcbSurfaceKHR(VkInstance instance, const VkXcbSurfaceCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *pSurface)
{ {
......
...@@ -201,6 +201,18 @@ EXPORTS ...@@ -201,6 +201,18 @@ EXPORTS
vkGetPhysicalDeviceQueueFamilyProperties2KHR vkGetPhysicalDeviceQueueFamilyProperties2KHR
vkGetPhysicalDeviceMemoryProperties2KHR vkGetPhysicalDeviceMemoryProperties2KHR
vkGetPhysicalDeviceSparseImageFormatProperties2KHR vkGetPhysicalDeviceSparseImageFormatProperties2KHR
; VK_EXT_debug_utils
vkCmdBeginDebugUtilsLabelEXT
vkCmdEndDebugUtilsLabelEXT
vkCmdInsertDebugUtilsLabelEXT
vkCreateDebugUtilsMessengerEXT
vkDestroyDebugUtilsMessengerEXT
vkQueueBeginDebugUtilsLabelEXT
vkQueueEndDebugUtilsLabelEXT
vkQueueInsertDebugUtilsLabelEXT
vkSetDebugUtilsObjectNameEXT
vkSetDebugUtilsObjectTagEXT
vkSubmitDebugUtilsMessageEXT
; VK_KHR_maintenance1 ; VK_KHR_maintenance1
vkTrimCommandPoolKHR vkTrimCommandPoolKHR
; VK_KHR_maintenance3 ; VK_KHR_maintenance3
......
...@@ -201,6 +201,18 @@ global: ...@@ -201,6 +201,18 @@ global:
vkGetPhysicalDeviceQueueFamilyProperties2KHR; vkGetPhysicalDeviceQueueFamilyProperties2KHR;
vkGetPhysicalDeviceMemoryProperties2KHR; vkGetPhysicalDeviceMemoryProperties2KHR;
vkGetPhysicalDeviceSparseImageFormatProperties2KHR; vkGetPhysicalDeviceSparseImageFormatProperties2KHR;
# VK_EXT_debug_utils;
vkCmdBeginDebugUtilsLabelEXT;
vkCmdEndDebugUtilsLabelEXT;
vkCmdInsertDebugUtilsLabelEXT;
vkCreateDebugUtilsMessengerEXT;
vkDestroyDebugUtilsMessengerEXT;
vkQueueBeginDebugUtilsLabelEXT;
vkQueueEndDebugUtilsLabelEXT;
vkQueueInsertDebugUtilsLabelEXT;
vkSetDebugUtilsObjectNameEXT;
vkSetDebugUtilsObjectTagEXT;
vkSubmitDebugUtilsMessageEXT;
# VK_KHR_maintenance1; # VK_KHR_maintenance1;
vkTrimCommandPoolKHR; vkTrimCommandPoolKHR;
# VK_KHR_maintenance3; # VK_KHR_maintenance3;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment