buildaworldnet / IrrlichtBAW

Build A World fork of Irrlicht
http://www.buildaworld.net
Apache License 2.0
122 stars 28 forks source link

Immutable assets #549

Closed Crisspl closed 3 years ago

devshgraphicsprogramming commented 3 years ago

I see a problem that

            if (isDummyObjectForCacheAliasing)
                return;

is used an an "early out" on all convertToDummyObject

Now because the call is recursive (goes through children) and whether a child is converted depends on its mutability state... this means that just because it was called before on an asset, won't guarantee that a second call is not going to produce side-effects.

This logic was broken even before mutability concerns, when we first introduced the recursion depth parameter.

Crisspl commented 3 years ago

I see a problem that

            if (isDummyObjectForCacheAliasing)
                return;

is used an an "early out" on all convertToDummyObject

Now because the call is recursive (goes through children) and whether a child is converted depends on its mutability state... this means that just because it was called before on an asset, won't guarantee that a second call is not going to produce side-effects.

This logic was broken even before mutability concerns, when we first introduced the recursion depth parameter.

this if doesn't concern mutability at all. However I see your point.. for example at first I call converttodummy(0) and after that converttodummy (2). And levels 1 and 2 won't be converted then

devshgraphicsprogramming commented 3 years ago

TODO:

Crisspl commented 3 years ago

All done