RuntimeMeshProxy.h
Go to the documentation of this file.
1 // Copyright 2016-2018 Chris Conway (Koderz). All Rights Reserved.
2 
3 #pragma once
4 
5 #include "CoreMinimal.h"
8 
9 
10 template<typename Type>
12 {
13  void operator()(Type* Object) const
14  {
15  // This is a custom deleter to make sure the runtime mesh proxy is only ever deleted on the rendering thread.
16  if (IsInRenderingThread())
17  {
18  delete Object;
19  }
20  else
21  {
22  // HORU: 4.22 rendering
23  ENQUEUE_RENDER_COMMAND(FRuntimeMeshProxyDeleterCommand)(
24  [Object](FRHICommandListImmediate & RHICmdList)
25  {
26  delete static_cast<Type*>(Object);
27  }
28  );
29  }
30  }
31 };
32 
37 {
39 
40  TMap<int32, FRuntimeMeshSectionProxyPtr> Sections;
41 
42 public:
45 
46  ERHIFeatureLevel::Type GetFeatureLevel() const { return FeatureLevel; }
47 
48 
49  void CreateSection_GameThread(int32 SectionId, const FRuntimeMeshSectionCreationParamsPtr& SectionData);
50  void CreateSection_RenderThread(int32 SectionId, const FRuntimeMeshSectionCreationParamsPtr& SectionData);
51  void UpdateSection_GameThread(int32 SectionId, const FRuntimeMeshSectionUpdateParamsPtr& SectionData);
52  void UpdateSection_RenderThread(int32 SectionId, const FRuntimeMeshSectionUpdateParamsPtr& SectionData);
53  void UpdateSectionProperties_GameThread(int32 SectionId, const FRuntimeMeshSectionPropertyUpdateParamsPtr& SectionData);
54  void UpdateSectionProperties_RenderThread(int32 SectionId, const FRuntimeMeshSectionPropertyUpdateParamsPtr& SectionData);
55  void DeleteSection_GameThread(int32 SectionId);
56  void DeleteSection_RenderThread(int32 SectionId);
57 
58 
59 
60  TMap<int32, FRuntimeMeshSectionProxyPtr>& GetSections() { return Sections; }
61 
62  void CalculateViewRelevance(bool& bHasStaticSections, bool& bHasDynamicSections, bool& bHasShadowableSections)
63  {
64  check(IsInRenderingThread());
65  bHasStaticSections = false;
66  bHasDynamicSections = false;
67  bHasShadowableSections = false;
68  for (const auto& SectionEntry : Sections)
69  {
70  if (SectionEntry.Value.IsValid())
71  {
72  bool bWantsStaticPath = SectionEntry.Value->WantsToRenderInStaticPath();
73  bHasStaticSections |= bWantsStaticPath;
74  bHasDynamicSections |= !bWantsStaticPath;
75  bHasShadowableSections = SectionEntry.Value->CastsShadow();
76  }
77  }
78  }
79 private:
80  void UpdateCachedValues();
81 
82 };
83 
TMap< int32, FRuntimeMeshSectionProxyPtr > & GetSections()
void CalculateViewRelevance(bool &bHasStaticSections, bool &bHasDynamicSections, bool &bHasShadowableSections)
TSharedPtr< FRuntimeMeshSectionPropertyUpdateParams, ESPMode::NotThreadSafe > FRuntimeMeshSectionPropertyUpdateParamsPtr
TSharedPtr< FRuntimeMeshSectionUpdateParams, ESPMode::NotThreadSafe > FRuntimeMeshSectionUpdateParamsPtr
static const textual_icon check
Definition: model-views.h:260
ERHIFeatureLevel::Type GetFeatureLevel() const
TSharedPtr< FRuntimeMeshSectionCreationParams, ESPMode::NotThreadSafe > FRuntimeMeshSectionCreationParamsPtr
TMap< int32, FRuntimeMeshSectionProxyPtr > Sections
void operator()(Type *Object) const
ERHIFeatureLevel::Type FeatureLevel


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:41