mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-21 13:15:57 +00:00
Add functions to get FetchDrawcall by ID from core
This commit is contained in:
@@ -1982,3 +1982,49 @@ FetchAPIEvent WrappedVulkan::GetEvent(uint32_t eventID)
|
||||
|
||||
return m_Events[0];
|
||||
}
|
||||
|
||||
const FetchDrawcall *WrappedVulkan::GetDrawcall(const FetchDrawcall *draw, uint32_t eventID)
|
||||
{
|
||||
if(draw == NULL) return NULL;
|
||||
if(draw->eventID == eventID) return draw;
|
||||
|
||||
int32_t count = draw->children.count;
|
||||
for(int32_t i=0; i < count; i++)
|
||||
{
|
||||
const FetchDrawcall *cur = &draw->children.elems[i];
|
||||
const FetchDrawcall *next = i+1 < count ? &draw->children.elems[i+1] : NULL;
|
||||
|
||||
if(next && next->eventID <= eventID)
|
||||
continue;
|
||||
|
||||
cur = GetDrawcall(cur, eventID);
|
||||
|
||||
if(cur)
|
||||
return cur;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const FetchDrawcall *WrappedVulkan::GetDrawcall(uint32_t frameID, uint32_t eventID)
|
||||
{
|
||||
if(frameID >= m_FrameRecord.size())
|
||||
return NULL;
|
||||
|
||||
size_t count = m_FrameRecord[frameID].drawcallList.size();
|
||||
for(size_t i=0; i < count; i++)
|
||||
{
|
||||
const FetchDrawcall *cur = &m_FrameRecord[frameID].drawcallList[i];
|
||||
const FetchDrawcall *next = i+1 < count ? &m_FrameRecord[frameID].drawcallList[i+1] : NULL;
|
||||
|
||||
if(next && next->eventID <= eventID)
|
||||
continue;
|
||||
|
||||
cur = GetDrawcall(cur, eventID);
|
||||
|
||||
if(cur)
|
||||
return cur;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -154,6 +154,7 @@ private:
|
||||
double m_TotalTime, m_AvgFrametime, m_MinFrametime, m_MaxFrametime;
|
||||
|
||||
vector<FetchFrameRecord> m_FrameRecord;
|
||||
const FetchDrawcall *GetDrawcall(const FetchDrawcall *draw, uint32_t eventID);
|
||||
|
||||
struct PhysicalDeviceData
|
||||
{
|
||||
@@ -530,6 +531,7 @@ public:
|
||||
|
||||
vector<FetchFrameRecord> &GetFrameRecord() { return m_FrameRecord; }
|
||||
FetchAPIEvent GetEvent(uint32_t eventID);
|
||||
const FetchDrawcall *GetDrawcall(uint32_t frameID, uint32_t eventID);
|
||||
|
||||
// Device initialization
|
||||
|
||||
|
||||
Reference in New Issue
Block a user