mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-13 02:01:08 +00:00
remove min/max event IDs from FetchCounters - always times whole frame
This commit is contained in:
@@ -191,7 +191,7 @@ struct IReplayRenderer
|
||||
|
||||
virtual bool GetFrameInfo(rdctype::array<FetchFrameInfo> *frame) = 0;
|
||||
virtual bool GetDrawcalls(uint32_t frameID, rdctype::array<FetchDrawcall> *draws) = 0;
|
||||
virtual bool FetchCounters(uint32_t frameID, uint32_t minEventID, uint32_t maxEventID, uint32_t *counters, uint32_t numCounters, rdctype::array<CounterResult> *results) = 0;
|
||||
virtual bool FetchCounters(uint32_t frameID, uint32_t *counters, uint32_t numCounters, rdctype::array<CounterResult> *results) = 0;
|
||||
virtual bool EnumerateCounters(rdctype::array<uint32_t> *counters) = 0;
|
||||
virtual bool DescribeCounter(uint32_t counterID, CounterDescription *desc) = 0;
|
||||
virtual bool GetTextures(rdctype::array<FetchTexture> *texs) = 0;
|
||||
@@ -258,7 +258,7 @@ extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_FreeTargetResource(R
|
||||
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetFrameInfo(ReplayRenderer *rend, rdctype::array<FetchFrameInfo> *frame);
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetDrawcalls(ReplayRenderer *rend, uint32_t frameID, rdctype::array<FetchDrawcall> *draws);
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_FetchCounters(ReplayRenderer *rend, uint32_t frameID, uint32_t minEventID, uint32_t maxEventID, uint32_t *counters, uint32_t numCounters, rdctype::array<CounterResult> *results);
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_FetchCounters(ReplayRenderer *rend, uint32_t frameID, uint32_t *counters, uint32_t numCounters, rdctype::array<CounterResult> *results);
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_EnumerateCounters(ReplayRenderer *rend, rdctype::array<uint32_t> *counters);
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_DescribeCounter(ReplayRenderer *rend, uint32_t counterID, CounterDescription *desc);
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetTextures(ReplayRenderer *rend, rdctype::array<FetchTexture> *texs);
|
||||
|
||||
@@ -126,7 +126,7 @@ class ImageViewer : public IReplayDriver
|
||||
ResourceId GetLiveID(ResourceId id) { return id; }
|
||||
vector<uint32_t> EnumerateCounters() { return vector<uint32_t>(); }
|
||||
void DescribeCounter(uint32_t counterID, CounterDescription &desc) { RDCEraseEl(desc); desc.counterID = counterID; }
|
||||
vector<CounterResult> FetchCounters(uint32_t frameID, uint32_t minEventID, uint32_t maxEventID, const vector<uint32_t> &counters) { return vector<CounterResult>(); }
|
||||
vector<CounterResult> FetchCounters(uint32_t frameID, const vector<uint32_t> &counters) { return vector<CounterResult>(); }
|
||||
void FillCBufferVariables(ResourceId shader, string entryPoint, uint32_t cbufSlot, vector<ShaderVariable> &outvars, const vector<byte> &data) {}
|
||||
void GetBufferData(ResourceId buff, uint64_t offset, uint64_t len, vector<byte> &retData) {}
|
||||
void InitPostVSBuffers(uint32_t frameID, uint32_t eventID) {}
|
||||
|
||||
@@ -1344,7 +1344,7 @@ bool ProxySerialiser::Tick()
|
||||
case eCommand_FetchCounters:
|
||||
{
|
||||
vector<uint32_t> counters;
|
||||
FetchCounters(0, 0, 0, counters);
|
||||
FetchCounters(0, counters);
|
||||
break;
|
||||
}
|
||||
case eCommand_EnumerateCounters:
|
||||
@@ -1751,18 +1751,16 @@ ResourceId ProxySerialiser::GetLiveID(ResourceId id)
|
||||
return ret;
|
||||
}
|
||||
|
||||
vector<CounterResult> ProxySerialiser::FetchCounters(uint32_t frameID, uint32_t minEventID, uint32_t maxEventID, const vector<uint32_t> &counters)
|
||||
vector<CounterResult> ProxySerialiser::FetchCounters(uint32_t frameID, const vector<uint32_t> &counters)
|
||||
{
|
||||
vector<CounterResult> ret;
|
||||
|
||||
m_ToReplaySerialiser->Serialise("", frameID);
|
||||
m_ToReplaySerialiser->Serialise("", minEventID);
|
||||
m_ToReplaySerialiser->Serialise("", maxEventID);
|
||||
m_ToReplaySerialiser->Serialise("", (vector<uint32_t> &)counters);
|
||||
|
||||
if(m_ReplayHost)
|
||||
{
|
||||
ret = m_Remote->FetchCounters(frameID, minEventID, maxEventID, counters);
|
||||
ret = m_Remote->FetchCounters(frameID, counters);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -348,7 +348,7 @@ class ProxySerialiser : public IReplayDriver, Callstack::StackResolver
|
||||
|
||||
vector<uint32_t> EnumerateCounters();
|
||||
void DescribeCounter(uint32_t counterID, CounterDescription &desc);
|
||||
vector<CounterResult> FetchCounters(uint32_t frameID, uint32_t minEventID, uint32_t maxEventID, const vector<uint32_t> &counterID);
|
||||
vector<CounterResult> FetchCounters(uint32_t frameID, const vector<uint32_t> &counterID);
|
||||
|
||||
void FillCBufferVariables(ResourceId shader, string entryPoint, uint32_t cbufSlot, vector<ShaderVariable> &outvars, const vector<byte> &data);
|
||||
|
||||
|
||||
@@ -144,8 +144,6 @@ struct GPUTimer
|
||||
struct CounterContext
|
||||
{
|
||||
uint32_t frameID;
|
||||
uint32_t minEID;
|
||||
uint32_t maxEID;
|
||||
uint32_t eventStart;
|
||||
vector<GPUTimer> timers;
|
||||
int reuseIdx;
|
||||
@@ -168,9 +166,6 @@ void D3D11DebugManager::FillTimers(CounterContext &ctx, const DrawcallTreeNode &
|
||||
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
bool includeEvent = (d.eventID >= ctx.minEID && d.eventID <= ctx.maxEID);
|
||||
|
||||
if(includeEvent)
|
||||
{
|
||||
if(ctx.reuseIdx == -1)
|
||||
{
|
||||
@@ -195,7 +190,7 @@ void D3D11DebugManager::FillTimers(CounterContext &ctx, const DrawcallTreeNode &
|
||||
|
||||
m_pImmediateContext->Flush();
|
||||
|
||||
if(includeEvent && timer->before && timer->after)
|
||||
if(timer->before && timer->after)
|
||||
{
|
||||
m_pImmediateContext->End(timer->before);
|
||||
m_WrappedDevice->ReplayLog(ctx.frameID, ctx.eventStart, d.eventID, eReplay_OnlyDraw);
|
||||
@@ -210,7 +205,7 @@ void D3D11DebugManager::FillTimers(CounterContext &ctx, const DrawcallTreeNode &
|
||||
}
|
||||
}
|
||||
|
||||
vector<CounterResult> D3D11DebugManager::FetchCounters(uint32_t frameID, uint32_t minEventID, uint32_t maxEventID, const vector<uint32_t> &counters)
|
||||
vector<CounterResult> D3D11DebugManager::FetchCounters(uint32_t frameID, const vector<uint32_t> &counters)
|
||||
{
|
||||
vector<CounterResult> ret;
|
||||
|
||||
@@ -224,7 +219,7 @@ vector<CounterResult> D3D11DebugManager::FetchCounters(uint32_t frameID, uint32_
|
||||
RDCASSERT(counters.size() == 1);
|
||||
RDCASSERT(counterID == eCounter_EventGPUDuration);
|
||||
|
||||
SCOPED_TIMER("Fetch Counters over %u-%u for %u", minEventID, maxEventID, counterID);
|
||||
SCOPED_TIMER("Fetch Counters for %u", counterID);
|
||||
|
||||
D3D11_QUERY_DESC disjointdesc = { D3D11_QUERY_TIMESTAMP_DISJOINT, 0 };
|
||||
ID3D11Query *disjoint = NULL;
|
||||
@@ -250,8 +245,6 @@ vector<CounterResult> D3D11DebugManager::FetchCounters(uint32_t frameID, uint32_
|
||||
|
||||
CounterContext ctx;
|
||||
ctx.frameID = frameID;
|
||||
ctx.minEID = minEventID;
|
||||
ctx.maxEID = maxEventID;
|
||||
|
||||
for(int loop=0; loop < 1; loop++)
|
||||
{
|
||||
|
||||
@@ -141,7 +141,7 @@ class D3D11DebugManager
|
||||
|
||||
vector<uint32_t> EnumerateCounters();
|
||||
void DescribeCounter(uint32_t counterID, CounterDescription &desc);
|
||||
vector<CounterResult> FetchCounters(uint32_t frameID, uint32_t minEventID, uint32_t maxEventID, const vector<uint32_t> &counters);
|
||||
vector<CounterResult> FetchCounters(uint32_t frameID, const vector<uint32_t> &counters);
|
||||
|
||||
void RenderText(float x, float y, const char *textfmt, ...);
|
||||
void RenderMesh(uint32_t frameID, uint32_t eventID, const vector<MeshFormat> &secondaryDraws, MeshDisplay cfg);
|
||||
|
||||
@@ -1396,9 +1396,9 @@ void D3D11Replay::DescribeCounter(uint32_t counterID, CounterDescription &desc)
|
||||
m_pDevice->GetDebugManager()->DescribeCounter(counterID, desc);
|
||||
}
|
||||
|
||||
vector<CounterResult> D3D11Replay::FetchCounters(uint32_t frameID, uint32_t minEventID, uint32_t maxEventID, const vector<uint32_t> &counters)
|
||||
vector<CounterResult> D3D11Replay::FetchCounters(uint32_t frameID, const vector<uint32_t> &counters)
|
||||
{
|
||||
return m_pDevice->GetDebugManager()->FetchCounters(frameID, minEventID, maxEventID, counters);
|
||||
return m_pDevice->GetDebugManager()->FetchCounters(frameID, counters);
|
||||
}
|
||||
|
||||
void D3D11Replay::RenderMesh(uint32_t frameID, uint32_t eventID, const vector<MeshFormat> &secondaryDraws, MeshDisplay cfg)
|
||||
|
||||
@@ -102,7 +102,7 @@ class D3D11Replay : public IReplayDriver
|
||||
|
||||
vector<uint32_t> EnumerateCounters();
|
||||
void DescribeCounter(uint32_t counterID, CounterDescription &desc);
|
||||
vector<CounterResult> FetchCounters(uint32_t frameID, uint32_t minEventID, uint32_t maxEventID, const vector<uint32_t> &counters);
|
||||
vector<CounterResult> FetchCounters(uint32_t frameID, const vector<uint32_t> &counters);
|
||||
|
||||
ResourceId CreateProxyTexture(FetchTexture templateTex);
|
||||
void SetProxyTextureData(ResourceId texid, uint32_t arrayIdx, uint32_t mip, byte *data, size_t dataSize);
|
||||
|
||||
@@ -83,8 +83,6 @@ struct GPUTimer
|
||||
struct CounterContext
|
||||
{
|
||||
uint32_t frameID;
|
||||
uint32_t minEID;
|
||||
uint32_t maxEID;
|
||||
uint32_t eventStart;
|
||||
vector<GPUTimer> timers;
|
||||
int reuseIdx;
|
||||
@@ -103,9 +101,6 @@ void GLReplay::FillTimers(CounterContext &ctx, const DrawcallTreeNode &drawnode)
|
||||
|
||||
GPUTimer *timer = NULL;
|
||||
|
||||
bool includeEvent = (d.eventID >= ctx.minEID && d.eventID <= ctx.maxEID);
|
||||
|
||||
if(includeEvent)
|
||||
{
|
||||
if(ctx.reuseIdx == -1)
|
||||
{
|
||||
@@ -125,7 +120,7 @@ void GLReplay::FillTimers(CounterContext &ctx, const DrawcallTreeNode &drawnode)
|
||||
|
||||
m_pDriver->ReplayLog(ctx.frameID, ctx.eventStart, d.eventID, eReplay_WithoutDraw);
|
||||
|
||||
if(includeEvent && timer->obj)
|
||||
if(timer->obj)
|
||||
{
|
||||
m_pDriver->glBeginQuery(eGL_TIME_ELAPSED, timer->obj);
|
||||
m_pDriver->ReplayLog(ctx.frameID, ctx.eventStart, d.eventID, eReplay_OnlyDraw);
|
||||
@@ -140,7 +135,7 @@ void GLReplay::FillTimers(CounterContext &ctx, const DrawcallTreeNode &drawnode)
|
||||
}
|
||||
}
|
||||
|
||||
vector<CounterResult> GLReplay::FetchCounters(uint32_t frameID, uint32_t minEventID, uint32_t maxEventID, const vector<uint32_t> &counters)
|
||||
vector<CounterResult> GLReplay::FetchCounters(uint32_t frameID, const vector<uint32_t> &counters)
|
||||
{
|
||||
vector<CounterResult> ret;
|
||||
|
||||
@@ -156,12 +151,10 @@ vector<CounterResult> GLReplay::FetchCounters(uint32_t frameID, uint32_t minEven
|
||||
RDCASSERT(counters.size() == 1);
|
||||
RDCASSERT(counterID == eCounter_EventGPUDuration);
|
||||
|
||||
SCOPED_TIMER("Fetch Counters over %u-%u for %u", minEventID, maxEventID, counterID);
|
||||
SCOPED_TIMER("Fetch Counters for %u", counterID);
|
||||
|
||||
CounterContext ctx;
|
||||
ctx.frameID = frameID;
|
||||
ctx.minEID = minEventID;
|
||||
ctx.maxEID = maxEventID;
|
||||
|
||||
for(int loop=0; loop < 1; loop++)
|
||||
{
|
||||
|
||||
@@ -147,7 +147,7 @@ class GLReplay : public IReplayDriver
|
||||
|
||||
vector<uint32_t> EnumerateCounters();
|
||||
void DescribeCounter(uint32_t counterID, CounterDescription &desc);
|
||||
vector<CounterResult> FetchCounters(uint32_t frameID, uint32_t minEventID, uint32_t maxEventID, const vector<uint32_t> &counters);
|
||||
vector<CounterResult> FetchCounters(uint32_t frameID, const vector<uint32_t> &counters);
|
||||
|
||||
void RenderMesh(uint32_t frameID, uint32_t eventID, const vector<MeshFormat> &secondaryDraws, MeshDisplay cfg);
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ struct GPUTimerCallback : public DrawcallCallback
|
||||
vector<uint32_t> m_Results;
|
||||
};
|
||||
|
||||
vector<CounterResult> VulkanReplay::FetchCounters(uint32_t frameID, uint32_t minEventID, uint32_t maxEventID, const vector<uint32_t> &counters)
|
||||
vector<CounterResult> VulkanReplay::FetchCounters(uint32_t frameID, const vector<uint32_t> &counters)
|
||||
{
|
||||
uint32_t maxEID = m_pDriver->GetMaxEID();
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ class VulkanReplay : public IReplayDriver
|
||||
|
||||
vector<uint32_t> EnumerateCounters();
|
||||
void DescribeCounter(uint32_t counterID, CounterDescription &desc);
|
||||
vector<CounterResult> FetchCounters(uint32_t frameID, uint32_t minEventID, uint32_t maxEventID, const vector<uint32_t> &counters);
|
||||
vector<CounterResult> FetchCounters(uint32_t frameID, const vector<uint32_t> &counters);
|
||||
|
||||
bool GetMinMax(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample, float *minval, float *maxval);
|
||||
bool GetHistogram(ResourceId texid, uint32_t sliceFace, uint32_t mip, uint32_t sample, float minval, float maxval, bool channels[4], vector<uint32_t> &histogram);
|
||||
|
||||
@@ -97,7 +97,7 @@ class IRemoteDriver
|
||||
|
||||
virtual vector<uint32_t> EnumerateCounters() = 0;
|
||||
virtual void DescribeCounter(uint32_t counterID, CounterDescription &desc) = 0;
|
||||
virtual vector<CounterResult> FetchCounters(uint32_t frameID, uint32_t minEventID, uint32_t maxEventID, const vector<uint32_t> &counterID) = 0;
|
||||
virtual vector<CounterResult> FetchCounters(uint32_t frameID, const vector<uint32_t> &counterID) = 0;
|
||||
|
||||
virtual void FillCBufferVariables(ResourceId shader, string entryPoint, uint32_t cbufSlot, vector<ShaderVariable> &outvars, const vector<byte> &data) = 0;
|
||||
|
||||
|
||||
@@ -273,8 +273,7 @@ bool ReplayRenderer::GetDrawcalls(uint32_t frameID, rdctype::array<FetchDrawcall
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ReplayRenderer::FetchCounters(uint32_t frameID, uint32_t minEventID, uint32_t maxEventID,
|
||||
uint32_t *counters, uint32_t numCounters, rdctype::array<CounterResult> *results)
|
||||
bool ReplayRenderer::FetchCounters(uint32_t frameID, uint32_t *counters, uint32_t numCounters, rdctype::array<CounterResult> *results)
|
||||
{
|
||||
if(frameID >= (uint32_t)m_FrameRecord.size() || results == NULL)
|
||||
return false;
|
||||
@@ -284,7 +283,7 @@ bool ReplayRenderer::FetchCounters(uint32_t frameID, uint32_t minEventID, uint32
|
||||
for(uint32_t i=0; i < numCounters; i++)
|
||||
counterArray.push_back(counters[i]);
|
||||
|
||||
*results = m_pDevice->FetchCounters(frameID, minEventID, maxEventID, counterArray);
|
||||
*results = m_pDevice->FetchCounters(frameID, counterArray);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1599,8 +1598,8 @@ extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetFrameInfo(ReplayR
|
||||
{ return rend->GetFrameInfo(frame); }
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_GetDrawcalls(ReplayRenderer *rend, uint32_t frameID, rdctype::array<FetchDrawcall> *draws)
|
||||
{ return rend->GetDrawcalls(frameID, draws); }
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_FetchCounters(ReplayRenderer *rend, uint32_t frameID, uint32_t minEventID, uint32_t maxEventID, uint32_t *counters, uint32_t numCounters, rdctype::array<CounterResult> *results)
|
||||
{ return rend->FetchCounters(frameID, minEventID, maxEventID, counters, numCounters, results); }
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_FetchCounters(ReplayRenderer *rend, uint32_t frameID, uint32_t *counters, uint32_t numCounters, rdctype::array<CounterResult> *results)
|
||||
{ return rend->FetchCounters(frameID, counters, numCounters, results); }
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_EnumerateCounters(ReplayRenderer *rend, rdctype::array<uint32_t> *counters)
|
||||
{ return rend->EnumerateCounters(counters); }
|
||||
extern "C" RENDERDOC_API bool32 RENDERDOC_CC ReplayRenderer_DescribeCounter(ReplayRenderer *rend, uint32_t counterID, CounterDescription *desc)
|
||||
|
||||
@@ -162,7 +162,7 @@ struct ReplayRenderer : public IReplayRenderer
|
||||
|
||||
bool GetFrameInfo(rdctype::array<FetchFrameInfo> *frame);
|
||||
bool GetDrawcalls(uint32_t frameID, rdctype::array<FetchDrawcall> *draws);
|
||||
bool FetchCounters(uint32_t frameID, uint32_t minEventID, uint32_t maxEventID, uint32_t *counters, uint32_t numCounters, rdctype::array<CounterResult> *results);
|
||||
bool FetchCounters(uint32_t frameID, uint32_t *counters, uint32_t numCounters, rdctype::array<CounterResult> *results);
|
||||
bool EnumerateCounters(rdctype::array<uint32_t> *counters);
|
||||
bool DescribeCounter(uint32_t counterID, CounterDescription *desc);
|
||||
bool GetTextures(rdctype::array<FetchTexture> *texs);
|
||||
|
||||
@@ -235,7 +235,7 @@ namespace renderdoc
|
||||
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern bool ReplayRenderer_GetDrawcalls(IntPtr real, UInt32 frameID, IntPtr outdraws);
|
||||
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern bool ReplayRenderer_FetchCounters(IntPtr real, UInt32 frameID, UInt32 minEventID, UInt32 maxEventID, IntPtr counters, UInt32 numCounters, IntPtr outresults);
|
||||
private static extern bool ReplayRenderer_FetchCounters(IntPtr real, UInt32 frameID, IntPtr counters, UInt32 numCounters, IntPtr outresults);
|
||||
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
|
||||
private static extern bool ReplayRenderer_EnumerateCounters(IntPtr real, IntPtr outcounters);
|
||||
[DllImport("renderdoc.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)]
|
||||
@@ -471,7 +471,7 @@ namespace renderdoc
|
||||
}
|
||||
}
|
||||
|
||||
public Dictionary<uint, List<CounterResult>> FetchCounters(UInt32 frameID, UInt32 minEventID, UInt32 maxEventID, UInt32[] counters)
|
||||
public Dictionary<uint, List<CounterResult>> FetchCounters(UInt32 frameID, UInt32[] counters)
|
||||
{
|
||||
IntPtr mem = CustomMarshal.Alloc(typeof(templated_array));
|
||||
|
||||
@@ -481,7 +481,7 @@ namespace renderdoc
|
||||
for (int i = 0; i < counters.Length; i++)
|
||||
Marshal.WriteInt32(countersmem, sizeof(UInt32) * i, (int)counters[i]);
|
||||
|
||||
bool success = ReplayRenderer_FetchCounters(m_Real, frameID, minEventID, maxEventID, countersmem, (uint)counters.Length, mem);
|
||||
bool success = ReplayRenderer_FetchCounters(m_Real, frameID, countersmem, (uint)counters.Length, mem);
|
||||
|
||||
CustomMarshal.Free(countersmem);
|
||||
|
||||
|
||||
@@ -780,7 +780,7 @@ namespace renderdocui.Windows
|
||||
|
||||
Dictionary<uint, List<CounterResult>>[] times = new Dictionary<uint, List<CounterResult>>[m_Core.FrameInfo.Length];
|
||||
for (int curFrame = 0; curFrame < m_Core.FrameInfo.Length; curFrame++)
|
||||
times[curFrame] = r.FetchCounters((UInt32)curFrame, 0, ~0U, counters);
|
||||
times[curFrame] = r.FetchCounters((UInt32)curFrame, counters);
|
||||
|
||||
BeginInvoke((MethodInvoker)delegate
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user