UnityBurst系统批量计算的插件入门

什麽是Burst系統

做一些批量計算需要,比较难用,

针无两头利

如果不需要“密集”计算,就帧的不需要,到底什么是密集计算呢,for循环不密集么,while循环不密集么?

安装Burst

因为发现一个不错项目的插件用上了Burst,哥用的Unity2022,不需要额外安装(又或者项目本身装好装满)

基础知识

知识点很多,又好像很难理解,但真的如此么。。。。

(基本上就是Unity开了个黑盒子(多线程),嫁接在C#,C#需要按一定写法,一定规则,就能利用c++的批量计算了)

有一个批量执行的监控面板

哥之前是用burst计算过浓雾的

同frame Debugger面板差不多,都不能直接找到代码堆栈的

。。。。

想看代码的,需要如下操作:

全局搜索 BurstCompile

搜索这个标签,能找到关键的代码片段

(无上下文关联,标签[burstCompile]就是关联)

namespace GleyTrafficSystem
{
    /// <summary>
    /// Rotates the vehicle trigger on the heading direction
    /// </summary>
    [BurstCompile]
    public struct UpdateTriggerJob : IJobParallelForTransform
    {
    
    

其他知识就不那么重要了。。。

参考

https://blog.csdn.net/alph258/article/details/83997917

猜你喜欢

转载自blog.csdn.net/avi9111/article/details/129006547