Skip to content

Commit

Permalink
don't trap plugins FP exceptions in DEBUG mode
Browse files Browse the repository at this point in the history
  • Loading branch information
devernay committed Jan 21, 2022
1 parent c82de4b commit 5eaaead
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Engine/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ Node::loadKnob(const KnobIPtr & knob,
break;

}

} // Node::loadKnob


Expand Down Expand Up @@ -2358,7 +2358,7 @@ Node::initializeDefaultKnobs(bool loadingSerialization)


if (lastKnobBeforeAdvancedOption && mainPage) {

KnobsVec mainPageChildren = mainPage->getChildren();
int i = 0;
for (KnobsVec::iterator it = mainPageChildren.begin(); it != mainPageChildren.end(); ++it, ++i) {
Expand Down Expand Up @@ -3164,9 +3164,9 @@ renderPreview(const Image & srcImg,
bool convertToSrgb,
unsigned int* dstPixels)
{
#ifdef DEBUG
// Uncomment if using plugins that generate FP exceptions
// boost_adaptbx::floating_point::exception_trapping trap(0);
#ifndef DEBUG_NAN
// Some plugins generate FP exceptions
boost_adaptbx::floating_point::exception_trapping trap(0);
#endif
///recompute it after the rescaling
const RectI & srcBounds = srcImg.getBounds();
Expand Down Expand Up @@ -5035,7 +5035,7 @@ Node::onEffectKnobValueChanged(KnobI* what,
}
_imp->effect->onEnableOpenGLKnobValueChanged(enabled);
} else if (what == _imp->processAllLayersKnob.lock().get() ) {

std::map<int, ChannelSelector>::iterator foundOutput = _imp->channelsSelectors.find(-1);
if (foundOutput != _imp->channelsSelectors.end()) {
_imp->onLayerChanged(foundOutput->first, foundOutput->second);
Expand Down Expand Up @@ -5119,7 +5119,7 @@ Node::onOpenGLEnabledKnobChangedOnProject(bool activated)
}
}
_imp->effect->onEnableOpenGLKnobValueChanged(enabled);

}

bool
Expand Down Expand Up @@ -5181,14 +5181,14 @@ Node::Implementation::onLayerChanged(int inputNb,

///Disable all input selectors as it doesn't make sense to edit them whilst output is All
for (std::map<int, ChannelSelector>::iterator it = channelsSelectors.begin(); it != channelsSelectors.end(); ++it) {

NodePtr inp;
if (it->first >= 0) {
inp = _publicInterface->getInput(it->first);
}
bool mustBeSecret = (it->first >= 0 && !inp.get()) || outputIsAll;
it->second.layer.lock()->setSecret(mustBeSecret);

}
}
if (!isRefreshingInputRelatedData) {
Expand Down Expand Up @@ -7247,9 +7247,9 @@ Node::refreshChannelSelectors()


KnobChoicePtr channelKnob = it->second.channel.lock();

hasChanged |= channelKnob->populateChoices(choices);

}
//Notify the effect channels have changed (the viewer needs this)
_imp->effect->onChannelsSelectorRefreshed();
Expand Down

2 comments on commit 5eaaead

@rodlie
Copy link
Contributor

@rodlie rodlie commented on 5eaaead Jan 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RB-2.4 on Windows fails:

Node.cpp: In function 'void Natron::{anonymous}::renderPreview(const Natron::Image&, int*, int*, bool, unsigned int*)':
Node.cpp:3169:5: error: 'boost_adaptbx' has not been declared
     boost_adaptbx::floating_point::exception_trapping trap(0);
     ^~~~~~~~~~~~~
compiling NodeGroupSerialization.cpp
make[2]: *** [Makefile.Release:1051: release/Node.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from ../../Natron/Engine/KnobSerialization.h:56:0,
                 from ../../Natron/Engine/NodeSerialization.h:49,
                 from NodeGroupSerialization.h:52,
                 from NodeGroupSerialization.cpp:26:

@devernay
Copy link
Member Author

@devernay devernay commented on 5eaaead Jan 22, 2022 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.