HdAggregationStrategy::AggregationId HdVBOMemoryManager::ComputeAggregationId(HdBufferSpecVector const &bufferSpecs) const { uint32_t hash = 0; TF_FOR_ALL(it, bufferSpecs) { size_t nameHash = it->name.Hash(); hash = ArchHash((const char*)&nameHash, sizeof(nameHash), hash); hash = ArchHash((const char*)&(it->glDataType), sizeof(it->glDataType), hash); hash = ArchHash((const char*)&(it->numComponents), sizeof(it->numComponents), hash); }
PxOsdMeshTopology::ID PxOsdMeshTopology::ComputeHash() const { TRACE_FUNCTION(); uint32_t hash = _subdivTags.ComputeHash(); hash = ArchHash((const char*)&_scheme, sizeof(TfToken), hash); hash = ArchHash((const char*)&_orientation, sizeof(TfToken), hash); hash = ArchHash((const char*)_faceVertexCounts.cdata(), _faceVertexCounts.size() * sizeof(int), hash); hash = ArchHash((const char*)_faceVertexIndices.cdata(), _faceVertexIndices.size() * sizeof(int), hash); hash = ArchHash((const char*)_holeIndices.cdata(), _holeIndices.size() * sizeof(int), hash); // promote to size_t return (ID)hash; }
/* static */ HdStGLSLProgram::ID HdStGLSLProgram::ComputeHash(TfToken const &sourceFile) { HD_TRACE_FUNCTION(); uint32_t hash = 0; std::string const &filename = sourceFile.GetString(); hash = ArchHash(filename.c_str(), filename.size(), hash); return hash; }
/* static */ HdTextureResource::ID HdTextureResource::ComputeFallbackUVHash() { HD_TRACE_FUNCTION(); uint32_t hash = 0; std::string const &filename = _tokens->fallbackUVPath.GetString(); hash = ArchHash(filename.c_str(), filename.size(), hash); return hash; }