Boolean values are not blittable
See original GitHub issueIn .NET AFAICT boolean values are 1 byte, whereas in WinRT they are 4 bytes. This probably does not impact most scenarios (e.g. I believe all calling conventions requires “upgrading” all integers less than 32-bits to 32-bits, albeit that’s my recollection of printf
, which is a different calling convention, anyway), however it does impact things like arrays, struct sizes, etc. We should probably account for this in the helpers and whatever fallout comes out of that.
FWIW here’s some decent documentation on what is and is not blittable: https://docs.microsoft.com/en-us/dotnet/framework/interop/blittable-and-non-blittable-types
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top Results From Across the Web
boolean (Blittable) in IComponentData struct?
According to ms documentation, Boolean is none-blittable data type. Code (CSharp):. https://docs.microsoft.com/en-us/dotnet/ ...
Read more >Blittable and Non-Blittable Types - .NET Framework
These types are called blittable types because they do not require conversion when they are passed between managed and unmanaged code.
Read more >Does C# enforce that an `unmanaged` type is "blittable"?
Hans Passant confirmed the answer in the negative. No, simplest counter-example is a struct with a bool field. Never blittable, okay to meet ......
Read more >Boolean may not be blittable (in C# it's not) · Issue #10
In C#, TestComponent.Blittable is actually a non-blittable struct, due to the Boolean A field. Should move that field to the NonBlittable ...
Read more >[Unity ECS] Know your blittable types | by 5argon
Blittable types are data types in the Microsoft . ... Not blittable types that maybe not obvious to you includes bool and an...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s not true. WinRT bool values are 1 byte.
Also note that
bool
can be marshalled as desired by usingUnmanagedType.I1