Caches parameters for SetStreamSource calls

TRAC #12239 Signed-off-by: Nicolas Capens Signed-off-by: Daniel Koch Author: Shannon Woods git-svn-id: https://angleproject.googlecode.com/svn/trunk@286 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 2d84df0c
......@@ -58,6 +58,11 @@ Dx9BackEnd::Dx9BackEnd(IDirect3DDevice9 *d3ddevice)
: mDevice(d3ddevice)
{
mDevice->AddRef();
for (int i = 0; i < MAX_VERTEX_ATTRIBS; ++i)
{
mAppliedAttribEnabled[i] = true;
}
}
Dx9BackEnd::~Dx9BackEnd()
......@@ -238,10 +243,18 @@ GLenum Dx9BackEnd::setupAttributesPreDraw(const TranslatedAttribute *attributes)
if (attributes[i].enabled)
{
mDevice->SetStreamSource(i, getDxBuffer(attributes[i].buffer), attributes[i].offset, attributes[i].stride);
if (!mAppliedAttribEnabled[i])
{
mAppliedAttribEnabled[i] = true;
}
}
else
{
mDevice->SetStreamSource(i, 0, 0, 0);
if (mAppliedAttribEnabled[i])
{
mDevice->SetStreamSource(i, 0, 0, 0);
mAppliedAttribEnabled[i] = false;
}
}
}
......
......@@ -38,6 +38,8 @@ class Dx9BackEnd : public BufferBackEnd
private:
IDirect3DDevice9 *mDevice;
bool mAppliedAttribEnabled[MAX_VERTEX_ATTRIBS];
class Dx9VertexBuffer : public TranslatedVertexBuffer
{
public:
......
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