mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-09 01:00:51 +00:00
Expose the total number of sections via ICaptureAccess
* This lets external code iterate over all sections.
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
#include "strings/string_utils.h"
|
||||
#include "replay_proxy.h"
|
||||
|
||||
static const uint32_t RemoteServerProtocolVersion = 2;
|
||||
static const uint32_t RemoteServerProtocolVersion = 3;
|
||||
|
||||
enum RemoteServerPacket
|
||||
{
|
||||
@@ -61,6 +61,7 @@ enum RemoteServerPacket
|
||||
eRemoteServer_ListDir,
|
||||
eRemoteServer_ExecuteAndInject,
|
||||
eRemoteServer_ShutdownServer,
|
||||
eRemoteServer_GetSectionCount,
|
||||
eRemoteServer_FindSectionByName,
|
||||
eRemoteServer_FindSectionByType,
|
||||
eRemoteServer_GetSectionProperties,
|
||||
@@ -559,6 +560,18 @@ static void ActiveRemoteClientThread(ClientThread *threadData)
|
||||
SERIALISE_ELEMENT(StackFrames);
|
||||
}
|
||||
}
|
||||
else if(type == eRemoteServer_GetSectionCount)
|
||||
{
|
||||
reader.EndChunk();
|
||||
|
||||
int count = rdc ? rdc->NumSections() : 0;
|
||||
|
||||
{
|
||||
WRITE_DATA_SCOPE();
|
||||
SCOPED_SERIALISE_CHUNK(eRemoteServer_GetSectionCount);
|
||||
SERIALISE_ELEMENT(count);
|
||||
}
|
||||
}
|
||||
else if(type == eRemoteServer_FindSectionByName)
|
||||
{
|
||||
std::string name;
|
||||
@@ -1408,6 +1421,37 @@ public:
|
||||
rend->Shutdown();
|
||||
}
|
||||
|
||||
int GetSectionCount()
|
||||
{
|
||||
if(!Connected())
|
||||
return 0;
|
||||
|
||||
{
|
||||
WRITE_DATA_SCOPE();
|
||||
SCOPED_SERIALISE_CHUNK(eRemoteServer_GetSectionCount);
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
|
||||
{
|
||||
READ_DATA_SCOPE();
|
||||
RemoteServerPacket type = ser.ReadChunk<RemoteServerPacket>();
|
||||
|
||||
if(type == eRemoteServer_GetSectionCount)
|
||||
{
|
||||
SERIALISE_ELEMENT(count);
|
||||
}
|
||||
else
|
||||
{
|
||||
RDCERR("Unexpected response to GetSectionCount");
|
||||
}
|
||||
|
||||
ser.EndChunk();
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
int FindSectionByName(const char *name)
|
||||
{
|
||||
if(!Connected())
|
||||
|
||||
Reference in New Issue
Block a user