mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-23 06:05:45 +00:00
Fix proxy serialisation of SDObject to set parent pointer correctly
This commit is contained in:
@@ -920,6 +920,12 @@ private:
|
||||
SDObject *m_Parent = NULL;
|
||||
mutable LazyArrayData *m_Lazy = NULL;
|
||||
|
||||
// object serialisers need to be able to set the parent pointer. This is only for proxying really
|
||||
template <class SerialiserType>
|
||||
friend void DoSerialise(SerialiserType &ser, SDObject &el);
|
||||
template <class SerialiserType>
|
||||
friend void DoSerialise(SerialiserType &ser, SDChunk &el);
|
||||
|
||||
void DeleteLazyGenerator() const
|
||||
{
|
||||
if(m_Lazy)
|
||||
|
||||
@@ -718,6 +718,12 @@ void DoSerialise(SerialiserType &ser, SDObject &el)
|
||||
SERIALISE_MEMBER(name);
|
||||
SERIALISE_MEMBER(type);
|
||||
SERIALISE_MEMBER(data);
|
||||
|
||||
if(ser.IsReading())
|
||||
{
|
||||
for(size_t i = 0; i < el.NumChildren(); i++)
|
||||
el.GetChild(i)->m_Parent = ⪙
|
||||
}
|
||||
}
|
||||
|
||||
template <class SerialiserType>
|
||||
@@ -727,6 +733,12 @@ void DoSerialise(SerialiserType &ser, SDChunk &el)
|
||||
SERIALISE_MEMBER(type);
|
||||
SERIALISE_MEMBER(data);
|
||||
SERIALISE_MEMBER(metadata);
|
||||
|
||||
if(ser.IsReading())
|
||||
{
|
||||
for(size_t i = 0; i < el.NumChildren(); i++)
|
||||
el.GetChild(i)->m_Parent = ⪙
|
||||
}
|
||||
}
|
||||
|
||||
INSTANTIATE_SERIALISE_TYPE(SDChunk);
|
||||
|
||||
Reference in New Issue
Block a user