示例#1
0
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);
    }
示例#2
0
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;
}
示例#3
0
/* 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;
}
示例#4
0
/* 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;
}