#How do detect if a type is burst compatible using Roslyn?

1 messages · Page 1 of 1 (latest)

sweet canopy
#

I tried brute-forcing this process by recursively checking ITypeSymbols, but it had horrible performance.
Is there a hidden cheap method available to detect if a type is burst compatible?

coral viper
#

type must be unmanaged

#

you probably just want to apply this constraint somewhere else

sweet canopy
coral viper
#

don't make your codegen all knowing, trying to cover all niche cases

#

if user does something bad - then compiler will throw error anyway

#

and for example

#

EntityManager overloads explicitly define unmanaged, IComponentData

#

which makes acceptable input 100% burst compatible at compile time

sweet canopy
# coral viper type must be unmanaged

Aight, I won't try to make my codegen all-knowing. Was just wondering if there was a straighforward way to check if any ITypeSymbol is burst compatible (which it might be even when it's seen as managed code by roslyn)

coral viper
#

if there is a way to know whether type is unmanaged

#

then there is

#

but I'm not aware of a way to check it