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) ...@@ -58,6 +58,11 @@ Dx9BackEnd::Dx9BackEnd(IDirect3DDevice9 *d3ddevice)
: mDevice(d3ddevice) : mDevice(d3ddevice)
{ {
mDevice->AddRef(); mDevice->AddRef();
for (int i = 0; i < MAX_VERTEX_ATTRIBS; ++i)
{
mAppliedAttribEnabled[i] = true;
}
} }
Dx9BackEnd::~Dx9BackEnd() Dx9BackEnd::~Dx9BackEnd()
...@@ -238,10 +243,18 @@ GLenum Dx9BackEnd::setupAttributesPreDraw(const TranslatedAttribute *attributes) ...@@ -238,10 +243,18 @@ GLenum Dx9BackEnd::setupAttributesPreDraw(const TranslatedAttribute *attributes)
if (attributes[i].enabled) if (attributes[i].enabled)
{ {
mDevice->SetStreamSource(i, getDxBuffer(attributes[i].buffer), attributes[i].offset, attributes[i].stride); mDevice->SetStreamSource(i, getDxBuffer(attributes[i].buffer), attributes[i].offset, attributes[i].stride);
if (!mAppliedAttribEnabled[i])
{
mAppliedAttribEnabled[i] = true;
}
} }
else else
{ {
if (mAppliedAttribEnabled[i])
{
mDevice->SetStreamSource(i, 0, 0, 0); mDevice->SetStreamSource(i, 0, 0, 0);
mAppliedAttribEnabled[i] = false;
}
} }
} }
......
...@@ -38,6 +38,8 @@ class Dx9BackEnd : public BufferBackEnd ...@@ -38,6 +38,8 @@ class Dx9BackEnd : public BufferBackEnd
private: private:
IDirect3DDevice9 *mDevice; IDirect3DDevice9 *mDevice;
bool mAppliedAttribEnabled[MAX_VERTEX_ATTRIBS];
class Dx9VertexBuffer : public TranslatedVertexBuffer class Dx9VertexBuffer : public TranslatedVertexBuffer
{ {
public: 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