#[IN-93100] EntityComponentStore->AssertCanAddComponent and ChunkComponents

1 messages · Page 1 of 1 (latest)

cinder copper
#

EntityComponentStore->AssertCanAddComponent

If componentType is a ChunkComponent it is incorrectly doing this assertion check on the primary chunk archetype, instead of checking the MetaEntity Archetype where the component will actually be added

Will make a bug report/repro when I find a moment and can properly repro this

#

[Bug] EntityComponentStore->AssertCanAddComponent and ChunkComponents

cinder copper
#

OK got a tiny repro and it's actually busted on all Chunk component methods, not just the query versions

var entity = state.EntityManager.CreateSingleton<LargeComponent>();
state.EntityManager.AddChunkComponentData<LargeComponentForChunk>(entity);```
results in
> InvalidOperationException: Entity archetype component data is too large. Previous archetype size per instance 10304 bytes. Attempting to add component 'ReproSystem+LargeComponentForChunk' with size 10240 bytes. Maximum chunk size 16320.

Even though chunk components dont get added to the Entity, they get added to the MetaEntity

where the components are
```cs
public unsafe struct LargeComponent : IComponentData
{
    public fixed byte Value[10*1024];
}

public unsafe struct LargeComponentForChunk : IComponentData
{
    public fixed byte Value[10*1024];
}```
#

@fresh umbra maybe your area? I don't recall who usually works on this. I'll file a bug report anyway
-edit- oh just saw status, you probably won't read this for a bit, hope you're all good

#

IN-93100

cinder copper
#

[IN-93100] EntityComponentStore->AssertCanAddComponent and ChunkComponents

fresh umbra
#

I didn't think I'd set my Discord status to anything alarming, so now I'm more alarmed at how it knew to report a potentially alarming status! In any case, I'm all good. I'll add this to the pile of things to look at once the cobwebs are cleared.

cinder copper
#

Luckily for us, discord isn't all knowing just yet mopLUL (I just happened to see slack)

fresh umbra
#

I don't think your repro project includes the ReproSystem mentioned in the bug description; did you upload the correct project?

#

but nvm, I just slapped the code you pasted above into a new empty system's OnUpdate, and I get the error as described.

cinder copper
#

Hmm odd well good I posted it

fresh umbra
#

fixed!

cinder copper
#

Just to note though, the entity query version also has same issue in case you overlooked it