#Enableable components don't have journaling entries
1 messages · Page 1 of 1 (latest)
This would likely be a challenge, as journaling only includes structural changes AFAIK. For example, we don't journal every change to every component value; toggling an enableable component state is closer to that than to a structural change.
Journalling writes anytime a component in a chunk is accessed for writing, not just on structural changes
ArchetypeChunk.GetNativeArray for example
public readonly NativeArray<T> GetNativeArray<T>(ref ComponentTypeHandle<T> typeHandle)
{
// ...
#if (UNITY_EDITOR || DEVELOPMENT_BUILD) && !DISABLE_ENTITIES_JOURNALING
if (Hint.Unlikely(m_EntityComponentStore->m_RecordToJournal != 0) && !typeHandle.IsReadOnly)
JournalAddRecordGetComponentDataRW(ref typeHandle, ptr, typeHandle.m_SizeInChunk * Count);
#endif
}```
i would have just expected something similar when accessing enable mask for writing via `ArchetypeChunk.GetEnabledMas` etc
also journaling does record all (potential) value changes, for example ComponentLookup<T>[entity] setter goes through
public byte* GetComponentDataWithTypeRW(Entity entity, TypeIndex typeIndex, uint globalVersion, ref LookupCache cache)
{
var data = ChunkDataUtility.GetComponentDataWithTypeRW(m_EntityInChunkByEntity[entity.Index].Chunk, m_ArchetypeByEntity[entity.Index], m_EntityInChunkByEntity[entity.Index].IndexInChunk, typeIndex, globalVersion, ref cache);
#if (UNITY_EDITOR || DEVELOPMENT_BUILD) && !DISABLE_ENTITIES_JOURNALING
if (Burst.CompilerServices.Hint.Unlikely(m_RecordToJournal != 0))
JournalAddRecordGetRW(entity, typeIndex, globalVersion, data);
#endif
return data;
}```