Skip to content

Commit

Permalink
Merge pull request #660 from ForksMD/meshletGeneratorFix
Browse files Browse the repository at this point in the history
Fix meshlet generation, when 32bit indices are forced
  • Loading branch information
mhurliman authored Oct 13, 2020
2 parents 5e98d45 + bad3cb5 commit 7023dfc
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ bool MeshProcessor::Extract(const ProcessOptions& options, const WaveFrontReader

// Determine our index properties
m_indexCount = static_cast<uint32_t>(reader.indices.size());
m_indexSize = m_indexCount > 65536 ? 4 : 2;
m_indexSize = (m_indexCount > 65536 || options.Force32BitIndices) ? 4 : 2;
m_indices.resize(m_indexSize * m_indexCount);

// Copy our indices over to their final buffer.
if (m_indexSize == 4 || options.Force32BitIndices)
if (m_indexSize == 4)
{
// Already stored at 32-bits - simple copy over.
std::memcpy(m_indices.data(), reader.indices.data(), m_indexCount * m_indexSize);
Expand Down

0 comments on commit 7023dfc

Please sign in to comment.