Add new replay API void ReloadShaderDebugInformation()

This commit is contained in:
Jake Turner
2026-02-05 07:00:09 +13:00
parent c097a8b024
commit cbecdfacb0
17 changed files with 77 additions and 0 deletions
+4
View File
@@ -727,6 +727,10 @@ re-initialise any data, including e.g. bindless feedback, printf results or mesh
)");
virtual void ClearReplayCache() = 0;
DOCUMENT(R"(Reload the shader debug information for all shaders in the capture.
)");
virtual void ReloadShaderDebugInformation() = 0;
DOCUMENT(R"(Remove any previously specified replacement for an object.
See :meth:`ReplaceResource`.
+1
View File
@@ -368,6 +368,7 @@ public:
}
void ReplaceResource(ResourceId from, ResourceId to) {}
void ClearReplayCache() {}
void ReloadShaderDebugInformation() {}
void RemoveReplacement(ResourceId id) {}
// these are proxy functions, and will never be used
ResourceId CreateProxyTexture(const TextureDescription &templateTex)
+27
View File
@@ -1369,6 +1369,32 @@ void ReplayProxy::ClearReplayCache()
PROXY_FUNCTION(ClearReplayCache);
}
template <typename ParamSerialiser, typename ReturnSerialiser>
void ReplayProxy::Proxied_ReloadShaderDebugInformation(ParamSerialiser &paramser,
ReturnSerialiser &retser)
{
const ReplayProxyPacket expectedPacket = eReplayProxy_ReloadShaderDebugInformation;
ReplayProxyPacket packet = eReplayProxy_ReloadShaderDebugInformation;
{
BEGIN_PARAMS();
END_PARAMS();
}
{
REMOTE_EXECUTION();
if(paramser.IsReading() && !paramser.IsErrored() && !m_IsErrored)
m_Remote->ReloadShaderDebugInformation();
}
SERIALISE_RETURN_VOID();
}
void ReplayProxy::ReloadShaderDebugInformation()
{
PROXY_FUNCTION(ReloadShaderDebugInformation);
}
template <typename ParamSerialiser, typename ReturnSerialiser>
rdcarray<ShaderEncoding> ReplayProxy::Proxied_GetTargetShaderEncodings(ParamSerialiser &paramser,
ReturnSerialiser &retser)
@@ -3135,6 +3161,7 @@ bool ReplayProxy::Tick(int type)
case eReplayProxy_ReplaceResource: ReplaceResource(ResourceId(), ResourceId()); break;
case eReplayProxy_RemoveReplacement: RemoveReplacement(ResourceId()); break;
case eReplayProxy_ClearReplayCache: ClearReplayCache(); break;
case eReplayProxy_ReloadShaderDebugInformation: ReloadShaderDebugInformation(); break;
case eReplayProxy_DebugVertex: DebugVertex(0, 0, 0, 0, 0); break;
case eReplayProxy_DebugPixel: DebugPixel(0, 0, 0, DebugPixelInputs()); break;
case eReplayProxy_DebugThread:
+2
View File
@@ -113,6 +113,7 @@ enum ReplayProxyPacket
eReplayProxy_GetDescriptorStores,
eReplayProxy_ClearReplayCache,
eReplayProxy_ReloadShaderDebugInformation,
};
DECLARE_REFLECTION_ENUM(ReplayProxyPacket);
@@ -561,6 +562,7 @@ public:
IMPLEMENT_FUNCTION_PROXIED(void, ReplaceResource, ResourceId from, ResourceId to);
IMPLEMENT_FUNCTION_PROXIED(void, RemoveReplacement, ResourceId id);
IMPLEMENT_FUNCTION_PROXIED(void, ClearReplayCache);
IMPLEMENT_FUNCTION_PROXIED(void, ReloadShaderDebugInformation);
// these functions are not part of the replay driver interface - they are similar to GetBufferData
// and GetTextureData, but they do extra work to try and optimise transfer by delta-encoding the
+7
View File
@@ -2701,6 +2701,13 @@ void D3D11Replay::ClearReplayCache()
ClearPostVSCache();
}
void D3D11Replay::ReloadShaderDebugInformation()
{
DXBC::ResetSearchDirsCache();
WrappedID3D11Shader<ID3D11ComputeShader>::ReloadShaderDebugInformation();
ClearReplayCache();
}
D3D11DebugManager *D3D11Replay::GetDebugManager()
{
return m_pDevice->GetDebugManager();
+1
View File
@@ -255,6 +255,7 @@ public:
void ReplaceResource(ResourceId from, ResourceId to);
void RemoveReplacement(ResourceId id);
void ClearReplayCache();
void ReloadShaderDebugInformation();
rdcarray<GPUCounter> EnumerateCounters();
CounterDescription DescribeCounter(GPUCounter counterID);
+7
View File
@@ -3634,6 +3634,13 @@ void D3D12Replay::ClearReplayCache()
ClearFeedbackCache();
}
void D3D12Replay::ReloadShaderDebugInformation()
{
DXBC::ResetSearchDirsCache();
WrappedID3D12Shader::ReloadShaderDebugInformation();
ClearReplayCache();
}
void D3D12Replay::RefreshDerivedReplacements()
{
D3D12ResourceManager *rm = m_pDevice->GetResourceManager();
+1
View File
@@ -225,6 +225,7 @@ public:
void ReplaceResource(ResourceId from, ResourceId to);
void RemoveReplacement(ResourceId id);
void ClearReplayCache();
void ReloadShaderDebugInformation();
rdcarray<GPUCounter> EnumerateCounters();
CounterDescription DescribeCounter(GPUCounter counterID);
+5
View File
@@ -3747,6 +3747,11 @@ void GLReplay::ClearReplayCache()
ClearPostVSCache();
}
void GLReplay::ReloadShaderDebugInformation()
{
// Nop : GL does not have seperate debug information
}
ResourceId GLReplay::CreateProxyTexture(const TextureDescription &templateTex)
{
WrappedOpenGL &drv = *m_pDriver;
+1
View File
@@ -274,6 +274,7 @@ public:
void ReplaceResource(ResourceId from, ResourceId to);
void RemoveReplacement(ResourceId id);
void ClearReplayCache();
void ReloadShaderDebugInformation();
rdcarray<GPUCounter> EnumerateCounters();
CounterDescription DescribeCounter(GPUCounter counterID);
+6
View File
@@ -5203,6 +5203,12 @@ void VulkanReplay::ClearReplayCache()
ClearFeedbackCache();
}
void VulkanReplay::ReloadShaderDebugInformation()
{
m_pDriver->ReloadShaderDebugInformation();
ClearReplayCache();
}
void VulkanReplay::ReplaceResource(ResourceId from, ResourceId to)
{
// remove existing shader replacement
+1
View File
@@ -422,6 +422,7 @@ public:
void ReplaceResource(ResourceId from, ResourceId to);
void RemoveReplacement(ResourceId id);
void ClearReplayCache();
void ReloadShaderDebugInformation();
void RenderMesh(uint32_t eventId, const rdcarray<MeshFormat> &secondaryDraws,
const MeshDisplay &cfg);
+4
View File
@@ -262,6 +262,10 @@ void DummyDriver::ClearReplayCache()
{
}
void DummyDriver::ReloadShaderDebugInformation()
{
}
rdcarray<GPUCounter> DummyDriver::EnumerateCounters()
{
return {};
+1
View File
@@ -97,6 +97,7 @@ public:
void RemoveReplacement(ResourceId id);
void FreeTargetResource(ResourceId id);
void ClearReplayCache();
void ReloadShaderDebugInformation();
rdcarray<GPUCounter> EnumerateCounters();
CounterDescription DescribeCounter(GPUCounter counterID);
+7
View File
@@ -2164,6 +2164,13 @@ void ReplayController::ClearReplayCache()
m_pDevice->ClearReplayCache();
}
void ReplayController::ReloadShaderDebugInformation()
{
CHECK_REPLAY_THREAD();
m_pDevice->ReloadShaderDebugInformation();
}
RDResult ReplayController::CreateDevice(RDCFile *rdc, const ReplayOptions &opts)
{
CHECK_REPLAY_THREAD();
+1
View File
@@ -179,6 +179,7 @@ public:
void RemoveReplacement(ResourceId id);
void FreeTargetResource(ResourceId id);
void ClearReplayCache();
void ReloadShaderDebugInformation();
FrameDescription GetFrameInfo();
const SDFile &GetStructuredFile();
+1
View File
@@ -212,6 +212,7 @@ public:
virtual void RemoveReplacement(ResourceId id) = 0;
virtual void FreeTargetResource(ResourceId id) = 0;
virtual void ClearReplayCache() = 0;
virtual void ReloadShaderDebugInformation() = 0;
virtual rdcarray<GPUCounter> EnumerateCounters() = 0;
virtual CounterDescription DescribeCounter(GPUCounter counterID) = 0;