mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-22 21:55:52 +00:00
Add begin/end markers around replay region for RGP to capture from
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include "core/core.h"
|
||||
#include "driver/dxgi/dxgi_common.h"
|
||||
#include "driver/dxgi/dxgi_wrapped.h"
|
||||
#include "driver/ihv/amd/amd_rgp.h"
|
||||
#include "driver/ihv/amd/official/DXExt/AmdExtD3D.h"
|
||||
#include "jpeg-compressor/jpge.h"
|
||||
#include "maths/formatpacking.h"
|
||||
@@ -2691,6 +2692,14 @@ void WrappedID3D12Device::ReplayLog(uint32_t startEventID, uint32_t endEventID,
|
||||
GetQueue(), StringFormat::Fmt("!!!!RenderDoc Internal: RenderDoc Replay %d (%d): %u->%u",
|
||||
(int)replayType, (int)partial, startEventID, endEventID));
|
||||
|
||||
if(!partial)
|
||||
{
|
||||
ID3D12GraphicsCommandList *beginList = GetNewList();
|
||||
D3D12MarkerRegion::Set(beginList, AMDRGPControl::GetBeginMarker());
|
||||
beginList->Close();
|
||||
ExecuteLists();
|
||||
}
|
||||
|
||||
{
|
||||
D3D12CommandData &cmd = *m_Queue->GetCommandData();
|
||||
|
||||
@@ -2746,6 +2755,7 @@ void WrappedID3D12Device::ReplayLog(uint32_t startEventID, uint32_t endEventID,
|
||||
|
||||
// ensure all UAV writes have finished before subsequent work
|
||||
ID3D12GraphicsCommandList *list = GetNewList();
|
||||
D3D12MarkerRegion::Set(list, AMDRGPControl::GetEndMarker());
|
||||
|
||||
D3D12_RESOURCE_BARRIER uavBarrier = {};
|
||||
uavBarrier.Type = D3D12_RESOURCE_BARRIER_TYPE_UAV;
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
******************************************************************************/
|
||||
|
||||
#include "vk_core.h"
|
||||
#include "driver/ihv/amd/amd_rgp.h"
|
||||
#include "jpeg-compressor/jpge.h"
|
||||
#include "maths/formatpacking.h"
|
||||
#include "serialise/rdcfile.h"
|
||||
@@ -1743,6 +1744,9 @@ ReplayStatus WrappedVulkan::ContextReplayLog(CaptureState readType, uint32_t sta
|
||||
m_LastEventID = ~0U;
|
||||
}
|
||||
|
||||
if(!partial)
|
||||
AddFrameTerminator(AMDRGPControl::GetBeginTag());
|
||||
|
||||
uint64_t startOffset = ser.GetReader()->GetOffset();
|
||||
|
||||
for(;;)
|
||||
@@ -1809,6 +1813,9 @@ ReplayStatus WrappedVulkan::ContextReplayLog(CaptureState readType, uint32_t sta
|
||||
}
|
||||
}
|
||||
|
||||
if(!partial)
|
||||
AddFrameTerminator(AMDRGPControl::GetEndTag());
|
||||
|
||||
// swap the structure back now that we've accumulated the frame as well.
|
||||
if(IsLoading(m_State) || IsStructuredExporting(m_State))
|
||||
ser.GetStructuredFile().Swap(*prevFile);
|
||||
@@ -2364,6 +2371,36 @@ bool WrappedVulkan::ProcessChunk(ReadSerialiser &ser, VulkanChunk chunk)
|
||||
return true;
|
||||
}
|
||||
|
||||
void WrappedVulkan::AddFrameTerminator(uint64_t queueMarkerTag)
|
||||
{
|
||||
VkCommandBuffer cmdBuffer = GetNextCmd();
|
||||
VkResult vkr = VK_SUCCESS;
|
||||
|
||||
VkCommandBufferBeginInfo beginInfo = {VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO, NULL,
|
||||
VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT};
|
||||
|
||||
vkr = ObjDisp(cmdBuffer)->BeginCommandBuffer(Unwrap(cmdBuffer), &beginInfo);
|
||||
RDCASSERTEQUAL(vkr, VK_SUCCESS);
|
||||
|
||||
vkr = ObjDisp(cmdBuffer)->EndCommandBuffer(Unwrap(cmdBuffer));
|
||||
RDCASSERTEQUAL(vkr, VK_SUCCESS);
|
||||
|
||||
VkDebugMarkerObjectTagInfoEXT tagInfo = {VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT, NULL};
|
||||
tagInfo.objectType = VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT;
|
||||
tagInfo.object = uint64_t(Unwrap(cmdBuffer));
|
||||
tagInfo.tagName = queueMarkerTag;
|
||||
tagInfo.tagSize = 0;
|
||||
tagInfo.pTag = NULL;
|
||||
|
||||
// check for presence of the queue marker extension
|
||||
if(ObjDisp(m_Device)->DebugMarkerSetObjectTagEXT)
|
||||
{
|
||||
vkr = ObjDisp(m_Device)->DebugMarkerSetObjectTagEXT(Unwrap(m_Device), &tagInfo);
|
||||
}
|
||||
|
||||
SubmitCmds();
|
||||
}
|
||||
|
||||
void WrappedVulkan::ReplayLog(uint32_t startEventID, uint32_t endEventID, ReplayLogType replayType)
|
||||
{
|
||||
bool partial = true;
|
||||
|
||||
@@ -753,6 +753,7 @@ private:
|
||||
return ((WrappedVulkan *)pUserData)
|
||||
->DebugCallback(flags, objectType, object, location, messageCode, pLayerPrefix, pMessage);
|
||||
}
|
||||
void AddFrameTerminator(uint64_t queueMarkerTag);
|
||||
|
||||
public:
|
||||
WrappedVulkan();
|
||||
|
||||
Reference in New Issue
Block a user