Remove bool applyInitialState from D3D Serialise_BeginCaptureFrame

* Instead we just skip the chunk wholesale when we're doing a partial
  replay and don't want to apply it.
This commit is contained in:
baldurk
2017-12-27 15:58:10 +00:00
parent 9ca9e086b1
commit e2d4078cfd
5 changed files with 18 additions and 16 deletions
+7 -6
View File
@@ -243,8 +243,7 @@ void DoSerialise(SerialiserType &ser, HiddenCounter &el)
}
template <typename SerialiserType>
bool WrappedID3D11DeviceContext::Serialise_BeginCaptureFrame(SerialiserType &ser,
bool applyInitialState)
bool WrappedID3D11DeviceContext::Serialise_BeginCaptureFrame(SerialiserType &ser)
{
D3D11RenderState state(D3D11RenderState::Empty);
@@ -348,9 +347,8 @@ bool WrappedID3D11DeviceContext::Serialise_BeginCaptureFrame(SerialiserType &ser
SERIALISE_CHECK_READ_ERRORS();
if(IsReplayingAndReading() && applyInitialState)
if(IsReplayingAndReading())
{
if(applyInitialState)
{
m_DoStateVerify = false;
{
@@ -428,7 +426,7 @@ void WrappedID3D11DeviceContext::BeginCaptureFrame()
WriteSerialiser &ser = m_ScratchSerialiser;
SCOPED_SERIALISE_CHUNK(SystemChunk::CaptureBegin);
Serialise_BeginCaptureFrame(ser, false);
Serialise_BeginCaptureFrame(ser);
{
SCOPED_LOCK(m_AnnotLock);
@@ -1124,7 +1122,10 @@ ReplayStatus WrappedID3D11DeviceContext::ReplayLog(CaptureState readType, uint32
SystemChunk header = ser.ReadChunk<SystemChunk>();
RDCASSERTEQUAL(header, SystemChunk::CaptureBegin);
Serialise_BeginCaptureFrame(ser, !partial);
if(partial)
ser.SkipCurrentChunk();
else
Serialise_BeginCaptureFrame(ser);
ser.EndChunk();
+1 -1
View File
@@ -269,7 +269,7 @@ public:
void EndFrame();
template <typename SerialiserType>
bool Serialise_BeginCaptureFrame(SerialiserType &ser, bool applyInitialState);
bool Serialise_BeginCaptureFrame(SerialiserType &ser);
void BeginCaptureFrame();
void EndCaptureFrame();
+4 -1
View File
@@ -545,7 +545,10 @@ ReplayStatus WrappedID3D12CommandQueue::ReplayLog(CaptureState readType, uint32_
SystemChunk header = ser.ReadChunk<SystemChunk>();
RDCASSERTEQUAL(header, SystemChunk::CaptureBegin);
m_pDevice->Serialise_BeginCaptureFrame(ser, !partial);
if(partial)
ser.SkipCurrentChunk();
else
m_pDevice->Serialise_BeginCaptureFrame(ser);
ser.EndChunk();
+5 -7
View File
@@ -1179,7 +1179,7 @@ bool WrappedID3D12Device::Serialise_CaptureScope(SerialiserType &ser)
}
template <typename SerialiserType>
bool WrappedID3D12Device::Serialise_BeginCaptureFrame(SerialiserType &ser, bool applyInitialState)
bool WrappedID3D12Device::Serialise_BeginCaptureFrame(SerialiserType &ser)
{
std::vector<D3D12_RESOURCE_BARRIER> barriers;
@@ -1190,7 +1190,7 @@ bool WrappedID3D12Device::Serialise_BeginCaptureFrame(SerialiserType &ser, bool
SERIALISE_CHECK_READ_ERRORS();
if(applyInitialState && !barriers.empty())
if(IsReplayingAndReading() && !barriers.empty())
{
// apply initial resource states
ID3D12GraphicsCommandList *list = GetNewList();
@@ -1206,10 +1206,8 @@ bool WrappedID3D12Device::Serialise_BeginCaptureFrame(SerialiserType &ser, bool
return true;
}
template bool WrappedID3D12Device::Serialise_BeginCaptureFrame(ReadSerialiser &ser,
bool applyInitialState);
template bool WrappedID3D12Device::Serialise_BeginCaptureFrame(WriteSerialiser &ser,
bool applyInitialState);
template bool WrappedID3D12Device::Serialise_BeginCaptureFrame(ReadSerialiser &ser);
template bool WrappedID3D12Device::Serialise_BeginCaptureFrame(WriteSerialiser &ser);
void WrappedID3D12Device::EndCaptureFrame(ID3D12Resource *presentImage)
{
@@ -1277,7 +1275,7 @@ void WrappedID3D12Device::StartFrameCapture(void *dev, void *wnd)
SCOPED_SERIALISE_CHUNK(SystemChunk::CaptureBegin);
Serialise_BeginCaptureFrame(ser, false);
Serialise_BeginCaptureFrame(ser);
// need to hold onto this as it must come right after the capture chunk,
// before any command lists
+1 -1
View File
@@ -469,7 +469,7 @@ public:
bool EndFrameCapture(void *dev, void *wnd);
template <typename SerialiserType>
bool Serialise_BeginCaptureFrame(SerialiserType &ser, bool applyInitialState);
bool Serialise_BeginCaptureFrame(SerialiserType &ser);
template <typename SerialiserType>
bool Serialise_DynamicDescriptorWrite(SerialiserType &ser, const DynamicDescriptorWrite *write);