Skip to content

Commit

Permalink
Change render delegates to use std::make_shared.
Browse files Browse the repository at this point in the history
When constructing the resource registry, use std::make_shared when
creating a resource registry.

(Internal change: 2051715)
(Internal change: 2051901)
  • Loading branch information
c64kernal authored and pixar-oss committed Mar 30, 2020
1 parent 547cad3 commit 7da2486
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion extras/imaging/examples/hdTiny/renderDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void
HdTinyRenderDelegate::_Initialize()
{
std::cout << "Creating Tiny RenderDelegate" << std::endl;
_resourceRegistry.reset(new HdResourceRegistry());
_resourceRegistry = std::make_shared<HdResourceRegistry>();
}

HdTinyRenderDelegate::~HdTinyRenderDelegate()
Expand Down
2 changes: 1 addition & 1 deletion pxr/imaging/hdSt/renderDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ HdStRenderDelegate::_Initialize()
std::lock_guard<std::mutex> guard(_mutexResourceRegistry);

if (_counterResourceRegistry.fetch_add(1) == 0) {
_resourceRegistry.reset( new HdStResourceRegistry() );
_resourceRegistry = std::make_shared<HdStResourceRegistry>();
HdPerfLog::GetInstance().AddResourceRegistry(_resourceRegistry);
}

Expand Down
2 changes: 1 addition & 1 deletion pxr/imaging/plugin/hdEmbree/renderDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ HdEmbreeRenderDelegate::_Initialize()
std::lock_guard<std::mutex> guard(_mutexResourceRegistry);

if (_counterResourceRegistry.fetch_add(1) == 0) {
_resourceRegistry.reset( new HdResourceRegistry() );
_resourceRegistry = std::make_shared<HdResourceRegistry>();
}
}

Expand Down
2 changes: 1 addition & 1 deletion third_party/renderman-22/plugin/hdPrman/renderDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void
HdPrmanRenderDelegate::_Initialize()
{
_renderParam = std::make_shared<HdPrman_RenderParam>(_context);
_resourceRegistry.reset(new HdResourceRegistry());
_resourceRegistry = std::make_shared<HdResourceRegistry>();

std::string integrator = HdPrmanIntegratorTokens->PxrPathTracer;
const std::string interactiveIntegrator =
Expand Down
2 changes: 1 addition & 1 deletion third_party/renderman-23/plugin/hdPrman/renderDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ HdPrmanRenderDelegate::_Initialize()

// Initialize default resource registry. HdxPrman may override this with its
// resource registry during HdxPrmanRenderDelegate::_Initialize.
_resourceRegistry.reset(new HdResourceRegistry());
_resourceRegistry = std::make_shared<HdResourceRegistry>();

std::string integrator = HdPrmanIntegratorTokens->PxrPathTracer;
const std::string interactiveIntegrator =
Expand Down

0 comments on commit 7da2486

Please sign in to comment.