Skip to content

Commit 78037d7

Browse files
author
Haydelj
committed
fixed the new redview scene and the a segfault. Also removed unused assets
1 parent 4f7172c commit 78037d7

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ class AssetBootstrap : public spire::EmptySystem
5050
// A cached entity so that our VBOs and IBOs will not get garbage collected.
5151
uint64_t cachedEntity = 0;
5252
cachedEntity = gen::StaticObjRefID::getNewObjectID(core);
53-
if (std::shared_ptr<ren::GeomMan> geomMan = gm.lock()) {
54-
// Load geometry and associated vertex and fragment shaders.
55-
geomMan->loadGeometry(core, cachedEntity, "Assets/arrow.geom");
56-
geomMan->loadGeometry(core, cachedEntity, "Assets/sphere.geom");
53+
if (std::shared_ptr<ren::GeomMan> geomMan = gm.lock())
54+
{
55+
// Load geometry and associated vertex and fragment shaders.
56+
geomMan->loadGeometry(core, cachedEntity, "Assets/arrow.geom");
5757
}
58-
if (std::shared_ptr<ren::ShaderMan> shaderMan = sm.lock()) {
58+
if (std::shared_ptr<ren::ShaderMan> shaderMan = sm.lock())
59+
{
5960
// Load shader we will use with the coordinate axes.
60-
shaderMan->loadVertexAndFragmentShader(core, cachedEntity, "Shaders/DirPhong");
6161
shaderMan->loadVertexAndFragmentShader(core, cachedEntity, "Shaders/OrientationGlyph");
6262
}
6363

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,19 @@ void ESCore::execute(double currentTime, double constantFrameTime)
151151
// Perform garbage collection if requested.
152152
if(runGC)
153153
{
154-
runCompleteGC();
154+
bool run = true;
155+
for(auto& comp : mComponents)
156+
if(comp.second->getNumComponents() > 0)
157+
{
158+
if(mComponentIDNameMap.find(comp.first) != mComponentIDNameMap.end() &&
159+
mComponentIDNameMap.at(comp.first) == "ren:GeomPromise")
160+
{
161+
run = false;
162+
break;
163+
}
164+
}
165+
if(run) runCompleteGC();
166+
else std::cout << "abourted GC\n";
155167
runGC = false;
156168
}
157169

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,9 @@ namespace SCIRun {
834834

835835
DEBUG_LOG_LINE_INFO
836836

837+
if(!mCore.getStaticComponent<ren::StaticVBOMan>() ||
838+
!mCore.getStaticComponent<ren::StaticIBOMan>()) return;
839+
837840
std::weak_ptr<ren::VBOMan> vm = mCore.getStaticComponent<ren::StaticVBOMan>()->instance_;
838841
std::weak_ptr<ren::IBOMan> im = mCore.getStaticComponent<ren::StaticIBOMan>()->instance_;
839842
if (std::shared_ptr<ren::VBOMan> vboMan = vm.lock())

0 commit comments

Comments
 (0)