mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-16 20:47:12 +00:00
Add some internal marker regions in vulkan driver
This commit is contained in:
@@ -32,10 +32,7 @@ WrappedVulkan *VkMarkerRegion::vk = NULL;
|
||||
VkMarkerRegion::VkMarkerRegion(VkCommandBuffer cmd, const std::string &marker)
|
||||
{
|
||||
if(cmd == VK_NULL_HANDLE)
|
||||
{
|
||||
RDCERR("Cannot auto-allocate a command buffer for a scoped VkMarkerRegion");
|
||||
return;
|
||||
}
|
||||
|
||||
cmdbuf = cmd;
|
||||
Begin(marker, cmd);
|
||||
@@ -44,7 +41,12 @@ VkMarkerRegion::VkMarkerRegion(VkCommandBuffer cmd, const std::string &marker)
|
||||
VkMarkerRegion::VkMarkerRegion(VkQueue q, const std::string &marker)
|
||||
{
|
||||
if(q == VK_NULL_HANDLE)
|
||||
q = vk->GetQ();
|
||||
{
|
||||
if(vk)
|
||||
q = vk->GetQ();
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
queue = q;
|
||||
Begin(marker, q);
|
||||
@@ -60,11 +62,11 @@ VkMarkerRegion::~VkMarkerRegion()
|
||||
|
||||
void VkMarkerRegion::Begin(const std::string &marker, VkCommandBuffer cmd)
|
||||
{
|
||||
if(!vk)
|
||||
if(cmd == VK_NULL_HANDLE)
|
||||
return;
|
||||
|
||||
// check for presence of the marker extension
|
||||
if(!ObjDisp(vk->GetDev())->CmdBeginDebugUtilsLabelEXT)
|
||||
if(!ObjDisp(cmd)->CmdBeginDebugUtilsLabelEXT)
|
||||
return;
|
||||
|
||||
VkDebugUtilsLabelEXT label = {};
|
||||
@@ -75,8 +77,11 @@ void VkMarkerRegion::Begin(const std::string &marker, VkCommandBuffer cmd)
|
||||
|
||||
void VkMarkerRegion::Set(const std::string &marker, VkCommandBuffer cmd)
|
||||
{
|
||||
if(cmd == VK_NULL_HANDLE)
|
||||
return;
|
||||
|
||||
// check for presence of the marker extension
|
||||
if(!ObjDisp(vk->GetDev())->CmdInsertDebugUtilsLabelEXT)
|
||||
if(!ObjDisp(cmd)->CmdInsertDebugUtilsLabelEXT)
|
||||
return;
|
||||
|
||||
VkDebugUtilsLabelEXT label = {};
|
||||
@@ -87,8 +92,11 @@ void VkMarkerRegion::Set(const std::string &marker, VkCommandBuffer cmd)
|
||||
|
||||
void VkMarkerRegion::End(VkCommandBuffer cmd)
|
||||
{
|
||||
if(cmd == VK_NULL_HANDLE)
|
||||
return;
|
||||
|
||||
// check for presence of the marker extension
|
||||
if(!ObjDisp(vk->GetDev())->CmdEndDebugUtilsLabelEXT)
|
||||
if(!ObjDisp(cmd)->CmdEndDebugUtilsLabelEXT)
|
||||
return;
|
||||
|
||||
ObjDisp(cmd)->CmdEndDebugUtilsLabelEXT(Unwrap(cmd));
|
||||
@@ -96,16 +104,18 @@ void VkMarkerRegion::End(VkCommandBuffer cmd)
|
||||
|
||||
void VkMarkerRegion::Begin(const std::string &marker, VkQueue q)
|
||||
{
|
||||
if(!vk)
|
||||
return;
|
||||
if(q == VK_NULL_HANDLE)
|
||||
{
|
||||
if(vk)
|
||||
q = vk->GetQ();
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
// check for presence of the marker extension
|
||||
if(!ObjDisp(vk->GetDev())->QueueBeginDebugUtilsLabelEXT)
|
||||
if(!ObjDisp(q)->QueueBeginDebugUtilsLabelEXT)
|
||||
return;
|
||||
|
||||
if(q == VK_NULL_HANDLE)
|
||||
q = vk->GetQ();
|
||||
|
||||
VkDebugUtilsLabelEXT label = {};
|
||||
label.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT;
|
||||
label.pLabelName = marker.c_str();
|
||||
@@ -114,12 +124,17 @@ void VkMarkerRegion::Begin(const std::string &marker, VkQueue q)
|
||||
|
||||
void VkMarkerRegion::Set(const std::string &marker, VkQueue q)
|
||||
{
|
||||
// check for presence of the marker extension
|
||||
if(!ObjDisp(vk->GetDev())->QueueInsertDebugUtilsLabelEXT)
|
||||
return;
|
||||
|
||||
if(q == VK_NULL_HANDLE)
|
||||
q = vk->GetQ();
|
||||
{
|
||||
if(vk)
|
||||
q = vk->GetQ();
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
// check for presence of the marker extension
|
||||
if(!ObjDisp(q)->QueueInsertDebugUtilsLabelEXT)
|
||||
return;
|
||||
|
||||
VkDebugUtilsLabelEXT label = {};
|
||||
label.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_LABEL_EXT;
|
||||
@@ -129,12 +144,17 @@ void VkMarkerRegion::Set(const std::string &marker, VkQueue q)
|
||||
|
||||
void VkMarkerRegion::End(VkQueue q)
|
||||
{
|
||||
// check for presence of the marker extension
|
||||
if(!ObjDisp(vk->GetDev())->QueueEndDebugUtilsLabelEXT)
|
||||
return;
|
||||
|
||||
if(q == VK_NULL_HANDLE)
|
||||
q = vk->GetQ();
|
||||
{
|
||||
if(vk)
|
||||
q = vk->GetQ();
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
// check for presence of the marker extension
|
||||
if(!ObjDisp(q)->QueueEndDebugUtilsLabelEXT)
|
||||
return;
|
||||
|
||||
ObjDisp(q)->QueueEndDebugUtilsLabelEXT(Unwrap(q));
|
||||
}
|
||||
|
||||
@@ -1458,6 +1458,8 @@ bool WrappedVulkan::Serialise_BeginCaptureFrame(SerialiserType &ser)
|
||||
|
||||
if(!imgBarriers.empty())
|
||||
{
|
||||
VkMarkerRegion region("Frame-start barriers");
|
||||
|
||||
for(size_t i = 0; i < imgBarriers.size(); i++)
|
||||
{
|
||||
// sanitise the layouts before passing to Vulkan
|
||||
@@ -2484,6 +2486,8 @@ ReplayStatus WrappedVulkan::ContextReplayLog(CaptureState readType, uint32_t sta
|
||||
|
||||
void WrappedVulkan::ApplyInitialContents()
|
||||
{
|
||||
VkMarkerRegion region("ApplyInitialContents");
|
||||
|
||||
// check that we have all external queues necessary
|
||||
for(size_t i = 0; i < m_ExternalQueues.size(); i++)
|
||||
{
|
||||
|
||||
@@ -83,6 +83,8 @@ void VulkanDebugManager::CopyTex2DMSToArray(VkImage destArray, VkImage srcMS, Vk
|
||||
return;
|
||||
}
|
||||
|
||||
VkMarkerRegion region("CopyTex2DMSToArray");
|
||||
|
||||
if(IsStencilOnlyFormat(fmt))
|
||||
viewInfo.subresourceRange.aspectMask = VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
else if(IsDepthOrStencilFormat(fmt))
|
||||
@@ -175,6 +177,8 @@ void VulkanDebugManager::CopyDepthTex2DMSToArray(VkImage destArray, VkImage srcM
|
||||
if(pipe == VK_NULL_HANDLE)
|
||||
return;
|
||||
|
||||
VkMarkerRegion region("CopyDepthTex2DMSToArray");
|
||||
|
||||
VkDevice dev = m_Device;
|
||||
|
||||
VkResult vkr = VK_SUCCESS;
|
||||
@@ -437,6 +441,8 @@ void VulkanDebugManager::CopyArrayToTex2DMS(VkImage destMS, VkImage srcArray, Vk
|
||||
return;
|
||||
}
|
||||
|
||||
VkMarkerRegion region("CopyArrayToTex2DMS");
|
||||
|
||||
if(IsStencilOnlyFormat(fmt))
|
||||
viewInfo.subresourceRange.aspectMask = VK_IMAGE_ASPECT_STENCIL_BIT;
|
||||
else if(IsDepthOrStencilFormat(fmt))
|
||||
@@ -538,6 +544,8 @@ void VulkanDebugManager::CopyDepthArrayToTex2DMS(VkImage destMS, VkImage srcArra
|
||||
if(pipe == VK_NULL_HANDLE)
|
||||
return;
|
||||
|
||||
VkMarkerRegion region("CopyDepthArrayToTex2DMS");
|
||||
|
||||
VkDevice dev = m_Device;
|
||||
|
||||
VkResult vkr = VK_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user