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

Mem release #646

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
7 changes: 7 additions & 0 deletions pxr/imaging/plugin/hdRpr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/rif_models.version ${RIF_VERSION_STRING})
list(APPEND RIF_MODEL_RESOURCE_FILES
"${CMAKE_CURRENT_BINARY_DIR}/rif_models.version${_sep}rif_models/rif_models.version")

if(HoudiniUSD_FOUND)
set(RESOURCE_WATCHER_H resourceWatcher.h)
set(RESOURCE_WATCHER_CPP resourceWatcher.cpp)
endif()

pxr_plugin(hdRpr
DISABLE_PRECOMPILED_HEADERS

Expand Down Expand Up @@ -152,6 +157,7 @@ pxr_plugin(hdRpr
PRIVATE_HEADERS
baseRprim.h
api.h
${RESOURCE_WATCHER_H}

RESOURCE_FILES
plugInfo.json
Expand All @@ -163,6 +169,7 @@ pxr_plugin(hdRpr
${CMAKE_CURRENT_BINARY_DIR}/config.cpp
ndrDiscoveryPlugin.cpp
ndrParserPlugin.cpp
${RESOURCE_WATCHER_CPP}
)

if(RPR_EXR_EXPORT_ENABLED)
Expand Down
16 changes: 16 additions & 0 deletions pxr/imaging/plugin/hdRpr/renderDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ limitations under the License.
#include <sstream>
#include <cstdio>

#ifdef BUILD_AS_HOUDINI_PLUGIN
#include "resourceWatcher.h"
#endif

PXR_NAMESPACE_OPEN_SCOPE

static HdRprApi* g_rprApi = nullptr;
Expand Down Expand Up @@ -187,9 +191,15 @@ HdRprDelegate::HdRprDelegate(HdRenderSettingsMap const& renderSettings) {
}

m_lastCreatedInstance = this;
#ifdef BUILD_AS_HOUDINI_PLUGIN
InitWatcher();
#endif
}

HdRprDelegate::~HdRprDelegate() {
#ifdef BUILD_AS_HOUDINI_PLUGIN
NotifyRenderFinished();
#endif
g_rprApi = nullptr;
m_lastCreatedInstance = nullptr;
}
Expand Down Expand Up @@ -387,11 +397,17 @@ bool HdRprDelegate::IsPauseSupported() const {
}

bool HdRprDelegate::Pause() {
#ifdef BUILD_AS_HOUDINI_PLUGIN
NotifyRenderFinished();
#endif
m_renderThread.PauseRender();
return true;
}

bool HdRprDelegate::Resume() {
#ifdef BUILD_AS_HOUDINI_PLUGIN
NotifyRenderStarted();
#endif
m_renderThread.ResumeRender();
return true;
}
Expand Down
Loading