mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-08 16:50:44 +00:00
Add a way to hint the initial size of the serialiser buffer
This commit is contained in:
@@ -162,7 +162,10 @@ WrappedID3D12CommandQueue::WrappedID3D12CommandQueue(ID3D12CommandQueue *real,
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pSerialiser = new Serialiser(NULL, Serialiser::WRITING, debugSerialiser);
|
||||
// make serialisers smaller by default since we create a lot of these internally for small
|
||||
// commands.
|
||||
// User lists will quickly grow to a steady-state over time.
|
||||
m_pSerialiser = new Serialiser(NULL, Serialiser::WRITING, debugSerialiser, 256);
|
||||
|
||||
m_pSerialiser->SetDebugText(debugSerialiser);
|
||||
}
|
||||
|
||||
@@ -634,7 +634,7 @@ Serialiser::Serialiser(size_t length, const byte *memoryBuf, bool fileheader)
|
||||
}
|
||||
}
|
||||
|
||||
Serialiser::Serialiser(const char *path, Mode mode, bool debugMode)
|
||||
Serialiser::Serialiser(const char *path, Mode mode, bool debugMode, uint64_t sizeHint)
|
||||
: m_pCallstack(NULL), m_pResolver(NULL), m_Buffer(NULL)
|
||||
{
|
||||
m_ResolverThread = 0;
|
||||
@@ -935,7 +935,7 @@ Serialiser::Serialiser(const char *path, Mode mode, bool debugMode)
|
||||
}
|
||||
else
|
||||
{
|
||||
m_BufferSize = 128 * 1024;
|
||||
m_BufferSize = sizeHint;
|
||||
m_BufferHead = m_Buffer = AllocAlignedBuffer((size_t)m_BufferSize);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ public:
|
||||
// Init and error handling
|
||||
|
||||
Serialiser(size_t length, const byte *memoryBuf, bool fileheader);
|
||||
Serialiser(const char *path, Mode mode, bool debugMode = false);
|
||||
Serialiser(const char *path, Mode mode, bool debugMode, uint64_t sizeHint = 128 * 1024);
|
||||
~Serialiser();
|
||||
|
||||
bool HasError() { return m_HasError; }
|
||||
|
||||
Reference in New Issue
Block a user