Resource progress

USkeletalMesh:PostLoad() --> InitResources()  --> FSkeletalMeshRenderData::InitResource( )  -->FSkeletalMeshLODRenderData::InitResources()  --> BeginInitResource() --> FPositionVertexBuffer::InitRHI()   创建buffer,SRV,并填充资源

UStaticMesh::PostLoad() --> InitResources() --> GetRenderData()->InitResources() 

  LODResources[LODIndex].InitResources(Owner);        //初始化顶点属性的不同通道的缓冲区,并填充数据
  LODVertexFactories[LODIndex].InitResources(LODResources[LODIndex], LODIndex, Owner);  //声明顶点属性与shader的绑定,关联不同的顶点属性缓冲区到shader

 

UStaticMesh::BeginDestroy() --> ReleaseResources() 

  GetRenderData()->ReleaseResources();

  // insert a fence to signal when these commands completed
  ReleaseResourcesFence.BeginFence();    //FRenderCommandFence, 

 

UStaticMeshComponent

  TObjectPtr<class UStaticMesh> StaticMesh;    //资源的引用

posted @ 2022-02-18 10:18  引擎之旅  阅读(79)  评论(0编辑  收藏  举报