MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / compact16BitIndices

Function compact16BitIndices

Source/Falcor/Scene/SceneBuilder.cpp:180–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178 }
179
180 std::vector<uint32_t> compact16BitIndices(const std::vector<uint32_t>& indices)
181 {
182 if (indices.empty()) return {};
183 size_t sz = div_round_up(indices.size(), (std::size_t)2); // Storing two 16-bit indices per dword.
184 std::vector<uint32_t> indexData(sz);
185 uint16_t* pIndices = reinterpret_cast<uint16_t*>(indexData.data());
186 for (size_t i = 0; i < indices.size(); i++)
187 {
188 FALCOR_ASSERT(indices[i] < (1u << 16));
189 pIndices[i] = static_cast<uint16_t>(indices[i]);
190 }
191 return indexData;
192 }
193
194 SceneCache::Key computeSceneCacheKey(const std::filesystem::path& path, SceneBuilder::Flags buildFlags)
195 {

Callers 2

processMeshMethod · 0.85
splitIndexedMeshMethod · 0.85

Calls 4

div_round_upFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected