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
diff --git a/src/libGLESv2/Context.cpp b/src/libGLESv2/Context.cpp
index f542399..aa91246 100644
--- a/src/libGLESv2/Context.cpp
+++ b/src/libGLESv2/Context.cpp
@@ -2312,7 +2312,8 @@
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
@@ -4180,7 +4181,7 @@
}
}
-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;
@@ -4221,8 +4222,6 @@
D3DVERTEXELEMENT9 elements[MAX_VERTEX_ATTRIBS + 1];
D3DVERTEXELEMENT9 *element = &elements[0];
- ProgramBinary *programBinary = program->getProgramBinary();
-
for (int i = 0; i < MAX_VERTEX_ATTRIBS; i++)
{
if (attributes[i].active)
diff --git a/src/libGLESv2/Context.h b/src/libGLESv2/Context.h
index 2097fe4..67269cd 100644
--- a/src/libGLESv2/Context.h
+++ b/src/libGLESv2/Context.h
@@ -40,6 +40,7 @@
class Buffer;
class Shader;
class Program;
+class ProgramBinary;
class Texture;
class Texture2D;
class TextureCubeMap;
@@ -243,7 +244,7 @@
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();