Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming AI_ defs to ARNOLD_ #824

Merged
merged 1 commit into from
Jul 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arnold_usd.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@

#define USED_USD_VERSION_GREATER_EQ(x, y) (USED_USD_MINOR_VERSION >= x && USED_USD_PATCH_VERSION >= y ) || USED_USD_MINOR_VERSION > x || USED_USD_MAJOR_VERSION > 0

#define AI_VERSION_NUMBER (${ARNOLD_VERSION_ARCH_NUM} * 10000 + ${ARNOLD_VERSION_MAJOR_NUM} * 100 + ${ARNOLD_VERSION_MINOR_NUM})
#define ARNOLD_VERSION_NUMBER (${ARNOLD_VERSION_ARCH_NUM} * 10000 + ${ARNOLD_VERSION_MAJOR_NUM} * 100 + ${ARNOLD_VERSION_MINOR_NUM})
kikou marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions render_delegate/hdarnold.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
#define USD_DO_NOT_BLIT
#endif

#if AI_VERSION_NUMBER > 60201
#define AI_MULTIPLE_RENDER_SESSIONS
#if ARNOLD_VERSION_NUMBER > 60201
sirpalee marked this conversation as resolved.
Show resolved Hide resolved
#define ARNOLD_MULTIPLE_RENDER_SESSIONS
#endif
36 changes: 18 additions & 18 deletions render_delegate/render_delegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ HdArnoldRenderDelegate::HdArnoldRenderDelegate(HdArnoldRenderContext context) :
}
hdArnoldInstallNodes();

#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
_universe = AiUniverse();
_renderSession = AiRenderSession(_universe, AI_SESSION_INTERACTIVE);
#else
Expand All @@ -398,7 +398,7 @@ HdArnoldRenderDelegate::HdArnoldRenderDelegate(HdArnoldRenderContext context) :
_SetRenderSetting(o.first, o.second.defaultValue);
}

#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
AiRenderSetHintStr(
_renderSession, str::render_context, _context == HdArnoldRenderContext::Hydra ? str::hydra : str::husk);
#else
Expand All @@ -420,22 +420,22 @@ HdArnoldRenderDelegate::HdArnoldRenderDelegate(HdArnoldRenderContext context) :
AiNodeSetStr(
_fallbackVolumeShader, str::name, AtString(TfStringPrintf("fallbackVolume_%p", _fallbackVolumeShader).c_str()));

#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
_renderParam.reset(new HdArnoldRenderParam(this));
#else
_renderParam.reset(new HdArnoldRenderParam());
#endif

// We need access to both beauty and P at the same time.
if (_context == HdArnoldRenderContext::Husk) {
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
AiRenderSetHintBool(_renderSession, str::progressive, false);
#else
AiRenderSetHintBool(str::progressive, false);
#endif
AiNodeSetBool(_options, str::enable_progressive_render, false);
} else {
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
AiRenderSetHintBool(_renderSession, str::progressive_show_all_outputs, true);
#else
AiRenderSetHintBool(str::progressive_show_all_outputs, true);
Expand All @@ -450,7 +450,7 @@ HdArnoldRenderDelegate::~HdArnoldRenderDelegate()
_resourceRegistry.reset();
}
_renderParam->Interrupt();
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
AiRenderSessionDestroy(_renderSession);
#endif
hdArnoldUninstallNodes();
Expand Down Expand Up @@ -502,7 +502,7 @@ void HdArnoldRenderDelegate::_SetRenderSetting(const TfToken& _key, const VtValu
} else if (key == str::t_enable_progressive_render) {
if (_context != HdArnoldRenderContext::Husk) {
_CheckForBoolValue(value, [&](const bool b) {
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
AiRenderSetHintBool(_renderSession, str::progressive, b);
#else
AiRenderSetHintBool(str::progressive, b);
Expand All @@ -513,7 +513,7 @@ void HdArnoldRenderDelegate::_SetRenderSetting(const TfToken& _key, const VtValu
} else if (key == str::t_progressive_min_AA_samples) {
if (_context != HdArnoldRenderContext::Husk) {
_CheckForIntValue(value, [&](const int i) {
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
AiRenderSetHintInt(_renderSession, str::progressive_min_AA_samples, i);
#else
AiRenderSetHintInt(str::progressive_min_AA_samples, i);
Expand All @@ -523,7 +523,7 @@ void HdArnoldRenderDelegate::_SetRenderSetting(const TfToken& _key, const VtValu
} else if (key == str::t_interactive_target_fps) {
if (_context != HdArnoldRenderContext::Husk) {
if (value.IsHolding<float>()) {
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
AiRenderSetHintFlt(_renderSession, str::interactive_target_fps, value.UncheckedGet<float>());
#else
AiRenderSetHintFlt(str::interactive_target_fps, value.UncheckedGet<float>());
Expand All @@ -533,7 +533,7 @@ void HdArnoldRenderDelegate::_SetRenderSetting(const TfToken& _key, const VtValu
} else if (key == str::t_interactive_target_fps_min) {
if (_context != HdArnoldRenderContext::Husk) {
if (value.IsHolding<float>()) {
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
AiRenderSetHintFlt(_renderSession, str::interactive_target_fps_min, value.UncheckedGet<float>());
#else
AiRenderSetHintFlt(str::interactive_target_fps_min, value.UncheckedGet<float>());
Expand All @@ -543,7 +543,7 @@ void HdArnoldRenderDelegate::_SetRenderSetting(const TfToken& _key, const VtValu
} else if (key == str::t_interactive_fps_min) {
if (_context != HdArnoldRenderContext::Husk) {
if (value.IsHolding<float>()) {
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
AiRenderSetHintFlt(_renderSession, str::interactive_fps_min, value.UncheckedGet<float>());
#else
AiRenderSetHintFlt(str::interactive_fps_min, value.UncheckedGet<float>());
Expand Down Expand Up @@ -676,15 +676,15 @@ VtValue HdArnoldRenderDelegate::GetRenderSetting(const TfToken& _key) const
return VtValue(AiNodeGetStr(_options, str::render_device) == str::GPU);
} else if (key == str::t_enable_progressive_render) {
bool v = true;
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
AiRenderGetHintBool(_renderSession, str::progressive, v);
#else
AiRenderGetHintBool(str::progressive, v);
#endif
return VtValue(v);
} else if (key == str::t_progressive_min_AA_samples) {
int v = -4;
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
AiRenderGetHintInt(_renderSession, str::progressive_min_AA_samples, v);
#else
AiRenderGetHintInt(str::progressive_min_AA_samples, v);
Expand All @@ -696,23 +696,23 @@ VtValue HdArnoldRenderDelegate::GetRenderSetting(const TfToken& _key) const
return VtValue(_logFile);
} else if (key == str::t_interactive_target_fps) {
float v = 1.0f;
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
AiRenderGetHintFlt(_renderSession, str::interactive_target_fps, v);
#else
AiRenderGetHintFlt(str::interactive_target_fps, v);
#endif
return VtValue(v);
} else if (key == str::t_interactive_target_fps_min) {
float v = 1.0f;
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
AiRenderGetHintFlt(_renderSession, str::interactive_target_fps_min, v);
#else
AiRenderGetHintFlt(str::interactive_target_fps_min, v);
#endif
return VtValue(v);
} else if (key == str::t_interactive_fps_min) {
float v = 1.0f;
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
AiRenderGetHintFlt(_renderSession, str::interactive_fps_min, v);
#else
AiRenderGetHintFlt(str::interactive_fps_min, v);
Expand Down Expand Up @@ -752,7 +752,7 @@ VtDictionary HdArnoldRenderDelegate::GetRenderStats() const
VtDictionary stats;

float total_progress = 100.0f;
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
AiRenderGetHintFlt(_renderSession, str::total_progress, total_progress);
#else
AiRenderGetHintFlt(str::total_progress, total_progress);
Expand Down Expand Up @@ -959,7 +959,7 @@ AtString HdArnoldRenderDelegate::GetLocalNodeName(const AtString& name) const

AtUniverse* HdArnoldRenderDelegate::GetUniverse() const { return _universe; }

#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
AtRenderSession* HdArnoldRenderDelegate::GetRenderSession() const { return _renderSession; }
#endif

Expand Down
4 changes: 2 additions & 2 deletions render_delegate/render_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class HdArnoldRenderDelegate final : public HdRenderDelegate {
/// @return Pointer to the Arnold Universe used by the Render Delegate.
HDARNOLD_API
AtUniverse* GetUniverse() const;
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
/// Gets the active Arnold Render Session.
///
/// @return Pointer to the Render Session used by the Render Delegate.
Expand Down Expand Up @@ -461,7 +461,7 @@ class HdArnoldRenderDelegate final : public HdRenderDelegate {
std::unique_ptr<HdArnoldRenderParam> _renderParam;
SdfPath _id; ///< Path of the Render Delegate.
AtUniverse* _universe; ///< Universe used by the Render Delegate.
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
AtRenderSession* _renderSession; ///< Render session used by the Render Delegate.
#endif
AtNode* _options; ///< Pointer to the Arnold Options Node.
Expand Down
18 changes: 9 additions & 9 deletions render_delegate/render_param.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

PXR_NAMESPACE_OPEN_SCOPE

#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
HdArnoldRenderParam::HdArnoldRenderParam(HdArnoldRenderDelegate* delegate) : _delegate(delegate)
#else
HdArnoldRenderParam::HdArnoldRenderParam()
Expand All @@ -50,7 +50,7 @@ HdArnoldRenderParam::Status HdArnoldRenderParam::Render()
return Status::Aborted;
}

#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
const auto status = AiRenderGetStatus(_delegate->GetRenderSession());
#else
const auto status = AiRenderGetStatus();
Expand All @@ -62,7 +62,7 @@ HdArnoldRenderParam::Status HdArnoldRenderParam::Render()
const auto needsRestart = _needsRestart.exchange(false, std::memory_order_acq_rel);
if (needsRestart) {
_paused.store(false, std::memory_order_release);
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
AiRenderRestart(_delegate->GetRenderSession());
#else
AiRenderRestart();
Expand All @@ -77,13 +77,13 @@ HdArnoldRenderParam::Status HdArnoldRenderParam::Render()
const auto needsRestart = _needsRestart.exchange(false, std::memory_order_acq_rel);
if (needsRestart) {
_paused.store(false, std::memory_order_release);
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
AiRenderRestart(_delegate->GetRenderSession());
#else
AiRenderRestart();
#endif
} else if (!_paused.load(std::memory_order_acquire)) {
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
AiRenderResume(_delegate->GetRenderSession());
#else
AiRenderResume();
Expand All @@ -100,7 +100,7 @@ HdArnoldRenderParam::Status HdArnoldRenderParam::Render()
if (status == AI_RENDER_STATUS_FAILED) {
_aborted.store(true, std::memory_order_release);
_paused.store(false, std::memory_order_release);
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
const auto errorCode = AiRenderEnd(_delegate->GetRenderSession());
#else
const auto errorCode = AiRenderEnd();
Expand All @@ -127,7 +127,7 @@ HdArnoldRenderParam::Status HdArnoldRenderParam::Render()
return Status::Aborted;
}
_paused.store(false, std::memory_order_release);
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
AiRenderBegin(_delegate->GetRenderSession());
#else
AiRenderBegin();
Expand All @@ -137,13 +137,13 @@ HdArnoldRenderParam::Status HdArnoldRenderParam::Render()

void HdArnoldRenderParam::Interrupt(bool needsRestart, bool clearStatus)
{
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
const auto status = AiRenderGetStatus(_delegate->GetRenderSession());
#else
const auto status = AiRenderGetStatus();
#endif
if (status != AI_RENDER_STATUS_NOT_STARTED) {
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
AiRenderInterrupt(_delegate->GetRenderSession(), AI_BLOCKING);
#else
AiRenderInterrupt(AI_BLOCKING);
Expand Down
4 changes: 2 additions & 2 deletions render_delegate/render_param.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class HdArnoldRenderParam final : public HdRenderParam {
};

/// Constructor for HdArnoldRenderParam.
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
HdArnoldRenderParam(HdArnoldRenderDelegate* delegate);
#else
HdArnoldRenderParam();
Expand Down Expand Up @@ -91,7 +91,7 @@ class HdArnoldRenderParam final : public HdRenderParam {
void Restart();

private:
#ifdef AI_MULTIPLE_RENDER_SESSIONS
#ifdef ARNOLD_MULTIPLE_RENDER_SESSIONS
/// The render delegate
const HdArnoldRenderDelegate* _delegate;
#endif
Expand Down