glDrawElements fix

This commit is contained in:
Jack Andersen 2016-04-01 17:32:39 -10:00
parent d047a37e2b
commit 229b0b28a8
1 changed files with 5 additions and 3 deletions

View File

@ -228,7 +228,7 @@ public:
void bind(size_t idx, int b); void bind(size_t idx, int b);
}; };
static std::vector<int32_t> DepthInitializer; static std::vector<GLuint> DepthInitializer;
class GLTextureR : public ITextureR class GLTextureR : public ITextureR
{ {
@ -997,13 +997,15 @@ struct GLCommandQueue : IGraphicsCommandQueue
glDrawArrays(currentPrim, cmd.start, cmd.count); glDrawArrays(currentPrim, cmd.start, cmd.count);
break; break;
case Command::Op::DrawIndexed: case Command::Op::DrawIndexed:
glDrawElements(currentPrim, cmd.count, GL_UNSIGNED_INT, (void*)cmd.start); glDrawElements(currentPrim, cmd.count, GL_UNSIGNED_INT,
reinterpret_cast<void*>(cmd.start * 4));
break; break;
case Command::Op::DrawInstances: case Command::Op::DrawInstances:
glDrawArraysInstanced(currentPrim, cmd.start, cmd.count, cmd.instCount); glDrawArraysInstanced(currentPrim, cmd.start, cmd.count, cmd.instCount);
break; break;
case Command::Op::DrawInstancesIndexed: case Command::Op::DrawInstancesIndexed:
glDrawElementsInstanced(currentPrim, cmd.count, GL_UNSIGNED_INT, (void*)cmd.start, cmd.instCount); glDrawElementsInstanced(currentPrim, cmd.count, GL_UNSIGNED_INT,
reinterpret_cast<void*>(cmd.start * 4), cmd.instCount);
break; break;
case Command::Op::ResolveBindTexture: case Command::Op::ResolveBindTexture:
{ {