Serialise and replay calls to SetPipelineStackSize

This commit is contained in:
baldurk
2024-06-24 15:29:12 +01:00
parent 01384c4d42
commit 4648ef27f9
6 changed files with 51 additions and 1 deletions
@@ -1005,6 +1005,7 @@ bool WrappedID3D12CommandQueue::ProcessChunk(ReadSerialiser &ser, D3D12Chunk chu
case D3D12Chunk::Device_CreateStateObject:
case D3D12Chunk::Device_AddToStateObject:
case D3D12Chunk::CreateAS:
case D3D12Chunk::StateObject_SetPipelineStackSize:
RDCERR("Unexpected chunk while processing frame: %s", ToStr(chunk).c_str());
return false;
+1
View File
@@ -1223,5 +1223,6 @@ enum class D3D12Chunk : uint32_t
List_DispatchRays,
List_SetPipelineState1,
CreateAS,
StateObject_SetPipelineStackSize,
Max,
};
+43
View File
@@ -3816,6 +3816,47 @@ void WrappedID3D12Device::SetShaderExtUAV(GPUVendor vendor, uint32_t reg, uint32
INSTANTIATE_FUNCTION_SERIALISED(void, WrappedID3D12Device, SetShaderExtUAV, GPUVendor vendor,
uint32_t reg, uint32_t space, bool global);
template <typename SerialiserType>
bool WrappedID3D12Device::Serialise_SetPipelineStackSize(SerialiserType &ser,
ID3D12StateObject *pStateObject,
UINT64 StackSize)
{
SERIALISE_ELEMENT(pStateObject);
SERIALISE_ELEMENT(StackSize);
SERIALISE_CHECK_READ_ERRORS();
if(IsReplayingAndReading() && pStateObject)
{
ID3D12StateObjectProperties *properties = NULL;
pStateObject->QueryInterface(__uuidof(ID3D12StateObjectProperties), (void **)&properties);
properties->SetPipelineStackSize(StackSize);
SAFE_RELEASE(properties);
}
return true;
}
void WrappedID3D12Device::SetPipelineStackSize(ID3D12StateObject *pStateObject, UINT64 StackSize)
{
if(IsCaptureMode(m_State))
{
D3D12ResourceRecord *record = GetRecord(pStateObject);
{
WriteSerialiser &ser = GetThreadSerialiser();
SCOPED_SERIALISE_CHUNK(D3D12Chunk::StateObject_SetPipelineStackSize);
Serialise_SetPipelineStackSize(ser, pStateObject, StackSize);
record->AddChunk(scope.Get());
}
}
}
INSTANTIATE_FUNCTION_SERIALISED(void, WrappedID3D12Device, SetPipelineStackSize,
ID3D12StateObject *pStateObject, UINT64 StackSize);
void WrappedID3D12Device::SetShaderExt(GPUVendor vendor)
{
// just overwrite, we don't expect to switch back and forth on a given device.
@@ -4455,6 +4496,8 @@ bool WrappedID3D12Device::ProcessChunk(ReadSerialiser &ser, D3D12Chunk context)
case D3D12Chunk::Device_AddToStateObject:
return Serialise_AddToStateObject(ser, NULL, NULL, IID(), NULL);
case D3D12Chunk::CreateAS: return Serialise_CreateAS(ser, NULL, 0, {}, NULL);
case D3D12Chunk::StateObject_SetPipelineStackSize:
return Serialise_SetPipelineStackSize(ser, NULL, 0);
// in order to get a warning if we miss a case, we explicitly handle the list/queue chunks here.
// If we actually encounter one it's an error (we should hit CaptureBegin first and switch to
+2
View File
@@ -1280,6 +1280,8 @@ public:
ID3D12PipelineState **state);
// Resource
IMPLEMENT_FUNCTION_THREAD_SERIALISED(void, SetPipelineStackSize, ID3D12StateObject *pStateObject,
UINT64 StackSize);
IMPLEMENT_FUNCTION_THREAD_SERIALISED(void, SetName, ID3D12DeviceChild *pResource, const char *Name);
IMPLEMENT_FUNCTION_THREAD_SERIALISED(HRESULT, SetShaderDebugPath, ID3D12DeviceChild *pResource,
const char *Path);
+1
View File
@@ -1207,6 +1207,7 @@ public:
}
virtual void STDMETHODCALLTYPE SetPipelineStackSize(UINT64 PipelineStackSizeInBytes)
{
m_pDevice->SetPipelineStackSize(this, PipelineStackSizeInBytes);
properties->SetPipelineStackSize(PipelineStackSizeInBytes);
}
};
+3 -1
View File
@@ -28,7 +28,7 @@
template <>
rdcstr DoStringise(const D3D12Chunk &el)
{
RDCCOMPILE_ASSERT((uint32_t)D3D12Chunk::Max == 1132, "Chunks changed without updating names");
RDCCOMPILE_ASSERT((uint32_t)D3D12Chunk::Max == 1133, "Chunks changed without updating names");
BEGIN_ENUM_STRINGISE(D3D12Chunk)
{
@@ -234,6 +234,8 @@ rdcstr DoStringise(const D3D12Chunk &el)
STRINGISE_ENUM_CLASS_NAMED(List_SetPipelineState1,
"ID3D12GraphicsCommandList4::SetPipelineState1");
STRINGISE_ENUM_CLASS_NAMED(CreateAS, "Internal::Acceleration Structure Create");
STRINGISE_ENUM_CLASS_NAMED(StateObject_SetPipelineStackSize,
"ID3D12StateObjectProperties::SetPipelineStackSize");
STRINGISE_ENUM_CLASS_NAMED(Max, "Max Chunk");
}
END_ENUM_STRINGISE()