public RenderPipeline(PipelineResources resources)
        {
            current        = this;
            this.resources = resources;
            if (resources.loadingThread == null)
            {
                resources.loadingThread = new LoadingThread();
            }
            resources.loadingThread.Init();
            SceneController.Awake(resources);
            eventsGuideBook = new NativeDictionary <UIntPtr, int, PtrEqual>(resources.availiableEvents.Length, Allocator.Persistent, new PtrEqual());
            resources.SetRenderingPath();
            var allEvents = resources.allEvents;

            GraphicsUtility.UpdatePlatform();
            MLight.ClearLightDict();
            CustomDrawRequest.Initialize();
            data.buffer = new CommandBuffer();
            for (int i = 0; i < resources.availiableEvents.Length; ++i)
            {
                resources.availiableEvents[i].InitDependEventsList();
            }
            for (int i = 0; i < resources.availiableEvents.Length; ++i)
            {
                eventsGuideBook.Add(new UIntPtr(MUnsafeUtility.GetManagedPtr(resources.availiableEvents[i].GetType())), i);
                resources.availiableEvents[i].Prepare();
            }
            for (int i = 0; i < resources.availiableEvents.Length; ++i)
            {
                resources.availiableEvents[i].InitEvent(resources);
            }
            waitReleaseRT = new NativeList <int>(20, Allocator.Persistent);
        }
Beispiel #2
0
 public void Init(PipelineResources resources)
 {
     if (current != null)
     {
         Debug.LogError("GPU RP Scene should be singleton!");
         return;
     }
     current = this;
     SceneController.Awake(resources, clusterResources);
 }
 private void Awake()
 {
     if (current != null)
     {
         Debug.LogError("GPU RP Scene should be singleton!");
         Destroy(this);
         return;
     }
     current = this;
     SceneController.Awake(resources, mapResources);
 }
 private void Awake()
 {
     if (current != null)
     {
         Debug.LogError("GPU RP Scene should be singleton!");
         Destroy(this);
         return;
     }
     current = this;
     SceneController.Awake(resources, resolution, texArrayCapacity, lightmapAtlasSize, lightmapCapacity, propertyCapacity, mapResources);
 }
Beispiel #5
0
        private void Awake()
        {
            if (current != null)
            {
                Debug.LogError("GPU RP Scene should be singleton!");
                Destroy(this);
                return;
            }
            current = this;
            SceneController.Awake(resources, resolution, texArrayCapacity, lightmapAtlasSize, lightmapCapacity, propertyCapacity, mapResources);
            loadingThread = new LoadingThread();
            int length = 0;

            Count(transformParents, ref length);
            transformArray = new TransformAccessArray(length, 32);
            SetBuffer(transformParents, transformArray);
        }
 private void Awake()
 {
     if (current)
     {
         Debug.LogError("Render Pipeline should be Singleton!");
         DestroyImmediate(gameObject);
         return;
     }
     data.buffer = new CommandBuffer();
     DontDestroyOnLoad(this);
     current = this;
     data.arrayCollection = new RenderArray(true);
     allEvents            = pipelinePrefab.GetComponentsInChildren <PipelineEvent>();
     foreach (var i in allEvents)
     {
         i.InitEvent(resources);
     }
     sceneController.Awake(this);
 }