mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-23 15:06:32 +00:00
Add some more identified markers
This commit is contained in:
@@ -2165,6 +2165,43 @@ void WrappedVulkan::Present(void *dev, void *wnd)
|
||||
}
|
||||
}
|
||||
|
||||
void WrappedVulkan::HandleFrameMarkers(const char *marker, VkCommandBuffer commandBuffer)
|
||||
{
|
||||
if(!marker)
|
||||
return;
|
||||
|
||||
if(strstr(marker, "vr-marker,frame_end,type,application") != NULL)
|
||||
{
|
||||
VkResourceRecord *record = GetRecord(commandBuffer);
|
||||
record->bakedCommands->cmdInfo->present = true;
|
||||
}
|
||||
if(strstr(marker, "capture-marker,begin_capture") != NULL)
|
||||
{
|
||||
VkResourceRecord *record = GetRecord(commandBuffer);
|
||||
record->bakedCommands->cmdInfo->beginCapture = true;
|
||||
}
|
||||
if(strstr(marker, "capture-marker,end_capture") != NULL)
|
||||
{
|
||||
VkResourceRecord *record = GetRecord(commandBuffer);
|
||||
record->bakedCommands->cmdInfo->endCapture = true;
|
||||
}
|
||||
}
|
||||
|
||||
void WrappedVulkan::HandleFrameMarkers(const char *marker, VkQueue queue)
|
||||
{
|
||||
if(!marker)
|
||||
return;
|
||||
|
||||
if(strstr(marker, "capture-marker,begin_capture") != NULL)
|
||||
{
|
||||
RenderDoc::Inst().StartFrameCapture(LayerDisp(m_Instance), NULL);
|
||||
}
|
||||
if(strstr(marker, "capture-marker,end_capture") != NULL)
|
||||
{
|
||||
RenderDoc::Inst().EndFrameCapture(LayerDisp(m_Instance), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
ResourceDescription &WrappedVulkan::GetResourceDesc(ResourceId id)
|
||||
{
|
||||
return GetReplay()->GetResourceDesc(id);
|
||||
|
||||
@@ -877,7 +877,8 @@ private:
|
||||
void AdvanceFrame();
|
||||
void Present(void *dev, void *wnd);
|
||||
|
||||
void HandleVRFrameMarkers(const char *marker, VkCommandBuffer commandBuffer);
|
||||
void HandleFrameMarkers(const char *marker, VkCommandBuffer commandBuffer);
|
||||
void HandleFrameMarkers(const char *marker, VkQueue queue);
|
||||
|
||||
template <typename SerialiserType>
|
||||
bool Serialise_SetShaderDebugPath(SerialiserType &ser, VkShaderModule ShaderObject,
|
||||
|
||||
@@ -1028,6 +1028,10 @@ struct CmdBufferRecordingInfo
|
||||
|
||||
// AdvanceFrame/Present should be called after this buffer is submitted
|
||||
bool present;
|
||||
// BeginFrameCapture should be called *before* this buffer is submitted.
|
||||
bool beginCapture;
|
||||
// EndFrameCapture should be called *after* this buffer is submitted.
|
||||
bool endCapture;
|
||||
};
|
||||
|
||||
struct DescSetLayout;
|
||||
|
||||
@@ -697,6 +697,8 @@ VkResult WrappedVulkan::vkAllocateCommandBuffers(VkDevice device,
|
||||
record->cmdInfo->allocInfo.commandBufferCount = 1;
|
||||
record->cmdInfo->allocRecord = allocRecord;
|
||||
record->cmdInfo->present = false;
|
||||
record->cmdInfo->beginCapture = false;
|
||||
record->cmdInfo->endCapture = false;
|
||||
record->cmdInfo->alloc = &record->pool->cmdPoolInfo->alloc;
|
||||
}
|
||||
else
|
||||
@@ -1033,6 +1035,8 @@ VkResult WrappedVulkan::vkBeginCommandBuffer(VkCommandBuffer commandBuffer,
|
||||
record->bakedCommands->cmdInfo->device = record->cmdInfo->device;
|
||||
record->bakedCommands->cmdInfo->allocInfo = record->cmdInfo->allocInfo;
|
||||
record->bakedCommands->cmdInfo->present = false;
|
||||
record->bakedCommands->cmdInfo->beginCapture = false;
|
||||
record->bakedCommands->cmdInfo->endCapture = false;
|
||||
|
||||
{
|
||||
CACHE_THREAD_SERIALISER();
|
||||
@@ -4326,15 +4330,6 @@ void WrappedVulkan::vkCmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer)
|
||||
}
|
||||
}
|
||||
|
||||
void WrappedVulkan::HandleVRFrameMarkers(const char *marker, VkCommandBuffer commandBuffer)
|
||||
{
|
||||
if(strstr(marker, "vr-marker,frame_end,type,application") != NULL)
|
||||
{
|
||||
VkResourceRecord *record = GetRecord(commandBuffer);
|
||||
record->bakedCommands->cmdInfo->present = true;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename SerialiserType>
|
||||
bool WrappedVulkan::Serialise_vkCmdDebugMarkerInsertEXT(SerialiserType &ser,
|
||||
VkCommandBuffer commandBuffer,
|
||||
@@ -4390,7 +4385,8 @@ void WrappedVulkan::vkCmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer,
|
||||
ObjDisp(commandBuffer)->CmdDebugMarkerInsertEXT(Unwrap(commandBuffer), pMarker));
|
||||
}
|
||||
|
||||
HandleVRFrameMarkers(pMarker->pMarkerName, commandBuffer);
|
||||
if(pMarker)
|
||||
HandleFrameMarkers(pMarker->pMarkerName, commandBuffer);
|
||||
if(IsCaptureMode(m_State))
|
||||
{
|
||||
VkResourceRecord *record = GetRecord(commandBuffer);
|
||||
@@ -5307,6 +5303,8 @@ void WrappedVulkan::vkCmdInsertDebugUtilsLabelEXT(VkCommandBuffer commandBuffer,
|
||||
ObjDisp(commandBuffer)->CmdInsertDebugUtilsLabelEXT(Unwrap(commandBuffer), pLabelInfo));
|
||||
}
|
||||
|
||||
if(pLabelInfo)
|
||||
HandleFrameMarkers(pLabelInfo->pLabelName, commandBuffer);
|
||||
if(IsCaptureMode(m_State))
|
||||
{
|
||||
VkResourceRecord *record = GetRecord(commandBuffer);
|
||||
|
||||
@@ -841,6 +841,24 @@ VkResult WrappedVulkan::vkQueueSubmit(VkQueue queue, uint32_t submitCount,
|
||||
|
||||
VkResult ret = VK_SUCCESS;
|
||||
bool present = false;
|
||||
bool beginCapture = false;
|
||||
bool endCapture = false;
|
||||
|
||||
for(uint32_t s = 0; s < submitCount; s++)
|
||||
{
|
||||
for(uint32_t i = 0; i < pSubmits[s].commandBufferCount; i++)
|
||||
{
|
||||
VkResourceRecord *record = GetRecord(pSubmits[s].pCommandBuffers[i]);
|
||||
present |= record->bakedCommands->cmdInfo->present;
|
||||
beginCapture |= record->bakedCommands->cmdInfo->beginCapture;
|
||||
endCapture |= record->bakedCommands->cmdInfo->endCapture;
|
||||
}
|
||||
}
|
||||
|
||||
if(beginCapture)
|
||||
{
|
||||
RenderDoc::Inst().StartFrameCapture(LayerDisp(m_Instance), NULL);
|
||||
}
|
||||
|
||||
{
|
||||
SCOPED_READLOCK(m_CapTransitionLock);
|
||||
@@ -857,7 +875,6 @@ VkResult WrappedVulkan::vkQueueSubmit(VkQueue queue, uint32_t submitCount,
|
||||
ResourceId cmd = GetResID(pSubmits[s].pCommandBuffers[i]);
|
||||
|
||||
VkResourceRecord *record = GetRecord(pSubmits[s].pCommandBuffers[i]);
|
||||
present |= record->bakedCommands->cmdInfo->present;
|
||||
|
||||
UpdateImageStates(record->bakedCommands->cmdInfo->imageStates);
|
||||
|
||||
@@ -1216,6 +1233,11 @@ VkResult WrappedVulkan::vkQueueSubmit(VkQueue queue, uint32_t submitCount,
|
||||
}
|
||||
}
|
||||
|
||||
if(endCapture)
|
||||
{
|
||||
RenderDoc::Inst().EndFrameCapture(LayerDisp(m_Instance), NULL);
|
||||
}
|
||||
|
||||
if(present)
|
||||
{
|
||||
AdvanceFrame();
|
||||
@@ -1675,6 +1697,8 @@ void WrappedVulkan::vkQueueInsertDebugUtilsLabelEXT(VkQueue queue,
|
||||
SERIALISE_TIME_CALL(ObjDisp(queue)->QueueInsertDebugUtilsLabelEXT(Unwrap(queue), pLabelInfo));
|
||||
}
|
||||
|
||||
if(pLabelInfo)
|
||||
HandleFrameMarkers(pLabelInfo->pLabelName, queue);
|
||||
if(IsActiveCapturing(m_State))
|
||||
{
|
||||
CACHE_THREAD_SERIALISER();
|
||||
|
||||
Reference in New Issue
Block a user