OpenGLRenderer: Fix Draw[Indexed]Data states

This commit is contained in:
Jérôme Leclercq 2021-01-22 23:18:35 +01:00
parent dbcb4a61d0
commit d52be87fd5
1 changed files with 2 additions and 2 deletions

View File

@ -80,12 +80,12 @@ namespace Nz
} }
else if constexpr (std::is_same_v<T, DrawData>) else if constexpr (std::is_same_v<T, DrawData>)
{ {
ApplyStates(*context, m_currentStates); ApplyStates(*context, command.states);
context->glDrawArraysInstanced(GL_TRIANGLES, command.firstVertex, command.vertexCount, command.instanceCount); context->glDrawArraysInstanced(GL_TRIANGLES, command.firstVertex, command.vertexCount, command.instanceCount);
} }
else if constexpr (std::is_same_v<T, DrawIndexedData>) else if constexpr (std::is_same_v<T, DrawIndexedData>)
{ {
ApplyStates(*context, m_currentStates); ApplyStates(*context, command.states);
context->glDrawElementsInstanced(GL_TRIANGLES, command.indexCount, GL_UNSIGNED_SHORT, nullptr, command.instanceCount); context->glDrawElementsInstanced(GL_TRIANGLES, command.indexCount, GL_UNSIGNED_SHORT, nullptr, command.instanceCount);
} }
else if constexpr (std::is_same_v<T, SetFrameBufferData>) else if constexpr (std::is_same_v<T, SetFrameBufferData>)