diff --git a/pxr/imaging/hd/instanceRegistry.h b/pxr/imaging/hd/instanceRegistry.h index 871564b186..b4e36eae72 100644 --- a/pxr/imaging/hd/instanceRegistry.h +++ b/pxr/imaging/hd/instanceRegistry.h @@ -177,7 +177,7 @@ class HdInstanceRegistry { private: template static bool _IsUnique(std::shared_ptr const &value) { - return value.unique(); + return value.use_count() == 1; } typename InstanceType::Dictionary _dictionary; diff --git a/pxr/imaging/hdSt/resourceRegistry.cpp b/pxr/imaging/hdSt/resourceRegistry.cpp index cc62846c3c..f878e872a1 100644 --- a/pxr/imaging/hdSt/resourceRegistry.cpp +++ b/pxr/imaging/hdSt/resourceRegistry.cpp @@ -551,8 +551,9 @@ HdStResourceRegistry::GarbageCollectDispatchBuffers() _dispatchBufferRegistry.erase( std::remove_if( _dispatchBufferRegistry.begin(), _dispatchBufferRegistry.end(), - std::bind(&HdStDispatchBufferSharedPtr::unique, - std::placeholders::_1)), + [](const HdStDispatchBufferSharedPtr& ptr) { + return ptr.use_count() == 1; + }), _dispatchBufferRegistry.end()); } @@ -564,8 +565,9 @@ HdStResourceRegistry::GarbageCollectBufferResources() _bufferResourceRegistry.erase( std::remove_if( _bufferResourceRegistry.begin(), _bufferResourceRegistry.end(), - std::bind(&HdStBufferResourceSharedPtr::unique, - std::placeholders::_1)), + [](const HdStBufferResourceSharedPtr& ptr) { + return ptr.use_count() == 1; + }), _bufferResourceRegistry.end()); } diff --git a/pxr/imaging/hdSt/samplerObjectRegistry.cpp b/pxr/imaging/hdSt/samplerObjectRegistry.cpp index 894c4ac8d4..c57fc99a5f 100644 --- a/pxr/imaging/hdSt/samplerObjectRegistry.cpp +++ b/pxr/imaging/hdSt/samplerObjectRegistry.cpp @@ -129,13 +129,13 @@ HdSt_SamplerObjectRegistry::GarbageCollect() size_t last = _samplerObjects.size(); for (size_t i = 0; i < last; i++) { - if (_samplerObjects[i].unique()) { + if (_samplerObjects[i].use_count() == 1) { while(true) { last--; if (i == last) { break; } - if (!_samplerObjects[last].unique()) { + if (_samplerObjects[last].use_count() != 1) { _samplerObjects[i] = _samplerObjects[last]; break; } diff --git a/pxr/imaging/hio/stb/stb_image.h b/pxr/imaging/hio/stb/stb_image.h index ff3b47c7a5..45a790edf9 100644 --- a/pxr/imaging/hio/stb/stb_image.h +++ b/pxr/imaging/hio/stb/stb_image.h @@ -4626,7 +4626,7 @@ static int stbi__check_png_header(stbi__context *s) return 1; } -typedef struct +typedef struct stbi__png_type { stbi__context *s; stbi_uc *idata, *expanded, *out; diff --git a/pxr/imaging/hio/stb/stb_image.patch b/pxr/imaging/hio/stb/stb_image.patch index 6bf059d6ae..fa9d8a35f1 100644 --- a/pxr/imaging/hio/stb/stb_image.patch +++ b/pxr/imaging/hio/stb/stb_image.patch @@ -1,5 +1,5 @@ ---- original/stb_image.h 2024-05-21 15:30:18.887733957 -0700 -+++ stb_image.h 2024-05-21 15:17:49.371401403 -0700 +--- original/stb_image.h 2024-12-09 08:40:54 ++++ stb_image.h 2024-12-09 08:41:15 @@ -490,14 +490,14 @@ STBIDEF void stbi_image_free (void *retval_from_stbi_load); @@ -28,7 +28,13 @@ static int stbi__png_is16(stbi__context *s); #endif -@@ -4631,6 +4631,7 @@ +@@ -4626,11 +4626,12 @@ + return 1; + } + +-typedef struct ++typedef struct stbi__png_type + { stbi__context *s; stbi_uc *idata, *expanded, *out; int depth; diff --git a/pxr/usd/pcp/primIndex_Graph.cpp b/pxr/usd/pcp/primIndex_Graph.cpp index 4ae967d559..776a0d6411 100644 --- a/pxr/usd/pcp/primIndex_Graph.cpp +++ b/pxr/usd/pcp/primIndex_Graph.cpp @@ -613,7 +613,7 @@ PcpPrimIndex_Graph::_InsertChildInStrengthOrder( void PcpPrimIndex_Graph::_DetachSharedNodePool() { - if (!_nodes.unique()) { + if (_nodes.use_count() != 1) { TRACE_FUNCTION(); TfAutoMallocTag tag("_DetachSharedNodePool"); _nodes = std::make_shared<_NodePool>(*_nodes); @@ -623,7 +623,7 @@ PcpPrimIndex_Graph::_DetachSharedNodePool() void PcpPrimIndex_Graph::_DetachSharedNodePoolForNewNodes(size_t numAddedNodes) { - if (!_nodes.unique()) { + if (_nodes.use_count() != 1) { TRACE_FUNCTION(); TfAutoMallocTag tag("_DetachSharedNodePoolForNewNodes"); // Create a new copy, but with some extra capacity since we are adding