Pass the programBinary directly to applyDeclaration

Trac #21270 Bug=351 Signed-off-by: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@1231 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent d6fddbf1
...@@ -2312,7 +2312,8 @@ GLenum Context::applyVertexBuffer(GLint first, GLsizei count, GLsizei instances, ...@@ -2312,7 +2312,8 @@ GLenum Context::applyVertexBuffer(GLint first, GLsizei count, GLsizei instances,
return err; return err;
} }
return mVertexDeclarationCache.applyDeclaration(mDevice, attributes, getCurrentProgram(), instances, repeatDraw); ProgramBinary *programBinary = getCurrentProgram()->getProgramBinary();
return mVertexDeclarationCache.applyDeclaration(mDevice, attributes, programBinary, instances, repeatDraw);
} }
// Applies the indices and element array bindings to the Direct3D 9 device // Applies the indices and element array bindings to the Direct3D 9 device
...@@ -4180,7 +4181,7 @@ VertexDeclarationCache::~VertexDeclarationCache() ...@@ -4180,7 +4181,7 @@ VertexDeclarationCache::~VertexDeclarationCache()
} }
} }
GLenum VertexDeclarationCache::applyDeclaration(IDirect3DDevice9 *device, TranslatedAttribute attributes[], Program *program, GLsizei instances, GLsizei *repeatDraw) GLenum VertexDeclarationCache::applyDeclaration(IDirect3DDevice9 *device, TranslatedAttribute attributes[], ProgramBinary *programBinary, GLsizei instances, GLsizei *repeatDraw)
{ {
*repeatDraw = 1; *repeatDraw = 1;
...@@ -4221,8 +4222,6 @@ GLenum VertexDeclarationCache::applyDeclaration(IDirect3DDevice9 *device, Transl ...@@ -4221,8 +4222,6 @@ GLenum VertexDeclarationCache::applyDeclaration(IDirect3DDevice9 *device, Transl
D3DVERTEXELEMENT9 elements[MAX_VERTEX_ATTRIBS + 1]; D3DVERTEXELEMENT9 elements[MAX_VERTEX_ATTRIBS + 1];
D3DVERTEXELEMENT9 *element = &elements[0]; D3DVERTEXELEMENT9 *element = &elements[0];
ProgramBinary *programBinary = program->getProgramBinary();
for (int i = 0; i < MAX_VERTEX_ATTRIBS; i++) for (int i = 0; i < MAX_VERTEX_ATTRIBS; i++)
{ {
if (attributes[i].active) if (attributes[i].active)
......
...@@ -40,6 +40,7 @@ struct TranslatedIndexData; ...@@ -40,6 +40,7 @@ struct TranslatedIndexData;
class Buffer; class Buffer;
class Shader; class Shader;
class Program; class Program;
class ProgramBinary;
class Texture; class Texture;
class Texture2D; class Texture2D;
class TextureCubeMap; class TextureCubeMap;
...@@ -243,7 +244,7 @@ class VertexDeclarationCache ...@@ -243,7 +244,7 @@ class VertexDeclarationCache
VertexDeclarationCache(); VertexDeclarationCache();
~VertexDeclarationCache(); ~VertexDeclarationCache();
GLenum applyDeclaration(IDirect3DDevice9 *device, TranslatedAttribute attributes[], Program *program, GLsizei instances, GLsizei *repeatDraw); GLenum applyDeclaration(IDirect3DDevice9 *device, TranslatedAttribute attributes[], ProgramBinary *programBinary, GLsizei instances, GLsizei *repeatDraw);
void markStateDirty(); void markStateDirty();
......
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