RuntimeMeshProxy.cpp
Go to the documentation of this file.
1 // Copyright 2016-2018 Chris Conway (Koderz). All Rights Reserved.
2 
3 #include "RuntimeMeshProxy.h"
5 #include "RuntimeMesh.h"
6 
8  : FeatureLevel(InFeatureLevel)
9 {
10 }
11 
13 {
14  // The mesh proxy can only be safely destroyed from the rendering thread.
15  // This is so that all the resources can be safely freed correctly.
16  check(IsInRenderingThread());
17 }
18 
20 {
21  // HORU: 4.22 rendering
22  ENQUEUE_RENDER_COMMAND(FRuntimeMeshProxyCreateSection)(
23  [this, SectionId, SectionData](FRHICommandListImmediate & RHICmdList)
24  {
25  CreateSection_RenderThread(SectionId, SectionData);
26  }
27  );
28 }
29 
31 {
32  check(IsInRenderingThread());
33  check(SectionData.IsValid());
34 
35  FRuntimeMeshSectionProxyPtr NewSection = MakeShareable(new FRuntimeMeshSectionProxy(FeatureLevel, SectionData),
37 
38  // Add the section to the map, destroying any one that existed
39  Sections.FindOrAdd(SectionId) = NewSection;
40 
41  // Update the cached values for rendering.
43 }
44 
46 {
47  // HORU: 4.22 rendering
48  ENQUEUE_RENDER_COMMAND(FRuntimeMeshProxyUpdateSection)(
49  [this, SectionId, SectionData](FRHICommandListImmediate & RHICmdList)
50  {
51  UpdateSection_RenderThread(SectionId, SectionData);
52  }
53  );
54 }
55 
57 {
58  check(IsInRenderingThread());
59  check(SectionData.IsValid());
60 
61  if (Sections.Contains(SectionId))
62  {
63  FRuntimeMeshSectionProxyPtr Section = Sections[SectionId];
64  Section->FinishUpdate_RenderThread(SectionData);
65 
66  // Update the cached values for rendering.
68  }
69 }
70 
72 {
73  // HORU: 4.22 rendering
74  ENQUEUE_RENDER_COMMAND(FRuntimeMeshProxyUpdateSectionProperties)(
75  [this, SectionId, SectionData](FRHICommandListImmediate & RHICmdList)
76  {
77  UpdateSectionProperties_RenderThread(SectionId, SectionData);
78  }
79  );
80 }
81 
83 {
84  check(IsInRenderingThread());
85  check(SectionData.IsValid());
86 
87  if (Sections.Contains(SectionId))
88  {
89  FRuntimeMeshSectionProxyPtr Section = Sections[SectionId];
90  Section->FinishPropertyUpdate_RenderThread(SectionData);
91 
92  // Update the cached values for rendering.
94  }
95 }
96 
98 {
99  // HORU: 4.22 rendering
100  ENQUEUE_RENDER_COMMAND(FRuntimeMeshProxyDeleteSection)(
101  [this, SectionId](FRHICommandListImmediate & RHICmdList)
102  {
103  DeleteSection_RenderThread(SectionId);
104  }
105  );
106 }
107 
109 {
110  check(IsInRenderingThread());
111 
112  bool bChangedState = false;
113  if (SectionId == INDEX_NONE)
114  {
115  Sections.Empty();
116  bChangedState = true;
117  }
118  else
119  {
120  // Remove the section if it exists
121  if (Sections.Remove(SectionId) > 0)
122  {
123  bChangedState = true;
124  }
125  }
126 
127  if (bChangedState)
128  {
129  // Update the cached values for rendering.
131  }
132 }
133 
134 
136 {
137  check(IsInRenderingThread());
138 }
void DeleteSection_GameThread(int32 SectionId)
void CreateSection_RenderThread(int32 SectionId, const FRuntimeMeshSectionCreationParamsPtr &SectionData)
TSharedPtr< FRuntimeMeshSectionProxy, ESPMode::NotThreadSafe > FRuntimeMeshSectionProxyPtr
void UpdateSectionProperties_RenderThread(int32 SectionId, const FRuntimeMeshSectionPropertyUpdateParamsPtr &SectionData)
TSharedPtr< FRuntimeMeshSectionPropertyUpdateParams, ESPMode::NotThreadSafe > FRuntimeMeshSectionPropertyUpdateParamsPtr
TSharedPtr< FRuntimeMeshSectionUpdateParams, ESPMode::NotThreadSafe > FRuntimeMeshSectionUpdateParamsPtr
void UpdateSection_GameThread(int32 SectionId, const FRuntimeMeshSectionUpdateParamsPtr &SectionData)
FRuntimeMeshProxy(ERHIFeatureLevel::Type InFeatureLevel)
void DeleteSection_RenderThread(int32 SectionId)
void UpdateSection_RenderThread(int32 SectionId, const FRuntimeMeshSectionUpdateParamsPtr &SectionData)
static const textual_icon check
Definition: model-views.h:260
TSharedPtr< FRuntimeMeshSectionCreationParams, ESPMode::NotThreadSafe > FRuntimeMeshSectionCreationParamsPtr
TMap< int32, FRuntimeMeshSectionProxyPtr > Sections
void CreateSection_GameThread(int32 SectionId, const FRuntimeMeshSectionCreationParamsPtr &SectionData)
ERHIFeatureLevel::Type FeatureLevel
void UpdateSectionProperties_GameThread(int32 SectionId, const FRuntimeMeshSectionPropertyUpdateParamsPtr &SectionData)


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