Lines Matching refs:index

51 string getProgramFileName (deUint32 index)
53 return de::toString(tcu::toHex(index)) + ".spv";
56 string getProgramPath (const std::string& dirName, deUint32 index)
58 return de::FilePath::join(dirName, getProgramFileName(index)).getPath();
93 deUint32 index = ~0u;
97 str >> index;
99 DE_ASSERT(getProgramFileName(index) == name);
101 return index;
106 return de::FilePath::join(dirName, "index.bin").getPath();
127 void writeBinary (const std::string& dstDir, deUint32 index, const ProgramBinary& binary)
129 writeBinary(binary, getProgramPath(dstDir, index));
180 const deUint32* findBinaryIndex (BinaryIndexAccess* index, const ProgramIdentifier& id)
188 const BinaryIndexNode& curNode = (*index)[nodeNdx];
194 TCU_CHECK_INTERNAL((size_t)curNode.index < index->size());
196 nodeNdx = curNode.index;
200 return &curNode.index;
209 TCU_CHECK_INTERNAL(nodeNdx < index->size());
218 //! Sparse index node used for final binary index construction
222 deUint32 index;
227 , index (index_)
232 , index (0)
251 void addToSparseIndex (SparseIndexNode* group, const deUint32* words, size_t numWords, deUint32 index)
270 group->children.push_back(new SparseIndexNode(curWord, numWords == 1 ? index : 0));
276 addToSparseIndex(child, words+1, numWords-1, index);
281 // Prepares sparse index for finalization. Ensures that child with word = 0 is moved
326 deUint32 addAndCountNodes (BinaryIndexNode* index, deUint32 baseOffset, const SparseIndexNode* group)
331 // Must be normalized prior to construction of final index
337 const deUint32 subtreeSize = addAndCountNodes(index+curOffset, baseOffset+curOffset, child);
339 index[childNdx].word = child->word;
342 index[childNdx].index = child->index;
345 DE_ASSERT(child->index == 0);
346 index[childNdx].index = baseOffset+curOffset;
366 // Generate empty index
369 (*dst)[0].index = 0u;
380 addToSparseIndex(sparseIndex.get(), &searchPath[0], searchPath.size(), entries[ndx].index);
409 void BinaryIndexHash::insert (const ProgramBinary* binary, deUint32 index)
411 if (!BinaryIndexHashImpl_insert(m_hash, binary, index))
443 const deUint32 index = getProgramIndexFromName(baseName);
446 addBinary(index, *binary);
456 deUint32 index = indexPtr ? *indexPtr : ~0u;
460 index = getNextSlot();
461 addBinary(index, binary);
464 m_binaries[index].referenceCount += 1;
465 m_binaryIndices.push_back(ProgramIdentifierIndex(id, index));
475 const deUint32 index = (deUint32)m_binaries.size();
477 if ((size_t)index != m_binaries.size())
480 return index;
483 void BinaryRegistryWriter::addBinary (deUint32 index, const ProgramBinary& binary)
492 if (m_binaries.size() < (size_t)index+1)
493 m_binaries.resize(index+1);
495 DE_ASSERT(!m_binaries[index].binary);
496 DE_ASSERT(m_binaries[index].referenceCount == 0);
498 m_binaries[index].binary = binaryClone;
507 m_binaryHash.insert(binaryClone, index);
541 // Write index
544 std::vector<BinaryIndexNode> index;
546 buildBinaryIndex(&index, m_binaryIndices.size(), !m_binaryIndices.empty() ? &m_binaryIndices[0] : DE_NULL);
548 // Even in empty index there is always terminating node for the root group
549 DE_ASSERT(!index.empty());
558 throw tcu::InternalError(string("Failed to open program binary index file ") + indexPath.getPath());
560 indexOut.write((const char*)&index[0], index.size()*sizeof(BinaryIndexNode));
587 throw ProgramNotFoundException(id, string("Failed to open binary index (") + e.what() + ")");
616 throw ProgramNotFoundException(id, "Program not found in index");