You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the bool field type in a struct that is itself used in a buffer, ShaderGen crashes due to a stack overflow. This can be traced to TypeSizeCache.GetCSharpSize not having a known size for System.Boolean, to fix that issue requires reference to the conversation in #14, as the size is different depending on the backend in question.
This bug then causes it to try to determine the size manually, there are only two fields in a bool, and both are static strings (FalseString and TrueString). As they are statics they should be skipped as they don't contribute to the size.
However, this bug causes TypeSizeCahce.GetCSharpAlignment to be called for the symbolSystem.String. This two is not a known type, and also has a single field, which is also a static string (Empty), so TypeSizeCahce.GetCSharpAlignment is called again for the symbolSystem.String. And we get recursion.
…culates alignments and sizes in one pass and it adds alignment info objects as it goes, preventing duplicate analysis. It remains thread safe and should be considerably faster and safer.
It also correctly skips static fields now, and the code is no longer duplicated.
…ould probably not support it at all in shader code. To that end I've added a check that will auto-detect the majority of non-blittable types and error cleanly.
When using the bool field type in a struct that is itself used in a buffer, ShaderGen crashes due to a stack overflow. This can be traced to
TypeSizeCache.GetCSharpSize
not having a known size forSystem.Boolean
, to fix that issue requires reference to the conversation in #14, as the size is different depending on the backend in question.This bug then causes it to try to determine the size manually, there are only two fields in a
bool
, and both are static strings (FalseString
andTrueString
). As they are statics they should be skipped as they don't contribute to the size.However, this bug causes
TypeSizeCahce.GetCSharpAlignment
to be called for thesymbol
System.String
. This two is not a known type, and also has a single field, which is also a static string (Empty
), soTypeSizeCahce.GetCSharpAlignment
is called again for thesymbol
System.String
. And we get recursion.The fixes therefore are:
System.String
by treating as abyte[]
or similar.The text was updated successfully, but these errors were encountered: