diff options
author | Patrick Mours <pmours@nvidia.com> | 2022-04-20 14:40:48 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-04-29 20:19:39 +0300 |
commit | fc2c22e90c252f683a42574d4382f7e3c23940e1 (patch) | |
tree | 371a8b746554ec7fc5f4d6bf82ad68c972656821 /intern/cycles/hydra/render_delegate.cpp | |
parent | 9b92ce9dc00971cd9f7f0d0ba6109a9cba2090bd (diff) |
Cycles: Hydra fixes for stageMetersPerUnit and OpenGL context on Windows
Add "stageMetersPerUnit" render setting for USD files that have that set to
something other than the default (e.g. exported by Blender).
And fix a crash when an application creates a Hydra render pass on a thread
that does not have an OpenGL context current.
Diffstat (limited to 'intern/cycles/hydra/render_delegate.cpp')
-rw-r--r-- | intern/cycles/hydra/render_delegate.cpp | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/intern/cycles/hydra/render_delegate.cpp b/intern/cycles/hydra/render_delegate.cpp index 8671ac742be..208deaae92d 100644 --- a/intern/cycles/hydra/render_delegate.cpp +++ b/intern/cycles/hydra/render_delegate.cpp @@ -26,20 +26,13 @@ HDCYCLES_NAMESPACE_OPEN_SCOPE +TF_DEFINE_PUBLIC_TOKENS(HdCyclesRenderSettingsTokens, HD_CYCLES_RENDER_SETTINGS_TOKENS); + // clang-format off TF_DEFINE_PRIVATE_TOKENS(_tokens, (cycles) (openvdbAsset) ); - -TF_DEFINE_PRIVATE_TOKENS(HdCyclesRenderSettingsTokens, - (stageMetersPerUnit) - ((device, "cycles:device")) - ((threads, "cycles:threads")) - ((timeLimit, "cycles:time_limit")) - ((samples, "cycles:samples")) - ((sampleOffset, "cycles:sample_offset")) -); // clang-format on namespace { @@ -127,17 +120,14 @@ HdCyclesDelegate::HdCyclesDelegate(const HdRenderSettingsMap &settingsMap, _renderParam = session_ ? std::make_unique<HdCyclesSession>(session_, keep_nodes) : std::make_unique<HdCyclesSession>(GetSessionParams(settingsMap)); - // If the delegate owns the session, pull any remaining settings - if (!session_) { - for (const auto &setting : settingsMap) { - // Skip over the settings known to be used for initialization only - if (setting.first == HdCyclesRenderSettingsTokens->device || - setting.first == HdCyclesRenderSettingsTokens->threads) { - continue; - } - - SetRenderSetting(setting.first, setting.second); + for (const auto &setting : settingsMap) { + // Skip over the settings known to be used for initialization only + if (setting.first == HdCyclesRenderSettingsTokens->device || + setting.first == HdCyclesRenderSettingsTokens->threads) { + continue; } + + SetRenderSetting(setting.first, setting.second); } } @@ -328,7 +318,7 @@ HdBprim *HdCyclesDelegate::CreateBprim(const TfToken &typeId, const SdfPath &bpr } #endif - TF_RUNTIME_ERROR("Unknown Bprim type %s", typeId.GetText()); + TF_CODING_ERROR("Unknown Bprim type %s", typeId.GetText()); return nullptr; } |