Skip to content

Commit

Permalink
usdImaging: Replace boost::hash with TfHash in pxr .h files. This is …
Browse files Browse the repository at this point in the history
…a stopgap

to get us over a C++17 upgrade hurdle, and is intended to be replaced by more
thorough work by mkuruc.

Fixes #2634

(Internal change: 2294196)
  • Loading branch information
gitamohr authored and pixar-oss committed Sep 7, 2023
1 parent 1f4b5f5 commit ae45ce8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions pxr/usdImaging/usdImaging/delegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2342,8 +2342,8 @@ UsdImagingDelegate::SetRigidXformOverrides(
if (_rigidXformOverrides == rigidXformOverrides) {
return;
}

TfHashMap<UsdPrim, GfMatrix4d, boost::hash<UsdPrim> > overridesToUpdate;
UsdImaging_XformCache::ValueOverridesMap overridesToUpdate;

// Compute the set of overrides to update and update their values in the
// inherited xform cache.
Expand Down
6 changes: 3 additions & 3 deletions pxr/usdImaging/usdImaging/primvarDescCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

#include "pxr/usd/sdf/path.h"

#include "pxr/base/tf/hash.h"
#include "pxr/base/tf/token.h"

#include <tbb/concurrent_unordered_map.h>
Expand Down Expand Up @@ -71,9 +72,8 @@ class UsdImagingPrimvarDescCache

struct Hash {
inline size_t operator()(Key const& key) const {
size_t hash = key._path.GetHash();
boost::hash_combine(hash, key._attribute.Hash());
return hash;
return TfHash::Combine(key._path.GetHash(),
key._attribute.Hash());
}
};

Expand Down
8 changes: 3 additions & 5 deletions pxr/usdImaging/usdImaging/resolvedAttributeCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "pxr/usd/usdShade/tokens.h"
#include "pxr/usd/sdf/path.h"

#include "pxr/base/tf/hash.h"
#include "pxr/base/work/utils.h"

#include <boost/functional/hash.hpp>
Expand Down Expand Up @@ -68,15 +69,12 @@ class UsdImaging_ResolvedAttributeCache
{
friend Strategy;
struct _Entry;
typedef tbb::concurrent_unordered_map<UsdPrim,
_Entry,
boost::hash<UsdPrim> > _CacheMap;
using _CacheMap = tbb::concurrent_unordered_map<UsdPrim, _Entry, TfHash>;
public:
typedef typename Strategy::value_type value_type;
typedef typename Strategy::query_type query_type;

typedef TfHashMap<UsdPrim, value_type, boost::hash<UsdPrim> >
ValueOverridesMap;
using ValueOverridesMap = TfHashMap<UsdPrim, value_type, TfHash>;

/// Construct a new for the specified \p time.
explicit UsdImaging_ResolvedAttributeCache(
Expand Down

0 comments on commit ae45ce8

Please sign in to comment.