Avoid calling getContext() for resource limits.

TRAC #22243
Signed-off-by: Jamie Madill
Signed-off-by: Daniel Koch
Author: Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1776 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/ProgramBinary.cpp b/src/libGLESv2/ProgramBinary.cpp
index c5e021c..9d21d80 100644
--- a/src/libGLESv2/ProgramBinary.cpp
+++ b/src/libGLESv2/ProgramBinary.cpp
@@ -165,7 +165,7 @@
       default: UNREACHABLE();
     }
 
-    if (logicalTextureUnit >= 0 && logicalTextureUnit < (GLint)getContext()->getMaximumCombinedTextureImageUnits())
+    if (logicalTextureUnit >= 0 && logicalTextureUnit < (GLint)mRenderer->getMaxCombinedTextureImageUnits())
     {
         return logicalTextureUnit;
     }
@@ -1007,8 +1007,7 @@
 // Returns the number of used varying registers, or -1 if unsuccesful
 int ProgramBinary::packVaryings(InfoLog &infoLog, const Varying *packing[][4], FragmentShader *fragmentShader)
 {
-    Context *context = getContext();
-    const int maxVaryingVectors = context->getMaximumVaryingVectors();
+    const int maxVaryingVectors = mRenderer->getMaxVaryingVectors();
 
     for (VaryingList::iterator varying = fragmentShader->mVaryings.begin(); varying != fragmentShader->mVaryings.end(); varying++)
     {
@@ -1184,8 +1183,7 @@
 
     // Write the HLSL input/output declarations
     const int shaderModel = mRenderer->getMajorShaderModel();
-    Context *context = getContext();
-    const int maxVaryingVectors = context->getMaximumVaryingVectors();
+    const int maxVaryingVectors = mRenderer->getMaxVaryingVectors();
 
     if (registers == maxVaryingVectors && fragmentShader->mUsesFragCoord)
     {
@@ -2176,7 +2174,7 @@
     // texture image unit, and this is the current program, then ValidateProgram will fail, and
     // DrawArrays and DrawElements will issue the INVALID_OPERATION error.
 
-    const unsigned int maxCombinedTextureImageUnits = getContext()->getMaximumCombinedTextureImageUnits();
+    const unsigned int maxCombinedTextureImageUnits = mRenderer->getMaxCombinedTextureImageUnits();
     TextureType textureUnitType[IMPLEMENTATION_MAX_COMBINED_TEXTURE_IMAGE_UNITS];
 
     for (unsigned int i = 0; i < IMPLEMENTATION_MAX_COMBINED_TEXTURE_IMAGE_UNITS; ++i)