mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 10:00:40 +00:00
Free shader debugger in replay driver so it's proxied correctly
This commit is contained in:
@@ -272,6 +272,7 @@ public:
|
||||
return new ShaderDebugTrace();
|
||||
}
|
||||
rdcarray<ShaderDebugState> ContinueDebug(ShaderDebugger *debugger) { return {}; }
|
||||
void FreeDebugger(ShaderDebugger *debugger) { delete debugger; }
|
||||
void BuildTargetShader(ShaderEncoding sourceEncoding, const bytebuf &source, const rdcstr &entry,
|
||||
const ShaderCompileFlags &compileFlags, ShaderStage type, ResourceId &id,
|
||||
rdcstr &errors)
|
||||
|
||||
@@ -95,6 +95,7 @@ rdcstr DoStringise(const ReplayProxyPacket &el)
|
||||
STRINGISE_ENUM_NAMED(eReplayProxy_GetDriverInfo, "GetDriverInfo");
|
||||
|
||||
STRINGISE_ENUM_NAMED(eReplayProxy_ContinueDebug, "ContinueDebug");
|
||||
STRINGISE_ENUM_NAMED(eReplayProxy_FreeDebugger, "FreeDebugger");
|
||||
}
|
||||
END_ENUM_STRINGISE();
|
||||
}
|
||||
@@ -1601,6 +1602,35 @@ rdcarray<ShaderDebugState> ReplayProxy::ContinueDebug(ShaderDebugger *debugger)
|
||||
PROXY_FUNCTION(ContinueDebug, debugger);
|
||||
}
|
||||
|
||||
template <typename ParamSerialiser, typename ReturnSerialiser>
|
||||
void ReplayProxy::Proxied_FreeDebugger(ParamSerialiser ¶mser, ReturnSerialiser &retser,
|
||||
ShaderDebugger *debugger)
|
||||
{
|
||||
const ReplayProxyPacket expectedPacket = eReplayProxy_FreeDebugger;
|
||||
ReplayProxyPacket packet = eReplayProxy_FreeDebugger;
|
||||
|
||||
{
|
||||
BEGIN_PARAMS();
|
||||
uint64_t debugger_ptr = (uint64_t)(uintptr_t)debugger;
|
||||
SERIALISE_ELEMENT(debugger_ptr);
|
||||
debugger = (ShaderDebugger *)(uintptr_t)debugger_ptr;
|
||||
END_PARAMS();
|
||||
}
|
||||
|
||||
{
|
||||
REMOTE_EXECUTION();
|
||||
if(paramser.IsReading() && !paramser.IsErrored() && !m_IsErrored)
|
||||
m_Remote->FreeDebugger(debugger);
|
||||
}
|
||||
|
||||
CheckError(packet, expectedPacket);
|
||||
}
|
||||
|
||||
void ReplayProxy::FreeDebugger(ShaderDebugger *debugger)
|
||||
{
|
||||
PROXY_FUNCTION(FreeDebugger, debugger);
|
||||
}
|
||||
|
||||
template <typename ParamSerialiser, typename ReturnSerialiser>
|
||||
void ReplayProxy::Proxied_SavePipelineState(ParamSerialiser ¶mser, ReturnSerialiser &retser,
|
||||
uint32_t eventId)
|
||||
@@ -2790,6 +2820,7 @@ bool ReplayProxy::Tick(int type)
|
||||
break;
|
||||
}
|
||||
case eReplayProxy_ContinueDebug: ContinueDebug(NULL); break;
|
||||
case eReplayProxy_FreeDebugger: FreeDebugger(NULL); break;
|
||||
case eReplayProxy_RenderOverlay:
|
||||
RenderOverlay(ResourceId(), Subresource(), CompType::Typeless, FloatVector(),
|
||||
DebugOverlay::NoOverlay, 0, rdcarray<uint32_t>());
|
||||
|
||||
@@ -102,6 +102,7 @@ enum ReplayProxyPacket
|
||||
eReplayProxy_GetAvailableGPUs,
|
||||
|
||||
eReplayProxy_ContinueDebug,
|
||||
eReplayProxy_FreeDebugger,
|
||||
};
|
||||
|
||||
DECLARE_REFLECTION_ENUM(ReplayProxyPacket);
|
||||
@@ -529,6 +530,7 @@ public:
|
||||
IMPLEMENT_FUNCTION_PROXIED(ShaderDebugTrace *, DebugThread, uint32_t eventId,
|
||||
const uint32_t groupid[3], const uint32_t threadid[3]);
|
||||
IMPLEMENT_FUNCTION_PROXIED(rdcarray<ShaderDebugState>, ContinueDebug, ShaderDebugger *debugger);
|
||||
IMPLEMENT_FUNCTION_PROXIED(void, FreeDebugger, ShaderDebugger *debugger);
|
||||
|
||||
IMPLEMENT_FUNCTION_PROXIED(rdcarray<ShaderEncoding>, GetTargetShaderEncodings);
|
||||
IMPLEMENT_FUNCTION_PROXIED(void, BuildTargetShader, ShaderEncoding sourceEncoding,
|
||||
|
||||
@@ -237,6 +237,7 @@ public:
|
||||
ShaderDebugTrace *DebugThread(uint32_t eventId, const uint32_t groupid[3],
|
||||
const uint32_t threadid[3]);
|
||||
rdcarray<ShaderDebugState> ContinueDebug(ShaderDebugger *debugger);
|
||||
void FreeDebugger(ShaderDebugger *debugger);
|
||||
|
||||
uint32_t PickVertex(uint32_t eventId, int32_t width, int32_t height, const MeshDisplay &cfg,
|
||||
uint32_t x, uint32_t y);
|
||||
|
||||
@@ -2995,3 +2995,8 @@ rdcarray<ShaderDebugState> D3D11Replay::ContinueDebug(ShaderDebugger *debugger)
|
||||
|
||||
return interpreter->ContinueDebug(&apiWrapper);
|
||||
}
|
||||
|
||||
void D3D11Replay::FreeDebugger(ShaderDebugger *debugger)
|
||||
{
|
||||
delete debugger;
|
||||
}
|
||||
|
||||
@@ -192,6 +192,7 @@ public:
|
||||
ShaderDebugTrace *DebugThread(uint32_t eventId, const uint32_t groupid[3],
|
||||
const uint32_t threadid[3]);
|
||||
rdcarray<ShaderDebugState> ContinueDebug(ShaderDebugger *debugger);
|
||||
void FreeDebugger(ShaderDebugger *debugger);
|
||||
|
||||
uint32_t PickVertex(uint32_t eventId, int32_t width, int32_t height, const MeshDisplay &cfg,
|
||||
uint32_t x, uint32_t y);
|
||||
|
||||
@@ -2964,3 +2964,8 @@ rdcarray<ShaderDebugState> D3D12Replay::ContinueDebug(ShaderDebugger *debugger)
|
||||
|
||||
return interpreter->ContinueDebug(&apiWrapper);
|
||||
}
|
||||
|
||||
void D3D12Replay::FreeDebugger(ShaderDebugger *debugger)
|
||||
{
|
||||
delete debugger;
|
||||
}
|
||||
|
||||
@@ -3476,6 +3476,11 @@ rdcarray<ShaderDebugState> GLReplay::ContinueDebug(ShaderDebugger *debugger)
|
||||
return {};
|
||||
}
|
||||
|
||||
void GLReplay::FreeDebugger(ShaderDebugger *debugger)
|
||||
{
|
||||
delete debugger;
|
||||
}
|
||||
|
||||
void GLReplay::MakeCurrentReplayContext(GLWindowingData *ctx)
|
||||
{
|
||||
static GLWindowingData *prev = NULL;
|
||||
|
||||
@@ -223,6 +223,7 @@ public:
|
||||
ShaderDebugTrace *DebugThread(uint32_t eventId, const uint32_t groupid[3],
|
||||
const uint32_t threadid[3]);
|
||||
rdcarray<ShaderDebugState> ContinueDebug(ShaderDebugger *debugger);
|
||||
void FreeDebugger(ShaderDebugger *debugger);
|
||||
uint32_t PickVertex(uint32_t eventId, int32_t width, int32_t height, const MeshDisplay &cfg,
|
||||
uint32_t x, uint32_t y);
|
||||
|
||||
|
||||
@@ -378,6 +378,7 @@ public:
|
||||
ShaderDebugTrace *DebugThread(uint32_t eventId, const uint32_t groupid[3],
|
||||
const uint32_t threadid[3]);
|
||||
rdcarray<ShaderDebugState> ContinueDebug(ShaderDebugger *debugger);
|
||||
void FreeDebugger(ShaderDebugger *debugger);
|
||||
|
||||
uint32_t PickVertex(uint32_t eventId, int32_t width, int32_t height, const MeshDisplay &cfg,
|
||||
uint32_t x, uint32_t y);
|
||||
|
||||
@@ -4263,3 +4263,8 @@ rdcarray<ShaderDebugState> VulkanReplay::ContinueDebug(ShaderDebugger *debugger)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void VulkanReplay::FreeDebugger(ShaderDebugger *debugger)
|
||||
{
|
||||
delete debugger;
|
||||
}
|
||||
|
||||
@@ -1625,7 +1625,7 @@ void ReplayController::FreeTrace(ShaderDebugTrace *trace)
|
||||
|
||||
if(trace)
|
||||
{
|
||||
SAFE_DELETE(trace->debugger);
|
||||
m_pDevice->FreeDebugger(trace->debugger);
|
||||
delete trace;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,6 +188,7 @@ public:
|
||||
virtual ShaderDebugTrace *DebugThread(uint32_t eventId, const uint32_t groupid[3],
|
||||
const uint32_t threadid[3]) = 0;
|
||||
virtual rdcarray<ShaderDebugState> ContinueDebug(ShaderDebugger *debugger) = 0;
|
||||
virtual void FreeDebugger(ShaderDebugger *debugger) = 0;
|
||||
|
||||
virtual ResourceId RenderOverlay(ResourceId texid, const Subresource &sub, CompType typeCast,
|
||||
FloatVector clearCol, DebugOverlay overlay, uint32_t eventId,
|
||||
|
||||
Reference in New Issue
Block a user