Cache the current program binary instead of the current program.
Trac #21270
Bug=351
Signed-off-by: Nicolas Capens
Everywhere we used the currentProgram it was immediately used to get the program's binary.
git-svn-id: https://angleproject.googlecode.com/svn/trunk@1235 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/libGLESv2.cpp b/src/libGLESv2/libGLESv2.cpp
index 9f3e591..5a70a84 100644
--- a/src/libGLESv2/libGLESv2.cpp
+++ b/src/libGLESv2/libGLESv2.cpp
@@ -5953,14 +5953,7 @@
if (context)
{
- gl::Program *program = context->getCurrentProgram();
-
- if (!program)
- {
- return error(GL_INVALID_OPERATION);
- }
-
- gl::ProgramBinary *programBinary = program->getProgramBinary();
+ gl::ProgramBinary *programBinary = context->getCurrentProgramBinary();
if (!programBinary)
{
return error(GL_INVALID_OPERATION);
@@ -6003,14 +5996,7 @@
if (context)
{
- gl::Program *program = context->getCurrentProgram();
-
- if (!program)
- {
- return error(GL_INVALID_OPERATION);
- }
-
- gl::ProgramBinary *programBinary = program->getProgramBinary();
+ gl::ProgramBinary *programBinary = context->getCurrentProgramBinary();
if (!programBinary)
{
return error(GL_INVALID_OPERATION);
@@ -6055,14 +6041,7 @@
if (context)
{
- gl::Program *program = context->getCurrentProgram();
-
- if (!program)
- {
- return error(GL_INVALID_OPERATION);
- }
-
- gl::ProgramBinary *programBinary = program->getProgramBinary();
+ gl::ProgramBinary *programBinary = context->getCurrentProgramBinary();
if (!programBinary)
{
return error(GL_INVALID_OPERATION);
@@ -6107,14 +6086,7 @@
if (context)
{
- gl::Program *program = context->getCurrentProgram();
-
- if (!program)
- {
- return error(GL_INVALID_OPERATION);
- }
-
- gl::ProgramBinary *programBinary = program->getProgramBinary();
+ gl::ProgramBinary *programBinary = context->getCurrentProgramBinary();
if (!programBinary)
{
return error(GL_INVALID_OPERATION);
@@ -6159,14 +6131,7 @@
if (context)
{
- gl::Program *program = context->getCurrentProgram();
-
- if (!program)
- {
- return error(GL_INVALID_OPERATION);
- }
-
- gl::ProgramBinary *programBinary = program->getProgramBinary();
+ gl::ProgramBinary *programBinary = context->getCurrentProgramBinary();
if (!programBinary)
{
return error(GL_INVALID_OPERATION);
@@ -6211,14 +6176,7 @@
if (context)
{
- gl::Program *program = context->getCurrentProgram();
-
- if (!program)
- {
- return error(GL_INVALID_OPERATION);
- }
-
- gl::ProgramBinary *programBinary = program->getProgramBinary();
+ gl::ProgramBinary *programBinary = context->getCurrentProgramBinary();
if (!programBinary)
{
return error(GL_INVALID_OPERATION);
@@ -6263,14 +6221,7 @@
if (context)
{
- gl::Program *program = context->getCurrentProgram();
-
- if (!program)
- {
- return error(GL_INVALID_OPERATION);
- }
-
- gl::ProgramBinary *programBinary = program->getProgramBinary();
+ gl::ProgramBinary *programBinary = context->getCurrentProgramBinary();
if (!programBinary)
{
return error(GL_INVALID_OPERATION);
@@ -6315,14 +6266,7 @@
if (context)
{
- gl::Program *program = context->getCurrentProgram();
-
- if (!program)
- {
- return error(GL_INVALID_OPERATION);
- }
-
- gl::ProgramBinary *programBinary = program->getProgramBinary();
+ gl::ProgramBinary *programBinary = context->getCurrentProgramBinary();
if (!programBinary)
{
return error(GL_INVALID_OPERATION);
@@ -6361,14 +6305,7 @@
if (context)
{
- gl::Program *program = context->getCurrentProgram();
-
- if (!program)
- {
- return error(GL_INVALID_OPERATION);
- }
-
- gl::ProgramBinary *programBinary = program->getProgramBinary();
+ gl::ProgramBinary *programBinary = context->getCurrentProgramBinary();
if (!programBinary)
{
return error(GL_INVALID_OPERATION);
@@ -6407,14 +6344,7 @@
if (context)
{
- gl::Program *program = context->getCurrentProgram();
-
- if (!program)
- {
- return error(GL_INVALID_OPERATION);
- }
-
- gl::ProgramBinary *programBinary = program->getProgramBinary();
+ gl::ProgramBinary *programBinary = context->getCurrentProgramBinary();
if (!programBinary)
{
return error(GL_INVALID_OPERATION);
@@ -6453,14 +6383,7 @@
if (context)
{
- gl::Program *program = context->getCurrentProgram();
-
- if (!program)
- {
- return error(GL_INVALID_OPERATION);
- }
-
- gl::ProgramBinary *programBinary = program->getProgramBinary();
+ gl::ProgramBinary *programBinary = context->getCurrentProgramBinary();
if (!programBinary)
{
return error(GL_INVALID_OPERATION);