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
parent 91207b79
......@@ -2121,7 +2121,7 @@ void Context::drawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid
if (!skipDraw(mode))
{
mRenderer->drawElements(mode, count, type, indices, mState.elementArrayBuffer.get());
mRenderer->drawElements(mode, count, type, indices, mState.elementArrayBuffer.get(), indexInfo);
}
}
......
......@@ -97,7 +97,7 @@ class Renderer
virtual GLenum applyIndexBuffer(const GLvoid *indices, gl::Buffer *elementArrayBuffer, GLsizei count, GLenum mode, GLenum type, gl::TranslatedIndexData *indexInfo) = 0;
virtual void drawArrays(GLenum mode, GLsizei count, GLsizei instances) = 0;
virtual void drawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, gl::Buffer *elementArrayBuffer) = 0;
virtual void drawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, gl::Buffer *elementArrayBuffer, const gl::TranslatedIndexData &indexInfo) = 0;
virtual void clear(const gl::ClearParameters &clearParams, gl::Framebuffer *frameBuffer) = 0;
......
......@@ -467,7 +467,7 @@ void Renderer11::drawArrays(GLenum mode, GLsizei count, GLsizei instances)
UNIMPLEMENTED();
}
void Renderer11::drawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, gl::Buffer *elementArrayBuffer)
void Renderer11::drawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, gl::Buffer *elementArrayBuffer, const gl::TranslatedIndexData &indexInfo)
{
// TODO
UNIMPLEMENTED();
......
......@@ -67,7 +67,7 @@ class Renderer11 : public Renderer
virtual GLenum applyIndexBuffer(const GLvoid *indices, gl::Buffer *elementArrayBuffer, GLsizei count, GLenum mode, GLenum type, gl::TranslatedIndexData *indexInfo);
virtual void drawArrays(GLenum mode, GLsizei count, GLsizei instances);
virtual void drawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, gl::Buffer *elementArrayBuffer);
virtual void drawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, gl::Buffer *elementArrayBuffer, const gl::TranslatedIndexData &indexInfo);
virtual void clear(const gl::ClearParameters &clearParams, gl::Framebuffer *frameBuffer);
......
......@@ -1159,10 +1159,6 @@ GLenum Renderer9::applyIndexBuffer(const GLvoid *indices, gl::Buffer *elementArr
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::drawArrays(GLenum mode, GLsizei count, GLsizei instances)
}
}
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);
}
}
}
......
......@@ -102,7 +102,7 @@ class Renderer9 : public Renderer
virtual GLenum applyIndexBuffer(const GLvoid *indices, gl::Buffer *elementArrayBuffer, GLsizei count, GLenum mode, GLenum type, gl::TranslatedIndexData *indexInfo);
virtual void drawArrays(GLenum mode, GLsizei count, GLsizei instances);
virtual void drawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, gl::Buffer *elementArrayBuffer);
virtual void drawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, gl::Buffer *elementArrayBuffer, const gl::TranslatedIndexData &indexInfo);
virtual void clear(const gl::ClearParameters &clearParams, gl::Framebuffer *frameBuffer);
......@@ -222,7 +222,6 @@ class Renderer9 : public Renderer
D3DPRIMITIVETYPE mPrimitiveType;
int mPrimitiveCount;
GLsizei mRepeatDraw;
gl::TranslatedIndexData mIndexInfo;
bool mSceneStarted;
bool mSupportsNonPower2Textures;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment