Don't delete objects allocated in renderdoc module outside it.

This commit is contained in:
baldurk
2017-04-27 18:18:25 +01:00
parent 5fbf49a304
commit dd2f6eb88a
7 changed files with 25 additions and 7 deletions
+1 -1
View File
@@ -2759,7 +2759,7 @@ void BufferViewer::debugVertex()
if(trace->states.count == 0)
{
delete trace;
r->FreeTrace(trace);
// if we couldn't debug the pixel on this event, open up a pixel history
GUIInvoke::call([this]() {
+1 -1
View File
@@ -644,7 +644,7 @@ void PixelHistoryView::startDebug(EventTag tag)
if(trace->states.count == 0)
{
RDDialog::critical(this, tr("Debug Error"), tr("Error debugging pixel."));
delete trace;
m_Ctx.Replay().AsyncInvoke([trace](IReplayController *r) { r->FreeTrace(trace); });
return;
}
+4 -1
View File
@@ -484,7 +484,10 @@ void ShaderViewer::debugShader(const ShaderBindpointMapping *bind, const ShaderR
ShaderViewer::~ShaderViewer()
{
delete m_Trace;
// don't want to async invoke while using 'this', so save the trace separately
ShaderDebugTrace *trace = m_Trace;
m_Ctx.Replay().AsyncInvoke([trace](IReplayController *r) { r->FreeTrace(trace); });
if(m_CloseCallback)
m_CloseCallback(&m_Ctx);
+1 -1
View File
@@ -3284,7 +3284,7 @@ void TextureViewer::on_debugPixelContext_clicked()
if(trace->states.count == 0)
{
delete trace;
r->FreeTrace(trace);
// if we couldn't debug the pixel on this event, open up a pixel history
GUIInvoke::call([this]() { on_pixelHistory_clicked(); });
+12 -3
View File
@@ -672,7 +672,8 @@ newly generated messages will be returned after that.
indexed draws or drawn from the index buffer. This must have all drawcall offsets applied.
:param int instOffset: The value from :data:`DrawcallDescription.instanceOffset`.
:param int vertOffset: The value from :data:`DrawcallDescription.vertexOffset`.
:return: The resulting trace resulting from debugging.
:return: The resulting trace resulting from debugging. Destroy with
:meth:`FreeTrace`.
:rtype: ShaderDebugTrace
)");
virtual ShaderDebugTrace *DebugVertex(uint32_t vertid, uint32_t instid, uint32_t idx,
@@ -685,7 +686,8 @@ newly generated messages will be returned after that.
:param int sample: The multi-sampled sample. Ignored if non-multisampled texture.
:param int primitive: Debug the pixel from this primitive if there's ambiguity. If set to
:data:`NoPreference` then a random fragment writing to the given co-ordinate is debugged.
:return: The resulting trace resulting from debugging.
:return: The resulting trace resulting from debugging. Destroy with
:meth:`FreeTrace`.
:rtype: ShaderDebugTrace
)");
virtual ShaderDebugTrace *DebugPixel(uint32_t x, uint32_t y, uint32_t sample,
@@ -695,11 +697,18 @@ newly generated messages will be returned after that.
:param groupid: A list containing the 3D workgroup index.
:param threadid: A list containing the 3D thread index within the above workgroup.
:return: The resulting trace resulting from debugging.
:return: The resulting trace resulting from debugging. Destroy with
:meth:`FreeTrace`.
:rtype: ShaderDebugTrace
)");
virtual ShaderDebugTrace *DebugThread(uint32_t groupid[3], uint32_t threadid[3]) = 0;
DOCUMENT(R"(Free a debugging trace from running a shader invocation debug.
:param ShaderDebugTrace trace: The shader debugging trace to free.
)");
virtual void FreeTrace(ShaderDebugTrace *trace) = 0;
DOCUMENT(R"(Retrieve a list of ways a given resource is used.
:param ResourceId id: The id of the texture or buffer resource to be queried.
+5
View File
@@ -1317,6 +1317,11 @@ ShaderDebugTrace *ReplayController::DebugThread(uint32_t groupid[3], uint32_t th
return ret;
}
void ReplayController::FreeTrace(ShaderDebugTrace *trace)
{
delete trace;
}
rdctype::array<ShaderVariable> ReplayController::GetCBufferVariableContents(
ResourceId shader, const char *entryPoint, uint32_t cbufslot, ResourceId buffer, uint64_t offs)
{
+1
View File
@@ -171,6 +171,7 @@ public:
uint32_t vertOffset);
ShaderDebugTrace *DebugPixel(uint32_t x, uint32_t y, uint32_t sample, uint32_t primitive);
ShaderDebugTrace *DebugThread(uint32_t groupid[3], uint32_t threadid[3]);
void FreeTrace(ShaderDebugTrace *trace);
MeshFormat GetPostVSData(uint32_t instID, MeshDataStage stage);