Commit 93a5ce96 by Geoff Lang

Cache applied primitive topology.

Issue #451 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Geoff Lang
parent a6abd891
...@@ -849,7 +849,11 @@ bool Renderer11::applyPrimitiveType(GLenum mode, GLsizei count) ...@@ -849,7 +849,11 @@ bool Renderer11::applyPrimitiveType(GLenum mode, GLsizei count)
return gl::error(GL_INVALID_ENUM, false); return gl::error(GL_INVALID_ENUM, false);
} }
mDeviceContext->IASetPrimitiveTopology(primitiveTopology); if (primitiveTopology != mCurrentPrimitiveTopology)
{
mDeviceContext->IASetPrimitiveTopology(primitiveTopology);
mCurrentPrimitiveTopology = primitiveTopology;
}
return count > 0; return count > 0;
} }
...@@ -1816,6 +1820,8 @@ void Renderer11::markAllStateDirty() ...@@ -1816,6 +1820,8 @@ void Renderer11::markAllStateDirty()
mCurrentVertexConstantBuffer = NULL; mCurrentVertexConstantBuffer = NULL;
mCurrentPixelConstantBuffer = NULL; mCurrentPixelConstantBuffer = NULL;
mCurrentGeometryConstantBuffer = NULL; mCurrentGeometryConstantBuffer = NULL;
mCurrentPrimitiveTopology = D3D_PRIMITIVE_TOPOLOGY_UNDEFINED;
} }
void Renderer11::releaseDeviceResources() void Renderer11::releaseDeviceResources()
......
...@@ -288,6 +288,9 @@ class Renderer11 : public Renderer ...@@ -288,6 +288,9 @@ class Renderer11 : public Renderer
float mCurNear; float mCurNear;
float mCurFar; float mCurFar;
// Currently applied primitive topology
D3D11_PRIMITIVE_TOPOLOGY mCurrentPrimitiveTopology;
unsigned int mAppliedIBSerial; unsigned int mAppliedIBSerial;
unsigned int mAppliedStorageIBSerial; unsigned int mAppliedStorageIBSerial;
unsigned int mAppliedIBOffset; unsigned int mAppliedIBOffset;
......
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