Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix meshlet generation, when 32bit indices are forced #660

Merged
merged 1 commit into from
Oct 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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