Store the current context client version in the Renderer for ease of access.

TRAC #22704

Signed-off-by: Geoff Lang
Signed-off-by: Shannon Woods
Author: Jamie Madill

git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2100 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Context.cpp b/src/libGLESv2/Context.cpp
index f17045a..3067ead 100644
--- a/src/libGLESv2/Context.cpp
+++ b/src/libGLESv2/Context.cpp
@@ -315,6 +315,9 @@
     Framebuffer *framebufferZero = new DefaultFramebuffer(mRenderer, colorbufferZero, depthStencilbufferZero);
 
     setFramebufferZero(framebufferZero);
+
+    // Store the current client version in the renderer
+    mRenderer->setCurrentClientVersion(mClientVersion);
 }
 
 // NOTE: this function should not assume that this context is current!
diff --git a/src/libGLESv2/renderer/Renderer.h b/src/libGLESv2/renderer/Renderer.h
index 72fd936..67ef1f9 100644
--- a/src/libGLESv2/renderer/Renderer.h
+++ b/src/libGLESv2/renderer/Renderer.h
@@ -222,6 +222,10 @@
     virtual QueryImpl *createQuery(GLenum type) = 0;
     virtual FenceImpl *createFence() = 0;
 
+    // Current GLES client version
+    void setCurrentClientVersion(int clientVersion) { mCurrentClientVersion = clientVersion; }
+    int getCurrentClientVersion() const { return mCurrentClientVersion; }
+
   protected:
     bool initializeCompiler();
     ShaderBlob *compileToBinary(gl::InfoLog &infoLog, const char *hlsl, const char *profile, UINT optimizationFlags, bool alternateFlags);
@@ -233,6 +237,7 @@
 
     HMODULE mD3dCompilerModule;
     pCompileFunc mD3DCompileFunc;
+    int mCurrentClientVersion;
 };
 
 }