Skip to content

Commit f1a15a8

Browse files
authored
Merge branch 'master' into cameraSaveFix
2 parents a3db77a + 91ec533 commit f1a15a8

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

src/Interface/Modules/Render/ES/AssetBootstrap.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,10 @@ class AssetBootstrap : public spire::EmptySystem
5454
{
5555
// Load geometry and associated vertex and fragment shaders.
5656
geomMan->loadGeometry(core, cachedEntity, "Assets/arrow.geom");
57-
geomMan->loadGeometry(core, cachedEntity, "Assets/sphere.geom");
5857
}
5958
if (std::shared_ptr<ren::ShaderMan> shaderMan = sm.lock())
6059
{
6160
// Load shader we will use with the coordinate axes.
62-
shaderMan->loadVertexAndFragmentShader(core, cachedEntity, "Shaders/DirPhong");
6361
shaderMan->loadVertexAndFragmentShader(core, cachedEntity, "Shaders/OrientationGlyph");
6462
}
6563

src/Interface/Modules/Render/ES/Core.cc

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,20 @@ std::string ESCore::toString(std::string prefix) const
106106
return output;
107107
}
108108

109+
bool ESCore::hasGeomPromise() const
110+
{
111+
for(auto& comp : mComponents)
112+
{
113+
if(comp.second->getNumComponents() > 0)
114+
{
115+
if(mComponentIDNameMap.find(comp.first) != mComponentIDNameMap.end() &&
116+
mComponentIDNameMap.at(comp.first) == "ren:GeomPromise")
117+
return true;
118+
}
119+
}
120+
return false;
121+
}
122+
109123
void ESCore::execute(double currentTime, double constantFrameTime)
110124
{
111125
++mCoreSequence;
@@ -146,10 +160,11 @@ void ESCore::execute(double currentTime, double constantFrameTime)
146160
renormalize(true);
147161
mSystems->renormalize();
148162

149-
// Perform garbage collection if requested.
163+
// Perform garbage collection if requested and safe
150164
if(runGC)
151165
{
152-
runCompleteGC();
166+
if(!hasGeomPromise())
167+
runCompleteGC();
153168
runGC = false;
154169
}
155170

src/Interface/Modules/Render/ES/Core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ namespace Render {
4949
void runGCOnNextExecution(){runGC = true;}
5050

5151
private:
52+
bool hasGeomPromise() const;
5253

5354
int64_t mCoreSequence; ///< Sequence number (frame) since start.
5455
spire::GLState mDefaultGLState; ///< Default OpenGL state.

src/Interface/Modules/Render/ES/SRInterface.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -839,12 +839,14 @@ namespace SCIRun {
839839

840840
DEBUG_LOG_LINE_INFO
841841

842-
std::weak_ptr<ren::VBOMan> vm = mCore.getStaticComponent<ren::StaticVBOMan>()->instance_;
843-
std::weak_ptr<ren::IBOMan> im = mCore.getStaticComponent<ren::StaticIBOMan>()->instance_;
844-
if (std::shared_ptr<ren::VBOMan> vboMan = vm.lock())
842+
auto vmc = mCore.getStaticComponent<ren::StaticVBOMan>();
843+
auto imc = mCore.getStaticComponent<ren::StaticIBOMan>();
844+
if(!vmc || !imc) return;
845+
846+
if (std::shared_ptr<ren::VBOMan> vboMan = vmc->instance_)
845847
{
846848
DEBUG_LOG_LINE_INFO;
847-
if (std::shared_ptr<ren::IBOMan> iboMan = im.lock())
849+
if (std::shared_ptr<ren::IBOMan> iboMan = imc->instance_)
848850
{
849851
DEBUG_LOG_LINE_INFO
850852
if (foundObject != mSRObjects.end())

0 commit comments

Comments
 (0)