// TODO: This is not working with method. We have to change this public static bool ExtractBurstCompilerOptions(Type type, out string optimizationFlags) { optimizationFlags = null; if (!BurstEditorOptions.EnableBurstCompilation) { return(false); } #pragma warning disable 618 var attr = type.GetCustomAttribute <BurstCompileAttribute>() ?? type.GetCustomAttribute <ComputeJobOptimizationAttribute>(); #pragma warning restore 618 if (attr == null) { return(false); } var builder = new StringBuilder(); if (BurstEditorOptions.EnableBurstSafetyChecks) { AddOption(builder, GetOption(OptionSafetyChecks)); } else { AddOption(builder, GetOption(OptionDisableSafetyChecks)); // Enable NoAlias ahen safety checks are disable AddOption(builder, GetOption(OptionNoAlias)); } if (attr.CompileSynchronously) { AddOption(builder, GetOption(OptionJitEnableSynchronousCompilation)); } if (attr.Accuracy != Accuracy.Std) { AddOption(builder, GetOption(OptionFastMath)); } // Add custom options if (attr.Options != null) { foreach (var option in attr.Options) { if (!string.IsNullOrEmpty(option)) { AddOption(builder, option); } } } // Allow to configure the backend from BurstCompile.Backend attribute var backendName = attr.Backend ?? BurstCompiler.BackendName; var backendPath = BurstCompiler.ResolveBackendPath(backendName); if (backendPath != null) { AddOption(builder, GetOption(OptionBackend, backendPath)); } if (BurstEditorOptions.EnableShowBurstTimings) { AddOption(builder, GetOption(OptionJitLogTimings)); } //Debug.Log($"ExtractBurstCompilerOptions: {type} {optimizationFlags}"); // AddOption(builder, GetOption(OptionJitEnableModuleCachingDebugger)); // AddOption(builder, GetOption(OptionJitCacheDirectory, "Library/BurstCache")); optimizationFlags = builder.ToString(); //Debug.Log(optimizationFlags); return(true); }