Clean up passing around translated index data.
TRAC #22016
Signed-off-by: Daniel Koch
Signed-off-by: Geoff Lang
Author: Nicolas Capens
git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1493 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/renderer/Renderer9.cpp b/src/libGLESv2/renderer/Renderer9.cpp
index 05ecb55..7feb01b 100644
--- a/src/libGLESv2/renderer/Renderer9.cpp
+++ b/src/libGLESv2/renderer/Renderer9.cpp
@@ -1159,10 +1159,6 @@
unsigned int serial;
GLenum err = mIndexDataManager->prepareIndexData(type, count, elementArrayBuffer, indices, indexInfo, &indexBuffer, &serial);
- mIndexInfo.minIndex = indexInfo->minIndex;
- mIndexInfo.maxIndex = indexInfo->maxIndex;
- mIndexInfo.startIndex = indexInfo->startIndex;
-
if (err == GL_NO_ERROR)
{
if (serial != mAppliedIBSerial)
@@ -1211,20 +1207,20 @@
}
}
-void Renderer9::drawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, gl::Buffer *elementArrayBuffer)
+void Renderer9::drawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, gl::Buffer *elementArrayBuffer, const gl::TranslatedIndexData &indexInfo)
{
startScene();
if (mode == GL_LINE_LOOP)
{
- drawLineLoop(count, type, indices, mIndexInfo.minIndex, elementArrayBuffer);
+ drawLineLoop(count, type, indices, indexInfo.minIndex, elementArrayBuffer);
}
else
{
for (int i = 0; i < mRepeatDraw; i++)
{
- GLsizei vertexCount = mIndexInfo.maxIndex - mIndexInfo.minIndex + 1;
- mDevice->DrawIndexedPrimitive(mPrimitiveType, -(INT)mIndexInfo.minIndex, mIndexInfo.minIndex, vertexCount, mIndexInfo.startIndex, mPrimitiveCount);
+ GLsizei vertexCount = indexInfo.maxIndex - indexInfo.minIndex + 1;
+ mDevice->DrawIndexedPrimitive(mPrimitiveType, -(INT)indexInfo.minIndex, indexInfo.minIndex, vertexCount, indexInfo.startIndex, mPrimitiveCount);
}
}
}