Remove the clientVersion parameter from the format utils.

clientVersion was only useful for intitial validation of formats and not
required for queries.  Only use the client version and caps structure to
validate if a format is available and then trust that it is supported past
the validation layer.

Fixed some inconsistancies between tables such as missing formats or
incorrect load functions in the ES3 tables.

BUG=angle:659

Change-Id: I8d33c902156ee6fb41efe937d93b0586191726e5
Reviewed-on: https://chromium-review.googlesource.com/201167
Reviewed-by: Shannon Woods <shannonwoods@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libGLESv2/Context.cpp b/src/libGLESv2/Context.cpp
index 5df651f..b0425bd 100644
--- a/src/libGLESv2/Context.cpp
+++ b/src/libGLESv2/Context.cpp
@@ -1875,10 +1875,10 @@
             {
                 switch (pname)
                 {
-                  case GL_RED_BITS:   *params = colorbuffer->getRedSize(mClientVersion);      break;
-                  case GL_GREEN_BITS: *params = colorbuffer->getGreenSize(mClientVersion);    break;
-                  case GL_BLUE_BITS:  *params = colorbuffer->getBlueSize(mClientVersion);     break;
-                  case GL_ALPHA_BITS: *params = colorbuffer->getAlphaSize(mClientVersion);    break;
+                  case GL_RED_BITS:   *params = colorbuffer->getRedSize();      break;
+                  case GL_GREEN_BITS: *params = colorbuffer->getGreenSize();    break;
+                  case GL_BLUE_BITS:  *params = colorbuffer->getBlueSize();     break;
+                  case GL_ALPHA_BITS: *params = colorbuffer->getAlphaSize();    break;
                 }
             }
             else
@@ -1894,7 +1894,7 @@
 
             if (depthbuffer)
             {
-                *params = depthbuffer->getDepthSize(mClientVersion);
+                *params = depthbuffer->getDepthSize();
             }
             else
             {
@@ -1909,7 +1909,7 @@
 
             if (stencilbuffer)
             {
-                *params = stencilbuffer->getStencilSize(mClientVersion);
+                *params = stencilbuffer->getStencilSize();
             }
             else
             {
@@ -2634,7 +2634,7 @@
                 return;
             }
 
-            if (gl::GetStencilBits(depthStencil->getActualFormat(), mClientVersion) > 0)
+            if (gl::GetStencilBits(depthStencil->getActualFormat()) > 0)
             {
                 clearParams.clearStencil = true;
             }
@@ -2843,9 +2843,9 @@
 {
     gl::Framebuffer *framebuffer = getReadFramebuffer();
 
-    bool isSized = IsSizedInternalFormat(format, mClientVersion);
-    GLenum sizedInternalFormat = (isSized ? format : GetSizedInternalFormat(format, type, mClientVersion));
-    GLuint outputPitch = GetRowPitch(sizedInternalFormat, type, mClientVersion, width, mState.pack.alignment);
+    bool isSized = IsSizedInternalFormat(format);
+    GLenum sizedInternalFormat = (isSized ? format : GetSizedInternalFormat(format, type));
+    GLuint outputPitch = GetRowPitch(sizedInternalFormat, type, width, mState.pack.alignment);
 
     mRenderer->readPixels(framebuffer, x, y, width, height, format, type, outputPitch, mState.pack, pixels);
 }
@@ -3208,8 +3208,8 @@
     ASSERT(attachment);
 
     *internalFormat = attachment->getActualFormat();
-    *format = gl::GetFormat(attachment->getActualFormat(), mClientVersion);
-    *type = gl::GetType(attachment->getActualFormat(), mClientVersion);
+    *format = gl::GetFormat(attachment->getActualFormat());
+    *type = gl::GetType(attachment->getActualFormat());
 }
 
 void Context::detachBuffer(GLuint buffer)
diff --git a/src/libGLESv2/Framebuffer.cpp b/src/libGLESv2/Framebuffer.cpp
index a69bf7a..b220f1d 100644
--- a/src/libGLESv2/Framebuffer.cpp
+++ b/src/libGLESv2/Framebuffer.cpp
@@ -157,8 +157,7 @@
     SafeDelete(mStencilbuffer);
 
     // ensure this is a legitimate depth+stencil format
-    int clientVersion = mRenderer->getCurrentClientVersion();
-    if (attachment && attachment->getDepthSize(clientVersion) > 0 && attachment->getStencilSize(clientVersion) > 0)
+    if (attachment && attachment->getDepthSize() > 0 && attachment->getStencilSize() > 0)
     {
         mDepthbuffer = attachment;
         mStencilbuffer = attachment;
@@ -383,13 +382,7 @@
 
 bool Framebuffer::hasStencil() const
 {
-    if (mStencilbuffer)
-    {
-        int clientVersion = mRenderer->getCurrentClientVersion();
-        return (mStencilbuffer->getStencilSize(clientVersion) > 0);
-    }
-
-    return false;
+    return (mStencilbuffer && mStencilbuffer->getStencilSize() > 0);
 }
 
 bool Framebuffer::usingExtendedDrawBuffers() const
@@ -434,8 +427,8 @@
                     return GL_FRAMEBUFFER_UNSUPPORTED;
                 }
 
-                if (gl::GetDepthBits(internalformat, clientVersion) > 0 ||
-                    gl::GetStencilBits(internalformat, clientVersion) > 0)
+                if (gl::GetDepthBits(internalformat) > 0 ||
+                    gl::GetStencilBits(internalformat) > 0)
                 {
                     return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
                 }
@@ -467,7 +460,7 @@
                 // in GLES 3.0, there is no such restriction
                 if (clientVersion < 3)
                 {
-                    if (gl::GetPixelBytes(colorbuffer->getInternalFormat(), clientVersion) != colorbufferSize)
+                    if (gl::GetPixelBytes(colorbuffer->getInternalFormat()) != colorbufferSize)
                     {
                         return GL_FRAMEBUFFER_UNSUPPORTED;
                     }
@@ -488,7 +481,7 @@
                 width = colorbuffer->getWidth();
                 height = colorbuffer->getHeight();
                 samples = colorbuffer->getSamples();
-                colorbufferSize = gl::GetPixelBytes(colorbuffer->getInternalFormat(), clientVersion);
+                colorbufferSize = gl::GetPixelBytes(colorbuffer->getInternalFormat());
                 missingAttachment = false;
             }
         }
@@ -518,7 +511,7 @@
                 return GL_FRAMEBUFFER_UNSUPPORTED;
             }
 
-            if (gl::GetDepthBits(internalformat, clientVersion) == 0)
+            if (gl::GetDepthBits(internalformat) == 0)
             {
                 return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
             }
@@ -573,7 +566,7 @@
                 return GL_FRAMEBUFFER_UNSUPPORTED;
             }
 
-            if (gl::GetStencilBits(internalformat, clientVersion) == 0)
+            if (gl::GetStencilBits(internalformat) == 0)
             {
                 return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
             }
@@ -622,10 +615,10 @@
 DefaultFramebuffer::DefaultFramebuffer(rx::Renderer *renderer, Colorbuffer *colorbuffer, DepthStencilbuffer *depthStencil)
     : Framebuffer(renderer)
 {
-    Renderbuffer *colorRenderbuffer = new Renderbuffer(mRenderer, 0, colorbuffer);
+    Renderbuffer *colorRenderbuffer = new Renderbuffer(0, colorbuffer);
     mColorbuffers[0] = new RenderbufferAttachment(colorRenderbuffer);
 
-    Renderbuffer *depthStencilRenderbuffer = new Renderbuffer(mRenderer, 0, depthStencil);
+    Renderbuffer *depthStencilRenderbuffer = new Renderbuffer(0, depthStencil);
     FramebufferAttachment *depthStencilAttachment = new RenderbufferAttachment(depthStencilRenderbuffer);
     mDepthbuffer = (depthStencilRenderbuffer->getDepthSize() != 0 ? depthStencilAttachment : NULL);
     mStencilbuffer = (depthStencilRenderbuffer->getStencilSize() != 0 ? depthStencilAttachment : NULL);
diff --git a/src/libGLESv2/FramebufferAttachment.cpp b/src/libGLESv2/FramebufferAttachment.cpp
index c26f07d..d796fed 100644
--- a/src/libGLESv2/FramebufferAttachment.cpp
+++ b/src/libGLESv2/FramebufferAttachment.cpp
@@ -31,86 +31,44 @@
 {
 }
 
-GLuint FramebufferAttachment::getRedSize(int clientVersion) const
+GLuint FramebufferAttachment::getRedSize() const
 {
-    if (gl::GetRedBits(getInternalFormat(), clientVersion) > 0)
-    {
-        return gl::GetRedBits(getActualFormat(), clientVersion);
-    }
-    else
-    {
-        return 0;
-    }
+    return (gl::GetRedBits(getInternalFormat()) > 0) ? gl::GetRedBits(getActualFormat()) : 0;
 }
 
-GLuint FramebufferAttachment::getGreenSize(int clientVersion) const
+GLuint FramebufferAttachment::getGreenSize() const
 {
-    if (gl::GetGreenBits(getInternalFormat(), clientVersion) > 0)
-    {
-        return gl::GetGreenBits(getActualFormat(), clientVersion);
-    }
-    else
-    {
-        return 0;
-    }
+    return (gl::GetGreenBits(getInternalFormat()) > 0) ? gl::GetGreenBits(getActualFormat()) : 0;
 }
 
-GLuint FramebufferAttachment::getBlueSize(int clientVersion) const
+GLuint FramebufferAttachment::getBlueSize() const
 {
-    if (gl::GetBlueBits(getInternalFormat(), clientVersion) > 0)
-    {
-        return gl::GetBlueBits(getActualFormat(), clientVersion);
-    }
-    else
-    {
-        return 0;
-    }
+    return (gl::GetBlueBits(getInternalFormat()) > 0) ? gl::GetBlueBits(getActualFormat()) : 0;
 }
 
-GLuint FramebufferAttachment::getAlphaSize(int clientVersion) const
+GLuint FramebufferAttachment::getAlphaSize() const
 {
-    if (gl::GetAlphaBits(getInternalFormat(), clientVersion) > 0)
-    {
-        return gl::GetAlphaBits(getActualFormat(), clientVersion);
-    }
-    else
-    {
-        return 0;
-    }
+    return (gl::GetAlphaBits(getInternalFormat()) > 0) ? gl::GetAlphaBits(getActualFormat()) : 0;
 }
 
-GLuint FramebufferAttachment::getDepthSize(int clientVersion) const
+GLuint FramebufferAttachment::getDepthSize() const
 {
-    if (gl::GetDepthBits(getInternalFormat(), clientVersion) > 0)
-    {
-        return gl::GetDepthBits(getActualFormat(), clientVersion);
-    }
-    else
-    {
-        return 0;
-    }
+    return (gl::GetDepthBits(getInternalFormat()) > 0) ? gl::GetDepthBits(getActualFormat()) : 0;
 }
 
-GLuint FramebufferAttachment::getStencilSize(int clientVersion) const
+GLuint FramebufferAttachment::getStencilSize() const
 {
-    if (gl::GetStencilBits(getInternalFormat(), clientVersion) > 0)
-    {
-        return gl::GetStencilBits(getActualFormat(), clientVersion);
-    }
-    else
-    {
-        return 0;
-    }
+    return (gl::GetStencilBits(getInternalFormat()) > 0) ? gl::GetStencilBits(getActualFormat()) : 0;
 }
 
-GLenum FramebufferAttachment::getComponentType(int clientVersion) const
+GLenum FramebufferAttachment::getComponentType() const
 {
-    return gl::GetComponentType(getActualFormat(), clientVersion);
+    return gl::GetComponentType(getActualFormat());
 }
 
-GLenum FramebufferAttachment::getColorEncoding(int clientVersion) const
+GLenum FramebufferAttachment::getColorEncoding() const
 {
-    return gl::GetColorEncoding(getActualFormat(), clientVersion);
+    return gl::GetColorEncoding(getActualFormat());
 }
 
 bool FramebufferAttachment::isTexture() const
diff --git a/src/libGLESv2/FramebufferAttachment.h b/src/libGLESv2/FramebufferAttachment.h
index dea2995..18768f9 100644
--- a/src/libGLESv2/FramebufferAttachment.h
+++ b/src/libGLESv2/FramebufferAttachment.h
@@ -43,14 +43,14 @@
     virtual ~FramebufferAttachment();
 
     // Helper methods
-    GLuint getRedSize(int clientVersion) const;
-    GLuint getGreenSize(int clientVersion) const;
-    GLuint getBlueSize(int clientVersion) const;
-    GLuint getAlphaSize(int clientVersion) const;
-    GLuint getDepthSize(int clientVersion) const;
-    GLuint getStencilSize(int clientVersion) const;
-    GLenum getComponentType(int clientVersion) const;
-    GLenum getColorEncoding(int clientVersion) const;
+    GLuint getRedSize() const;
+    GLuint getGreenSize() const;
+    GLuint getBlueSize() const;
+    GLuint getAlphaSize() const;
+    GLuint getDepthSize() const;
+    GLuint getStencilSize() const;
+    GLenum getComponentType() const;
+    GLenum getColorEncoding() const;
     bool isTexture() const;
 
     bool isTextureWithId(GLuint textureId) const { return isTexture() && id() == textureId; }
diff --git a/src/libGLESv2/Renderbuffer.cpp b/src/libGLESv2/Renderbuffer.cpp
index cae1eb8..eee179f 100644
--- a/src/libGLESv2/Renderbuffer.cpp
+++ b/src/libGLESv2/Renderbuffer.cpp
@@ -23,9 +23,8 @@
 {
 unsigned int RenderbufferStorage::mCurrentSerial = 1;
 
-Renderbuffer::Renderbuffer(rx::Renderer *renderer, GLuint id, RenderbufferStorage *newStorage)
+Renderbuffer::Renderbuffer(GLuint id, RenderbufferStorage *newStorage)
   : RefCountObject(id),
-    mRenderer(renderer),
     mStorage(newStorage)
 {
     ASSERT(mStorage);
@@ -77,32 +76,32 @@
 
 GLuint Renderbuffer::getRedSize() const
 {
-    return gl::GetRedBits(getActualFormat(), mRenderer->getCurrentClientVersion());
+    return gl::GetRedBits(getActualFormat());
 }
 
 GLuint Renderbuffer::getGreenSize() const
 {
-    return gl::GetGreenBits(getActualFormat(), mRenderer->getCurrentClientVersion());
+    return gl::GetGreenBits(getActualFormat());
 }
 
 GLuint Renderbuffer::getBlueSize() const
 {
-    return gl::GetBlueBits(getActualFormat(), mRenderer->getCurrentClientVersion());
+    return gl::GetBlueBits(getActualFormat());
 }
 
 GLuint Renderbuffer::getAlphaSize() const
 {
-    return gl::GetAlphaBits(getActualFormat(), mRenderer->getCurrentClientVersion());
+    return gl::GetAlphaBits(getActualFormat());
 }
 
 GLuint Renderbuffer::getDepthSize() const
 {
-    return gl::GetDepthBits(getActualFormat(), mRenderer->getCurrentClientVersion());
+    return gl::GetDepthBits(getActualFormat());
 }
 
 GLuint Renderbuffer::getStencilSize() const
 {
-    return gl::GetStencilBits(getActualFormat(), mRenderer->getCurrentClientVersion());
+    return gl::GetStencilBits(getActualFormat());
 }
 
 RenderbufferStorage::RenderbufferStorage() : mSerial(issueSerials(1))
diff --git a/src/libGLESv2/Renderbuffer.h b/src/libGLESv2/Renderbuffer.h
index fc4d234..a85c3e2 100644
--- a/src/libGLESv2/Renderbuffer.h
+++ b/src/libGLESv2/Renderbuffer.h
@@ -38,7 +38,7 @@
 class Renderbuffer : public RefCountObject
 {
   public:
-    Renderbuffer(rx::Renderer *renderer, GLuint id, RenderbufferStorage *newStorage);
+    Renderbuffer(GLuint id, RenderbufferStorage *newStorage);
 
     void setStorage(RenderbufferStorage *newStorage);
     RenderbufferStorage *getStorage();
@@ -56,7 +56,6 @@
     GLuint getStencilSize() const;
 
   private:
-    rx::Renderer *mRenderer;
     RenderbufferStorage *mStorage;
 };
 
diff --git a/src/libGLESv2/ResourceManager.cpp b/src/libGLESv2/ResourceManager.cpp
index 97c28cb..4a4df65 100644
--- a/src/libGLESv2/ResourceManager.cpp
+++ b/src/libGLESv2/ResourceManager.cpp
@@ -405,7 +405,7 @@
 {
     if (renderbuffer != 0 && !getRenderbuffer(renderbuffer))
     {
-        Renderbuffer *renderbufferObject = new Renderbuffer(mRenderer, renderbuffer, new Colorbuffer(mRenderer, 0, 0, GL_RGBA4, 0));
+        Renderbuffer *renderbufferObject = new Renderbuffer(renderbuffer, new Colorbuffer(mRenderer, 0, 0, GL_RGBA4, 0));
         mRenderbufferMap[renderbuffer] = renderbufferObject;
         renderbufferObject->addRef();
     }
diff --git a/src/libGLESv2/Texture.cpp b/src/libGLESv2/Texture.cpp
index e6744a8..9d37ad9 100644
--- a/src/libGLESv2/Texture.cpp
+++ b/src/libGLESv2/Texture.cpp
@@ -539,9 +539,8 @@
 
 void Texture2D::setImage(GLint level, GLsizei width, GLsizei height, GLenum internalFormat, GLenum format, GLenum type, const PixelUnpackState &unpack, const void *pixels)
 {
-    GLuint clientVersion = mRenderer->getCurrentClientVersion();
-    GLenum sizedInternalFormat = IsSizedInternalFormat(internalFormat, clientVersion) ? internalFormat
-                                                                                      : GetSizedInternalFormat(format, type, clientVersion);
+    GLenum sizedInternalFormat = IsSizedInternalFormat(internalFormat) ? internalFormat
+                                                                       : GetSizedInternalFormat(format, type);
     redefineImage(level, sizedInternalFormat, width, height);
 
     bool fastUnpacked = false;
@@ -658,9 +657,8 @@
 
 void Texture2D::copyImage(GLint level, GLenum format, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source)
 {
-    GLuint clientVersion = mRenderer->getCurrentClientVersion();
-    GLenum sizedInternalFormat = IsSizedInternalFormat(format, clientVersion) ? format
-                                                                              : GetSizedInternalFormat(format, GL_UNSIGNED_BYTE, clientVersion);
+    GLenum sizedInternalFormat = IsSizedInternalFormat(format) ? format
+                                                               : GetSizedInternalFormat(format, GL_UNSIGNED_BYTE);
     redefineImage(level, sizedInternalFormat, width, height);
 
     if (!mImageArray[level]->isRenderableFormat())
@@ -705,8 +703,6 @@
         {
             updateStorageLevel(level);
 
-            GLuint clientVersion = mRenderer->getCurrentClientVersion();
-
             gl::Rectangle sourceRect;
             sourceRect.x = x;
             sourceRect.width = width;
@@ -714,7 +710,7 @@
             sourceRect.height = height;
 
             mRenderer->copyImage(source, sourceRect,
-                                 gl::GetFormat(getBaseLevelInternalFormat(), clientVersion),
+                                 gl::GetFormat(getBaseLevelInternalFormat()),
                                  xoffset, yoffset, mTexStorage, level);
         }
     }
@@ -807,8 +803,7 @@
     // depth and stencil format (see table 3.13), the value of TEXTURE_COMPARE_-
     // MODE is NONE, and either the magnification filter is not NEAREST or the mini-
     // fication filter is neither NEAREST nor NEAREST_MIPMAP_NEAREST.
-    if (gl::GetDepthBits(getInternalFormat(0), mRenderer->getCurrentClientVersion()) > 0 &&
-        mRenderer->getCurrentClientVersion() > 2)
+    if (gl::GetDepthBits(getInternalFormat(0)) > 0 && mRenderer->getCurrentClientVersion() > 2)
     {
         if (mSamplerState.compareMode == GL_NONE)
         {
@@ -885,12 +880,12 @@
 
 bool Texture2D::isCompressed(GLint level) const
 {
-    return IsFormatCompressed(getInternalFormat(level), mRenderer->getCurrentClientVersion());
+    return IsFormatCompressed(getInternalFormat(level));
 }
 
 bool Texture2D::isDepth(GLint level) const
 {
-    return GetDepthBits(getInternalFormat(level), mRenderer->getCurrentClientVersion()) > 0;
+    return GetDepthBits(getInternalFormat(level)) > 0;
 }
 
 // Constructs a native texture resource from the texture images
@@ -1329,12 +1324,12 @@
 
 bool TextureCubeMap::isCompressed(GLenum target, GLint level) const
 {
-    return IsFormatCompressed(getInternalFormat(target, level), mRenderer->getCurrentClientVersion());
+    return IsFormatCompressed(getInternalFormat(target, level));
 }
 
 bool TextureCubeMap::isDepth(GLenum target, GLint level) const
 {
-    return GetDepthBits(getInternalFormat(target, level), mRenderer->getCurrentClientVersion()) > 0;
+    return GetDepthBits(getInternalFormat(target, level)) > 0;
 }
 
 void TextureCubeMap::initializeStorage(bool renderTarget)
@@ -1444,9 +1439,8 @@
 
 void TextureCubeMap::setImage(int faceIndex, GLint level, GLsizei width, GLsizei height, GLenum internalFormat, GLenum format, GLenum type, const PixelUnpackState &unpack, const void *pixels)
 {
-    GLuint clientVersion = mRenderer->getCurrentClientVersion();
-    GLenum sizedInternalFormat = IsSizedInternalFormat(internalFormat, clientVersion) ? internalFormat
-                                                                                      : GetSizedInternalFormat(format, type, clientVersion);
+    GLenum sizedInternalFormat = IsSizedInternalFormat(internalFormat) ? internalFormat
+                                                                       : GetSizedInternalFormat(format, type);
 
     redefineImage(faceIndex, level, sizedInternalFormat, width, height);
 
@@ -1501,9 +1495,8 @@
 void TextureCubeMap::copyImage(GLenum target, GLint level, GLenum format, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source)
 {
     int faceIndex = targetToIndex(target);
-    GLuint clientVersion = mRenderer->getCurrentClientVersion();
-    GLenum sizedInternalFormat = IsSizedInternalFormat(format, clientVersion) ? format
-                                                                              : GetSizedInternalFormat(format, GL_UNSIGNED_BYTE, clientVersion);
+    GLenum sizedInternalFormat = IsSizedInternalFormat(format) ? format
+                                                               : GetSizedInternalFormat(format, GL_UNSIGNED_BYTE);
     redefineImage(faceIndex, level, sizedInternalFormat, width, height);
 
     if (!mImageArray[faceIndex][level]->isRenderableFormat())
@@ -1553,15 +1546,13 @@
         {
             updateStorageFaceLevel(faceIndex, level);
 
-            GLuint clientVersion = mRenderer->getCurrentClientVersion();
-
             gl::Rectangle sourceRect;
             sourceRect.x = x;
             sourceRect.width = width;
             sourceRect.y = y;
             sourceRect.height = height;
 
-            mRenderer->copyImage(source, sourceRect, gl::GetFormat(getBaseLevelInternalFormat(), clientVersion),
+            mRenderer->copyImage(source, sourceRect, gl::GetFormat(getBaseLevelInternalFormat()),
                                  xoffset, yoffset, mTexStorage, target, level);
         }
     }
@@ -1740,19 +1731,18 @@
 
 bool Texture3D::isCompressed(GLint level) const
 {
-    return IsFormatCompressed(getInternalFormat(level), mRenderer->getCurrentClientVersion());
+    return IsFormatCompressed(getInternalFormat(level));
 }
 
 bool Texture3D::isDepth(GLint level) const
 {
-    return GetDepthBits(getInternalFormat(level), mRenderer->getCurrentClientVersion()) > 0;
+    return GetDepthBits(getInternalFormat(level)) > 0;
 }
 
 void Texture3D::setImage(GLint level, GLsizei width, GLsizei height, GLsizei depth, GLenum internalFormat, GLenum format, GLenum type, const PixelUnpackState &unpack, const void *pixels)
 {
-    GLuint clientVersion = mRenderer->getCurrentClientVersion();
-    GLenum sizedInternalFormat = IsSizedInternalFormat(internalFormat, clientVersion) ? internalFormat
-                                                                                      : GetSizedInternalFormat(format, type, clientVersion);
+    GLenum sizedInternalFormat = IsSizedInternalFormat(internalFormat) ? internalFormat
+                                                                       : GetSizedInternalFormat(format, type);
     redefineImage(level, sizedInternalFormat, width, height, depth);
 
     bool fastUnpacked = false;
@@ -1905,10 +1895,8 @@
             sourceRect.y = y;
             sourceRect.height = height;
 
-            GLuint clientVersion = mRenderer->getCurrentClientVersion();
-
             mRenderer->copyImage(source, sourceRect,
-                                 gl::GetFormat(getBaseLevelInternalFormat(), clientVersion),
+                                 gl::GetFormat(getBaseLevelInternalFormat()),
                                  xoffset, yoffset, zoffset, mTexStorage, level);
         }
     }
@@ -2271,22 +2259,21 @@
 
 bool Texture2DArray::isCompressed(GLint level) const
 {
-    return IsFormatCompressed(getInternalFormat(level), mRenderer->getCurrentClientVersion());
+    return IsFormatCompressed(getInternalFormat(level));
 }
 
 bool Texture2DArray::isDepth(GLint level) const
 {
-    return GetDepthBits(getInternalFormat(level), mRenderer->getCurrentClientVersion()) > 0;
+    return GetDepthBits(getInternalFormat(level)) > 0;
 }
 
 void Texture2DArray::setImage(GLint level, GLsizei width, GLsizei height, GLsizei depth, GLenum internalFormat, GLenum format, GLenum type, const PixelUnpackState &unpack, const void *pixels)
 {
-    GLuint clientVersion = mRenderer->getCurrentClientVersion();
-    GLenum sizedInternalFormat = IsSizedInternalFormat(internalFormat, clientVersion) ? internalFormat
-                                                                                      : GetSizedInternalFormat(format, type, clientVersion);
+    GLenum sizedInternalFormat = IsSizedInternalFormat(internalFormat) ? internalFormat
+                                                                       : GetSizedInternalFormat(format, type);
     redefineImage(level, sizedInternalFormat, width, height, depth);
 
-    GLsizei inputDepthPitch = gl::GetDepthPitch(sizedInternalFormat, type, clientVersion, width, height, unpack.alignment);
+    GLsizei inputDepthPitch = gl::GetDepthPitch(sizedInternalFormat, type, width, height, unpack.alignment);
 
     for (int i = 0; i < depth; i++)
     {
@@ -2300,8 +2287,7 @@
     // compressed formats don't have separate sized internal formats-- we can just use the compressed format directly
     redefineImage(level, format, width, height, depth);
 
-    GLuint clientVersion = mRenderer->getCurrentClientVersion();
-    GLsizei inputDepthPitch = gl::GetDepthPitch(format, GL_UNSIGNED_BYTE, clientVersion, width, height, 1);
+    GLsizei inputDepthPitch = gl::GetDepthPitch(format, GL_UNSIGNED_BYTE, width, height, 1);
 
     for (int i = 0; i < depth; i++)
     {
@@ -2313,8 +2299,7 @@
 void Texture2DArray::subImage(GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const PixelUnpackState &unpack, const void *pixels)
 {
     GLenum internalformat = getInternalFormat(level);
-    GLuint clientVersion =  mRenderer->getCurrentClientVersion();
-    GLsizei inputDepthPitch = gl::GetDepthPitch(internalformat, type, clientVersion, width, height, unpack.alignment);
+    GLsizei inputDepthPitch = gl::GetDepthPitch(internalformat, type, width, height, unpack.alignment);
 
     for (int i = 0; i < depth; i++)
     {
@@ -2330,8 +2315,7 @@
 
 void Texture2DArray::subImageCompressed(GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *pixels)
 {
-    GLuint clientVersion = mRenderer->getCurrentClientVersion();
-    GLsizei inputDepthPitch = gl::GetDepthPitch(format, GL_UNSIGNED_BYTE, clientVersion, width, height, 1);
+    GLsizei inputDepthPitch = gl::GetDepthPitch(format, GL_UNSIGNED_BYTE, width, height, 1);
 
     for (int i = 0; i < depth; i++)
     {
@@ -2441,15 +2425,13 @@
         {
             updateStorageLevel(level);
 
-            GLuint clientVersion = mRenderer->getCurrentClientVersion();
-
             gl::Rectangle sourceRect;
             sourceRect.x = x;
             sourceRect.width = width;
             sourceRect.y = y;
             sourceRect.height = height;
 
-            mRenderer->copyImage(source, sourceRect, gl::GetFormat(getInternalFormat(0), clientVersion),
+            mRenderer->copyImage(source, sourceRect, gl::GetFormat(getInternalFormat(0)),
                                  xoffset, yoffset, zoffset, mTexStorage, level);
         }
     }
diff --git a/src/libGLESv2/formatutils.cpp b/src/libGLESv2/formatutils.cpp
index ed6e05f..82fced5 100644
--- a/src/libGLESv2/formatutils.cpp
+++ b/src/libGLESv2/formatutils.cpp
@@ -42,67 +42,7 @@
     map->insert(FormatPair(FormatTypePair(format, type), FormatTypeInfo(internalFormat, writeFunc)));
 }
 
-FormatMap BuildES2FormatMap()
-{
-    FormatMap map;
-
-    using namespace rx;
-
-    //                       | Format                            | Type                             | Internal format                   | Color write function             |
-    InsertFormatMapping(&map, GL_ALPHA,                           GL_UNSIGNED_BYTE,                  GL_ALPHA8_EXT,                      WriteColor<A8, GLfloat>           );
-    InsertFormatMapping(&map, GL_ALPHA,                           GL_FLOAT,                          GL_ALPHA32F_EXT,                    WriteColor<A32F, GLfloat>         );
-    InsertFormatMapping(&map, GL_ALPHA,                           GL_HALF_FLOAT_OES,                 GL_ALPHA16F_EXT,                    WriteColor<A16F, GLfloat>         );
-
-    InsertFormatMapping(&map, GL_LUMINANCE,                       GL_UNSIGNED_BYTE,                  GL_LUMINANCE8_EXT,                  WriteColor<L8, GLfloat>           );
-    InsertFormatMapping(&map, GL_LUMINANCE,                       GL_FLOAT,                          GL_LUMINANCE32F_EXT,                WriteColor<L32F, GLfloat>         );
-    InsertFormatMapping(&map, GL_LUMINANCE,                       GL_HALF_FLOAT_OES,                 GL_LUMINANCE16F_EXT,                WriteColor<L16F, GLfloat>         );
-
-    InsertFormatMapping(&map, GL_LUMINANCE_ALPHA,                 GL_UNSIGNED_BYTE,                  GL_LUMINANCE8_ALPHA8_EXT,           WriteColor<L8A8, GLfloat>         );
-    InsertFormatMapping(&map, GL_LUMINANCE_ALPHA,                 GL_FLOAT,                          GL_LUMINANCE_ALPHA32F_EXT,          WriteColor<L32A32F, GLfloat>      );
-    InsertFormatMapping(&map, GL_LUMINANCE_ALPHA,                 GL_HALF_FLOAT_OES,                 GL_LUMINANCE_ALPHA16F_EXT,          WriteColor<L16A16F, GLfloat>      );
-
-    InsertFormatMapping(&map, GL_RED,                             GL_UNSIGNED_BYTE,                  GL_R8_EXT,                          WriteColor<R8, GLfloat>           );
-    InsertFormatMapping(&map, GL_RED,                             GL_FLOAT,                          GL_R32F_EXT,                        WriteColor<R32F, GLfloat>         );
-    InsertFormatMapping(&map, GL_RED,                             GL_HALF_FLOAT_OES,                 GL_R16F_EXT,                        WriteColor<R16F, GLfloat>         );
-
-    InsertFormatMapping(&map, GL_RG,                              GL_UNSIGNED_BYTE,                  GL_RG8_EXT,                         WriteColor<R8G8, GLfloat>         );
-    InsertFormatMapping(&map, GL_RG,                              GL_FLOAT,                          GL_RG32F_EXT,                       WriteColor<R32G32F, GLfloat>      );
-    InsertFormatMapping(&map, GL_RG,                              GL_HALF_FLOAT_OES,                 GL_RG16F_EXT,                       WriteColor<R16G16F, GLfloat>      );
-
-    InsertFormatMapping(&map, GL_RGB,                             GL_UNSIGNED_BYTE,                  GL_RGB8_OES,                        WriteColor<R8G8B8, GLfloat>       );
-    InsertFormatMapping(&map, GL_RGB,                             GL_UNSIGNED_SHORT_5_6_5,           GL_RGB565,                          WriteColor<R5G6B5, GLfloat>       );
-    InsertFormatMapping(&map, GL_RGB,                             GL_FLOAT,                          GL_RGB32F_EXT,                      WriteColor<R32G32B32F, GLfloat>   );
-    InsertFormatMapping(&map, GL_RGB,                             GL_HALF_FLOAT_OES,                 GL_RGB16F_EXT,                      WriteColor<R16G16B16F, GLfloat>   );
-
-    InsertFormatMapping(&map, GL_RGBA,                            GL_UNSIGNED_BYTE,                  GL_RGBA8_OES,                       WriteColor<R8G8B8A8, GLfloat>     );
-    InsertFormatMapping(&map, GL_RGBA,                            GL_UNSIGNED_SHORT_4_4_4_4,         GL_RGBA4,                           WriteColor<R4G4B4A4, GLfloat>     );
-    InsertFormatMapping(&map, GL_RGBA,                            GL_UNSIGNED_SHORT_5_5_5_1,         GL_RGB5_A1,                         WriteColor<R5G5B5A1, GLfloat>     );
-    InsertFormatMapping(&map, GL_RGBA,                            GL_FLOAT,                          GL_RGBA32F_EXT,                     WriteColor<R32G32B32A32F, GLfloat>);
-    InsertFormatMapping(&map, GL_RGBA,                            GL_HALF_FLOAT_OES,                 GL_RGBA16F_EXT,                     WriteColor<R16G16B16A16F, GLfloat>);
-
-    InsertFormatMapping(&map, GL_SRGB_EXT,                        GL_UNSIGNED_BYTE,                  GL_SRGB8,                           WriteColor<R8G8B8, GLfloat>        );
-    InsertFormatMapping(&map, GL_SRGB_ALPHA_EXT,                  GL_UNSIGNED_BYTE,                  GL_SRGB8_ALPHA8,                    WriteColor<R8G8B8A8, GLfloat>      );
-
-    InsertFormatMapping(&map, GL_BGRA_EXT,                        GL_UNSIGNED_BYTE,                  GL_BGRA8_EXT,                       WriteColor<B8G8R8A8, GLfloat>     );
-    InsertFormatMapping(&map, GL_BGRA_EXT,                        GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT, GL_BGRA4_ANGLEX,                    WriteColor<B4G4R4A4, GLfloat>     );
-    InsertFormatMapping(&map, GL_BGRA_EXT,                        GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT, GL_BGR5_A1_ANGLEX,                  WriteColor<B5G5R5A1, GLfloat>     );
-
-    InsertFormatMapping(&map, GL_COMPRESSED_RGB_S3TC_DXT1_EXT,    GL_UNSIGNED_BYTE,                  GL_COMPRESSED_RGB_S3TC_DXT1_EXT,    NULL                              );
-    InsertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,   GL_UNSIGNED_BYTE,                  GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,   NULL                              );
-    InsertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, GL_UNSIGNED_BYTE,                  GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, NULL                              );
-    InsertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, GL_UNSIGNED_BYTE,                  GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, NULL                              );
-
-    InsertFormatMapping(&map, GL_DEPTH_COMPONENT,                 GL_UNSIGNED_SHORT,                 GL_DEPTH_COMPONENT16,               NULL                              );
-    InsertFormatMapping(&map, GL_DEPTH_COMPONENT,                 GL_UNSIGNED_INT,                   GL_DEPTH_COMPONENT32_OES,           NULL                              );
-
-    InsertFormatMapping(&map, GL_STENCIL,                         GL_UNSIGNED_BYTE,                  GL_STENCIL_INDEX8,                  NULL                              );
-
-    InsertFormatMapping(&map, GL_DEPTH_STENCIL_OES,               GL_UNSIGNED_INT_24_8_OES,          GL_DEPTH24_STENCIL8_OES,            NULL                              );
-
-    return map;
-}
-
-FormatMap BuildES3FormatMap()
+FormatMap BuildFormatMap()
 {
     FormatMap map;
 
@@ -116,6 +56,7 @@
     InsertFormatMapping(&map, GL_RGBA,               GL_UNSIGNED_INT_2_10_10_10_REV,    GL_RGB10_A2,               WriteColor<R10G10B10A2, GLfloat>  );
     InsertFormatMapping(&map, GL_RGBA,               GL_FLOAT,                          GL_RGBA32F,                WriteColor<R32G32B32A32F, GLfloat>);
     InsertFormatMapping(&map, GL_RGBA,               GL_HALF_FLOAT,                     GL_RGBA16F,                WriteColor<R16G16B16A16F, GLfloat>);
+    InsertFormatMapping(&map, GL_RGBA,               GL_HALF_FLOAT_OES,                 GL_RGBA16F,                WriteColor<R16G16B16A16F, GLfloat>);
 
     InsertFormatMapping(&map, GL_RGBA_INTEGER,       GL_UNSIGNED_BYTE,                  GL_RGBA8UI,                WriteColor<R8G8B8A8, GLuint>      );
     InsertFormatMapping(&map, GL_RGBA_INTEGER,       GL_BYTE,                           GL_RGBA8I,                 WriteColor<R8G8B8A8S, GLint>      );
@@ -132,6 +73,7 @@
     InsertFormatMapping(&map, GL_RGB,                GL_UNSIGNED_INT_5_9_9_9_REV,       GL_RGB9_E5,                WriteColor<R9G9B9E5, GLfloat>     );
     InsertFormatMapping(&map, GL_RGB,                GL_FLOAT,                          GL_RGB32F,                 WriteColor<R32G32B32F, GLfloat>   );
     InsertFormatMapping(&map, GL_RGB,                GL_HALF_FLOAT,                     GL_RGB16F,                 WriteColor<R16G16B16F, GLfloat>   );
+    InsertFormatMapping(&map, GL_RGB,                GL_HALF_FLOAT_OES,                 GL_RGB16F,                 WriteColor<R16G16B16F, GLfloat>   );
 
     InsertFormatMapping(&map, GL_RGB_INTEGER,        GL_UNSIGNED_BYTE,                  GL_RGB8UI,                 WriteColor<R8G8B8, GLuint>        );
     InsertFormatMapping(&map, GL_RGB_INTEGER,        GL_BYTE,                           GL_RGB8I,                  WriteColor<R8G8B8S, GLint>        );
@@ -144,6 +86,7 @@
     InsertFormatMapping(&map, GL_RG,                 GL_BYTE,                           GL_RG8_SNORM,              WriteColor<R8G8S, GLfloat>        );
     InsertFormatMapping(&map, GL_RG,                 GL_FLOAT,                          GL_RG32F,                  WriteColor<R32G32F, GLfloat>      );
     InsertFormatMapping(&map, GL_RG,                 GL_HALF_FLOAT,                     GL_RG16F,                  WriteColor<R16G16F, GLfloat>      );
+    InsertFormatMapping(&map, GL_RG,                 GL_HALF_FLOAT_OES,                 GL_RG16F,                  WriteColor<R16G16F, GLfloat>      );
 
     InsertFormatMapping(&map, GL_RG_INTEGER,         GL_UNSIGNED_BYTE,                  GL_RG8UI,                  WriteColor<R8G8, GLuint>          );
     InsertFormatMapping(&map, GL_RG_INTEGER,         GL_BYTE,                           GL_RG8I,                   WriteColor<R8G8S, GLint>          );
@@ -156,6 +99,7 @@
     InsertFormatMapping(&map, GL_RED,                GL_BYTE,                           GL_R8_SNORM,               WriteColor<R8S, GLfloat>          );
     InsertFormatMapping(&map, GL_RED,                GL_FLOAT,                          GL_R32F,                   WriteColor<R32F, GLfloat>         );
     InsertFormatMapping(&map, GL_RED,                GL_HALF_FLOAT,                     GL_R16F,                   WriteColor<R16F, GLfloat>         );
+    InsertFormatMapping(&map, GL_RED,                GL_HALF_FLOAT_OES,                 GL_R16F,                   WriteColor<R16F, GLfloat>         );
 
     InsertFormatMapping(&map, GL_RED_INTEGER,        GL_UNSIGNED_BYTE,                  GL_R8UI,                   WriteColor<R8, GLuint>            );
     InsertFormatMapping(&map, GL_RED_INTEGER,        GL_BYTE,                           GL_R8I,                    WriteColor<R8S, GLint>            );
@@ -171,8 +115,11 @@
     InsertFormatMapping(&map, GL_LUMINANCE,          GL_FLOAT,                          GL_LUMINANCE32F_EXT,       WriteColor<L32F, GLfloat>         );
     InsertFormatMapping(&map, GL_ALPHA,              GL_FLOAT,                          GL_ALPHA32F_EXT,           WriteColor<A32F, GLfloat>         );
     InsertFormatMapping(&map, GL_LUMINANCE_ALPHA,    GL_HALF_FLOAT,                     GL_LUMINANCE_ALPHA16F_EXT, WriteColor<L16A16F, GLfloat>      );
+    InsertFormatMapping(&map, GL_LUMINANCE_ALPHA,    GL_HALF_FLOAT_OES,                 GL_LUMINANCE_ALPHA16F_EXT, WriteColor<L16A16F, GLfloat>      );
     InsertFormatMapping(&map, GL_LUMINANCE,          GL_HALF_FLOAT,                     GL_LUMINANCE16F_EXT,       WriteColor<L16F, GLfloat>         );
+    InsertFormatMapping(&map, GL_LUMINANCE,          GL_HALF_FLOAT_OES,                 GL_LUMINANCE16F_EXT,       WriteColor<L16F, GLfloat>         );
     InsertFormatMapping(&map, GL_ALPHA,              GL_HALF_FLOAT,                     GL_ALPHA16F_EXT,           WriteColor<A16F, GLfloat>         );
+    InsertFormatMapping(&map, GL_ALPHA,              GL_HALF_FLOAT_OES,                 GL_ALPHA16F_EXT,           WriteColor<A16F, GLfloat>         );
 
     InsertFormatMapping(&map, GL_BGRA_EXT,           GL_UNSIGNED_BYTE,                  GL_BGRA8_EXT,              WriteColor<B8G8R8A8, GLfloat>     );
     InsertFormatMapping(&map, GL_BGRA_EXT,           GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT, GL_BGRA4_ANGLEX,           WriteColor<B4G4R4A4, GLfloat>     );
@@ -187,33 +134,21 @@
     InsertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, GL_UNSIGNED_BYTE,     GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, NULL                     );
 
     InsertFormatMapping(&map, GL_DEPTH_COMPONENT,    GL_UNSIGNED_SHORT,                 GL_DEPTH_COMPONENT16,      NULL                              );
-    InsertFormatMapping(&map, GL_DEPTH_COMPONENT,    GL_UNSIGNED_INT,                   GL_DEPTH_COMPONENT24,      NULL                              );
+    InsertFormatMapping(&map, GL_DEPTH_COMPONENT,    GL_UNSIGNED_INT,                   GL_DEPTH_COMPONENT32_OES,  NULL                              );
     InsertFormatMapping(&map, GL_DEPTH_COMPONENT,    GL_FLOAT,                          GL_DEPTH_COMPONENT32F,     NULL                              );
 
+    InsertFormatMapping(&map, GL_STENCIL,            GL_UNSIGNED_BYTE,                  GL_STENCIL_INDEX8,         NULL                              );
+
     InsertFormatMapping(&map, GL_DEPTH_STENCIL,      GL_UNSIGNED_INT_24_8,              GL_DEPTH24_STENCIL8,       NULL                              );
     InsertFormatMapping(&map, GL_DEPTH_STENCIL,      GL_FLOAT_32_UNSIGNED_INT_24_8_REV, GL_DEPTH32F_STENCIL8,      NULL                              );
 
     return map;
 }
 
-static const FormatMap &GetFormatMap(GLuint clientVersion)
+static const FormatMap &GetFormatMap()
 {
-    if (clientVersion == 2)
-    {
-        static const FormatMap formats = BuildES2FormatMap();
-        return formats;
-    }
-    else if (clientVersion == 3)
-    {
-        static const FormatMap formats = BuildES3FormatMap();
-        return formats;
-    }
-    else
-    {
-        UNREACHABLE();
-        static FormatMap emptyMap;
-        return emptyMap;
-    }
+     static const FormatMap formatMap = BuildFormatMap();
+     return formatMap;
 }
 
 struct FormatInfo
@@ -252,6 +187,7 @@
     set.insert(FormatInfo(GL_RGB5_A1,            GL_RGBA,            GL_UNSIGNED_INT_2_10_10_10_REV   ));
     set.insert(FormatInfo(GL_RGB5_A1,            GL_RGBA,            GL_UNSIGNED_SHORT_5_5_5_1        ));
     set.insert(FormatInfo(GL_RGBA16F,            GL_RGBA,            GL_HALF_FLOAT                    ));
+    set.insert(FormatInfo(GL_RGBA16F,            GL_RGBA,            GL_HALF_FLOAT_OES                ));
     set.insert(FormatInfo(GL_RGBA32F,            GL_RGBA,            GL_FLOAT                         ));
     set.insert(FormatInfo(GL_RGBA16F,            GL_RGBA,            GL_FLOAT                         ));
     set.insert(FormatInfo(GL_RGBA8UI,            GL_RGBA_INTEGER,    GL_UNSIGNED_BYTE                 ));
@@ -269,8 +205,11 @@
     set.insert(FormatInfo(GL_R11F_G11F_B10F,     GL_RGB,             GL_UNSIGNED_INT_10F_11F_11F_REV  ));
     set.insert(FormatInfo(GL_RGB9_E5,            GL_RGB,             GL_UNSIGNED_INT_5_9_9_9_REV      ));
     set.insert(FormatInfo(GL_RGB16F,             GL_RGB,             GL_HALF_FLOAT                    ));
+    set.insert(FormatInfo(GL_RGB16F,             GL_RGB,             GL_HALF_FLOAT_OES                ));
     set.insert(FormatInfo(GL_R11F_G11F_B10F,     GL_RGB,             GL_HALF_FLOAT                    ));
+    set.insert(FormatInfo(GL_R11F_G11F_B10F,     GL_RGB,             GL_HALF_FLOAT_OES                ));
     set.insert(FormatInfo(GL_RGB9_E5,            GL_RGB,             GL_HALF_FLOAT                    ));
+    set.insert(FormatInfo(GL_RGB9_E5,            GL_RGB,             GL_HALF_FLOAT_OES                ));
     set.insert(FormatInfo(GL_RGB32F,             GL_RGB,             GL_FLOAT                         ));
     set.insert(FormatInfo(GL_RGB16F,             GL_RGB,             GL_FLOAT                         ));
     set.insert(FormatInfo(GL_R11F_G11F_B10F,     GL_RGB,             GL_FLOAT                         ));
@@ -284,6 +223,7 @@
     set.insert(FormatInfo(GL_RG8,                GL_RG,              GL_UNSIGNED_BYTE                 ));
     set.insert(FormatInfo(GL_RG8_SNORM,          GL_RG,              GL_BYTE                          ));
     set.insert(FormatInfo(GL_RG16F,              GL_RG,              GL_HALF_FLOAT                    ));
+    set.insert(FormatInfo(GL_RG16F,              GL_RG,              GL_HALF_FLOAT_OES                ));
     set.insert(FormatInfo(GL_RG32F,              GL_RG,              GL_FLOAT                         ));
     set.insert(FormatInfo(GL_RG16F,              GL_RG,              GL_FLOAT                         ));
     set.insert(FormatInfo(GL_RG8UI,              GL_RG_INTEGER,      GL_UNSIGNED_BYTE                 ));
@@ -295,6 +235,7 @@
     set.insert(FormatInfo(GL_R8,                 GL_RED,             GL_UNSIGNED_BYTE                 ));
     set.insert(FormatInfo(GL_R8_SNORM,           GL_RED,             GL_BYTE                          ));
     set.insert(FormatInfo(GL_R16F,               GL_RED,             GL_HALF_FLOAT                    ));
+    set.insert(FormatInfo(GL_R16F,               GL_RED,             GL_HALF_FLOAT_OES                ));
     set.insert(FormatInfo(GL_R32F,               GL_RED,             GL_FLOAT                         ));
     set.insert(FormatInfo(GL_R16F,               GL_RED,             GL_FLOAT                         ));
     set.insert(FormatInfo(GL_R8UI,               GL_RED_INTEGER,     GL_UNSIGNED_BYTE                 ));
@@ -335,8 +276,11 @@
 
     // From GL_OES_texture_half_float
     set.insert(FormatInfo(GL_LUMINANCE_ALPHA,    GL_LUMINANCE_ALPHA, GL_HALF_FLOAT                    ));
+    set.insert(FormatInfo(GL_LUMINANCE_ALPHA,    GL_LUMINANCE_ALPHA, GL_HALF_FLOAT_OES                ));
     set.insert(FormatInfo(GL_LUMINANCE,          GL_LUMINANCE,       GL_HALF_FLOAT                    ));
+    set.insert(FormatInfo(GL_LUMINANCE,          GL_LUMINANCE,       GL_HALF_FLOAT_OES                ));
     set.insert(FormatInfo(GL_ALPHA,              GL_ALPHA,           GL_HALF_FLOAT                    ));
+    set.insert(FormatInfo(GL_ALPHA,              GL_ALPHA,           GL_HALF_FLOAT_OES                ));
 
     // From GL_EXT_texture_format_BGRA8888
     set.insert(FormatInfo(GL_BGRA_EXT,           GL_BGRA_EXT,        GL_UNSIGNED_BYTE                 ));
@@ -351,8 +295,11 @@
     set.insert(FormatInfo(GL_LUMINANCE32F_EXT,       GL_LUMINANCE,       GL_FLOAT                         ));
     set.insert(FormatInfo(GL_LUMINANCE_ALPHA32F_EXT, GL_LUMINANCE_ALPHA, GL_FLOAT                         ));
     set.insert(FormatInfo(GL_ALPHA16F_EXT,           GL_ALPHA,           GL_HALF_FLOAT                    ));
+    set.insert(FormatInfo(GL_ALPHA16F_EXT,           GL_ALPHA,           GL_HALF_FLOAT_OES                ));
     set.insert(FormatInfo(GL_LUMINANCE16F_EXT,       GL_LUMINANCE,       GL_HALF_FLOAT                    ));
+    set.insert(FormatInfo(GL_LUMINANCE16F_EXT,       GL_LUMINANCE,       GL_HALF_FLOAT_OES                ));
     set.insert(FormatInfo(GL_LUMINANCE_ALPHA16F_EXT, GL_LUMINANCE_ALPHA, GL_HALF_FLOAT                    ));
+    set.insert(FormatInfo(GL_LUMINANCE_ALPHA16F_EXT, GL_LUMINANCE_ALPHA, GL_HALF_FLOAT_OES                ));
 
     // From GL_EXT_texture_storage and GL_EXT_texture_format_BGRA8888
     set.insert(FormatInfo(GL_BGRA8_EXT,              GL_BGRA_EXT,        GL_UNSIGNED_BYTE                 ));
@@ -468,39 +415,54 @@
 }
 
 // Information about internal formats
-typedef bool (*SupportCheckFunction)(const Extensions &);
+typedef bool(*SupportCheckFunction)(GLuint, const Extensions &);
 
-static bool AlwaysSupported(const Extensions &)
-{
-    return true;
-}
-
-static bool UnimplementedSupport(const Extensions &)
+static bool UnimplementedSupport(GLuint clientVersion, const Extensions &)
 {
     UNIMPLEMENTED();
     return false;
 }
 
-static bool NeverSupported(const Extensions &)
+static bool NeverSupported(GLuint clientVersion, const Extensions &)
 {
     return false;
 }
 
+template <GLuint minCoreGLVersion>
+static bool RequireESVersion(GLuint clientVersion, const Extensions &)
+{
+    return clientVersion >= minCoreGLVersion;
+}
+
 // Pointer to a boolean memeber of the Extensions struct
 typedef bool(Extensions::*ExtensionBool);
 
 // Check support for a single extension
 template <ExtensionBool bool1>
-static bool CheckSupport(const Extensions &caps)
+static bool RequireExtension(GLuint, const Extensions & extensions)
 {
-    return (caps.*bool1);
+    return extensions.*bool1;
+}
+
+// Check for a minimum client version or a single extension
+template <GLuint minCoreGLVersion, ExtensionBool bool1>
+static bool RequireESVersionOrExtension(GLuint clientVersion, const Extensions &extensions)
+{
+    return clientVersion >= minCoreGLVersion || extensions.*bool1;
+}
+
+// Check for a minimum client version or two extensions
+template <GLuint minCoreGLVersion, ExtensionBool bool1, ExtensionBool bool2>
+static bool RequireESVersionOrExtensions(GLuint clientVersion, const Extensions &extensions)
+{
+    return clientVersion >= minCoreGLVersion || (extensions.*bool1 || extensions.*bool2);
 }
 
 // Check support for two extensions
 template <ExtensionBool bool1, ExtensionBool bool2>
-static bool CheckSupport(const Extensions &caps)
+static bool RequireExtensions(GLuint, const Extensions &extensions)
 {
-    return (caps.*bool1) && (caps.*bool2);
+    return extensions.*bool1 || extensions.*bool2;
 }
 
 struct InternalFormatInfo
@@ -622,110 +584,112 @@
 typedef std::pair<GLenum, InternalFormatInfo> InternalFormatInfoPair;
 typedef std::map<GLenum, InternalFormatInfo> InternalFormatInfoMap;
 
-static InternalFormatInfoMap BuildES3InternalFormatInfoMap()
+static InternalFormatInfoMap BuildInternalFormatInfoMap()
 {
     InternalFormatInfoMap map;
 
     // From ES 3.0.1 spec, table 3.12
     map.insert(InternalFormatInfoPair(GL_NONE,              InternalFormatInfo()));
 
-    //                               | Internal format     |                              | R | G | B | A |S | Format         | Type                           | Component type        | SRGB | Supported     |
-    map.insert(InternalFormatInfoPair(GL_R8,                InternalFormatInfo::RGBAFormat( 8,  0,  0,  0, 0, GL_RED,          GL_UNSIGNED_BYTE,                GL_UNSIGNED_NORMALIZED, false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_R8_SNORM,          InternalFormatInfo::RGBAFormat( 8,  0,  0,  0, 0, GL_RED,          GL_BYTE,                         GL_SIGNED_NORMALIZED,   false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RG8,               InternalFormatInfo::RGBAFormat( 8,  8,  0,  0, 0, GL_RG,           GL_UNSIGNED_BYTE,                GL_UNSIGNED_NORMALIZED, false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RG8_SNORM,         InternalFormatInfo::RGBAFormat( 8,  8,  0,  0, 0, GL_RG,           GL_BYTE,                         GL_SIGNED_NORMALIZED,   false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGB8,              InternalFormatInfo::RGBAFormat( 8,  8,  8,  0, 0, GL_RGB,          GL_UNSIGNED_BYTE,                GL_UNSIGNED_NORMALIZED, false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGB8_SNORM,        InternalFormatInfo::RGBAFormat( 8,  8,  8,  0, 0, GL_RGB,          GL_BYTE,                         GL_SIGNED_NORMALIZED,   false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGB565,            InternalFormatInfo::RGBAFormat( 5,  6,  5,  0, 0, GL_RGB,          GL_UNSIGNED_SHORT_5_6_5,         GL_UNSIGNED_NORMALIZED, false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGBA4,             InternalFormatInfo::RGBAFormat( 4,  4,  4,  4, 0, GL_RGBA,         GL_UNSIGNED_SHORT_4_4_4_4,       GL_UNSIGNED_NORMALIZED, false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGB5_A1,           InternalFormatInfo::RGBAFormat( 5,  5,  5,  1, 0, GL_RGBA,         GL_UNSIGNED_SHORT_5_5_5_1,       GL_UNSIGNED_NORMALIZED, false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGBA8,             InternalFormatInfo::RGBAFormat( 8,  8,  8,  8, 0, GL_RGBA,         GL_UNSIGNED_BYTE,                GL_UNSIGNED_NORMALIZED, false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGBA8_SNORM,       InternalFormatInfo::RGBAFormat( 8,  8,  8,  8, 0, GL_RGBA,         GL_BYTE,                         GL_SIGNED_NORMALIZED,   false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGB10_A2,          InternalFormatInfo::RGBAFormat(10, 10, 10,  2, 0, GL_RGBA,         GL_UNSIGNED_INT_2_10_10_10_REV,  GL_UNSIGNED_NORMALIZED, false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGB10_A2UI,        InternalFormatInfo::RGBAFormat(10, 10, 10,  2, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT_2_10_10_10_REV,  GL_UNSIGNED_INT,        false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_SRGB8,             InternalFormatInfo::RGBAFormat( 8,  8,  8,  0, 0, GL_RGB,          GL_UNSIGNED_BYTE,                GL_UNSIGNED_NORMALIZED, true,  AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_SRGB8_ALPHA8,      InternalFormatInfo::RGBAFormat( 8,  8,  8,  8, 0, GL_RGBA,         GL_UNSIGNED_BYTE,                GL_UNSIGNED_NORMALIZED, true,  AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_R11F_G11F_B10F,    InternalFormatInfo::RGBAFormat(11, 11, 10,  0, 0, GL_RGB,          GL_UNSIGNED_INT_10F_11F_11F_REV, GL_FLOAT,               false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGB9_E5,           InternalFormatInfo::RGBAFormat( 9,  9,  9,  0, 5, GL_RGB,          GL_UNSIGNED_INT_5_9_9_9_REV,     GL_FLOAT,               false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_R8I,               InternalFormatInfo::RGBAFormat( 8,  0,  0,  0, 0, GL_RED_INTEGER,  GL_BYTE,                         GL_INT,                 false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_R8UI,              InternalFormatInfo::RGBAFormat( 8,  0,  0,  0, 0, GL_RED_INTEGER,  GL_UNSIGNED_BYTE,                GL_UNSIGNED_INT,        false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_R16I,              InternalFormatInfo::RGBAFormat(16,  0,  0,  0, 0, GL_RED_INTEGER,  GL_SHORT,                        GL_INT,                 false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_R16UI,             InternalFormatInfo::RGBAFormat(16,  0,  0,  0, 0, GL_RED_INTEGER,  GL_UNSIGNED_SHORT,               GL_UNSIGNED_INT,        false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_R32I,              InternalFormatInfo::RGBAFormat(32,  0,  0,  0, 0, GL_RED_INTEGER,  GL_INT,                          GL_INT,                 false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_R32UI,             InternalFormatInfo::RGBAFormat(32,  0,  0,  0, 0, GL_RED_INTEGER,  GL_UNSIGNED_INT,                 GL_UNSIGNED_INT,        false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RG8I,              InternalFormatInfo::RGBAFormat( 8,  8,  0,  0, 0, GL_RG_INTEGER,   GL_BYTE,                         GL_INT,                 false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RG8UI,             InternalFormatInfo::RGBAFormat( 8,  8,  0,  0, 0, GL_RG_INTEGER,   GL_UNSIGNED_BYTE,                GL_UNSIGNED_INT,        false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RG16I,             InternalFormatInfo::RGBAFormat(16, 16,  0,  0, 0, GL_RG_INTEGER,   GL_SHORT,                        GL_INT,                 false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RG16UI,            InternalFormatInfo::RGBAFormat(16, 16,  0,  0, 0, GL_RG_INTEGER,   GL_UNSIGNED_SHORT,               GL_UNSIGNED_INT,        false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RG32I,             InternalFormatInfo::RGBAFormat(32, 32,  0,  0, 0, GL_RG_INTEGER,   GL_INT,                          GL_INT,                 false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RG32UI,            InternalFormatInfo::RGBAFormat(32, 32,  0,  0, 0, GL_RG_INTEGER,   GL_UNSIGNED_INT,                 GL_UNSIGNED_INT,        false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGB8I,             InternalFormatInfo::RGBAFormat( 8,  8,  8,  0, 0, GL_RGB_INTEGER,  GL_BYTE,                         GL_INT,                 false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGB8UI,            InternalFormatInfo::RGBAFormat( 8,  8,  8,  0, 0, GL_RGB_INTEGER,  GL_UNSIGNED_BYTE,                GL_UNSIGNED_INT,        false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGB16I,            InternalFormatInfo::RGBAFormat(16, 16, 16,  0, 0, GL_RGB_INTEGER,  GL_SHORT,                        GL_INT,                 false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGB16UI,           InternalFormatInfo::RGBAFormat(16, 16, 16,  0, 0, GL_RGB_INTEGER,  GL_UNSIGNED_SHORT,               GL_UNSIGNED_INT,        false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGB32I,            InternalFormatInfo::RGBAFormat(32, 32, 32,  0, 0, GL_RGB_INTEGER,  GL_INT,                          GL_INT,                 false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGB32UI,           InternalFormatInfo::RGBAFormat(32, 32, 32,  0, 0, GL_RGB_INTEGER,  GL_UNSIGNED_INT,                 GL_UNSIGNED_INT,        false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGBA8I,            InternalFormatInfo::RGBAFormat( 8,  8,  8,  8, 0, GL_RGBA_INTEGER, GL_BYTE,                         GL_INT,                 false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGBA8UI,           InternalFormatInfo::RGBAFormat( 8,  8,  8,  8, 0, GL_RGBA_INTEGER, GL_UNSIGNED_BYTE,                GL_UNSIGNED_INT,        false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGBA16I,           InternalFormatInfo::RGBAFormat(16, 16, 16, 16, 0, GL_RGBA_INTEGER, GL_SHORT,                        GL_INT,                 false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGBA16UI,          InternalFormatInfo::RGBAFormat(16, 16, 16, 16, 0, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT,               GL_UNSIGNED_INT,        false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGBA32I,           InternalFormatInfo::RGBAFormat(32, 32, 32, 32, 0, GL_RGBA_INTEGER, GL_INT,                          GL_INT,                 false, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGBA32UI,          InternalFormatInfo::RGBAFormat(32, 32, 32, 32, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT,                 GL_UNSIGNED_INT,        false, AlwaysSupported)));
+    //                               | Internal format     |                              | R | G | B | A |S | Format         | Type                           | Component type        | SRGB | Supported                             |
+    map.insert(InternalFormatInfoPair(GL_R8,                InternalFormatInfo::RGBAFormat( 8,  0,  0,  0, 0, GL_RED,          GL_UNSIGNED_BYTE,                GL_UNSIGNED_NORMALIZED, false, RequireESVersionOrExtension<3, &Extensions::textureRG>)));
+    map.insert(InternalFormatInfoPair(GL_R8_SNORM,          InternalFormatInfo::RGBAFormat( 8,  0,  0,  0, 0, GL_RED,          GL_BYTE,                         GL_SIGNED_NORMALIZED,   false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_RG8,               InternalFormatInfo::RGBAFormat( 8,  8,  0,  0, 0, GL_RG,           GL_UNSIGNED_BYTE,                GL_UNSIGNED_NORMALIZED, false, RequireESVersionOrExtension<3, &Extensions::textureRG>)));
+    map.insert(InternalFormatInfoPair(GL_RG8_SNORM,         InternalFormatInfo::RGBAFormat( 8,  8,  0,  0, 0, GL_RG,           GL_BYTE,                         GL_SIGNED_NORMALIZED,   false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_RGB8,              InternalFormatInfo::RGBAFormat( 8,  8,  8,  0, 0, GL_RGB,          GL_UNSIGNED_BYTE,                GL_UNSIGNED_NORMALIZED, false, RequireESVersionOrExtension<3, &Extensions::rgb8rgba8>)));
+    map.insert(InternalFormatInfoPair(GL_RGB8_SNORM,        InternalFormatInfo::RGBAFormat( 8,  8,  8,  0, 0, GL_RGB,          GL_BYTE,                         GL_SIGNED_NORMALIZED,   false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_RGB565,            InternalFormatInfo::RGBAFormat( 5,  6,  5,  0, 0, GL_RGB,          GL_UNSIGNED_SHORT_5_6_5,         GL_UNSIGNED_NORMALIZED, false, RequireESVersion<2>                    )));
+    map.insert(InternalFormatInfoPair(GL_RGBA4,             InternalFormatInfo::RGBAFormat( 4,  4,  4,  4, 0, GL_RGBA,         GL_UNSIGNED_SHORT_4_4_4_4,       GL_UNSIGNED_NORMALIZED, false, RequireESVersion<2>                    )));
+    map.insert(InternalFormatInfoPair(GL_RGB5_A1,           InternalFormatInfo::RGBAFormat( 5,  5,  5,  1, 0, GL_RGBA,         GL_UNSIGNED_SHORT_5_5_5_1,       GL_UNSIGNED_NORMALIZED, false, RequireESVersion<2>                    )));
+    map.insert(InternalFormatInfoPair(GL_RGBA8,             InternalFormatInfo::RGBAFormat( 8,  8,  8,  8, 0, GL_RGBA,         GL_UNSIGNED_BYTE,                GL_UNSIGNED_NORMALIZED, false, RequireESVersionOrExtension<3, &Extensions::rgb8rgba8>)));
+    map.insert(InternalFormatInfoPair(GL_RGBA8_SNORM,       InternalFormatInfo::RGBAFormat( 8,  8,  8,  8, 0, GL_RGBA,         GL_BYTE,                         GL_SIGNED_NORMALIZED,   false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_RGB10_A2,          InternalFormatInfo::RGBAFormat(10, 10, 10,  2, 0, GL_RGBA,         GL_UNSIGNED_INT_2_10_10_10_REV,  GL_UNSIGNED_NORMALIZED, false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_RGB10_A2UI,        InternalFormatInfo::RGBAFormat(10, 10, 10,  2, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT_2_10_10_10_REV,  GL_UNSIGNED_INT,        false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_SRGB8,             InternalFormatInfo::RGBAFormat( 8,  8,  8,  0, 0, GL_RGB,          GL_UNSIGNED_BYTE,                GL_UNSIGNED_NORMALIZED, true,  RequireESVersionOrExtension<3, &Extensions::sRGB>)));
+    map.insert(InternalFormatInfoPair(GL_SRGB8_ALPHA8,      InternalFormatInfo::RGBAFormat( 8,  8,  8,  8, 0, GL_RGBA,         GL_UNSIGNED_BYTE,                GL_UNSIGNED_NORMALIZED, true,  RequireESVersionOrExtension<3, &Extensions::sRGB>)));
+    map.insert(InternalFormatInfoPair(GL_R11F_G11F_B10F,    InternalFormatInfo::RGBAFormat(11, 11, 10,  0, 0, GL_RGB,          GL_UNSIGNED_INT_10F_11F_11F_REV, GL_FLOAT,               false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_RGB9_E5,           InternalFormatInfo::RGBAFormat( 9,  9,  9,  0, 5, GL_RGB,          GL_UNSIGNED_INT_5_9_9_9_REV,     GL_FLOAT,               false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_R8I,               InternalFormatInfo::RGBAFormat( 8,  0,  0,  0, 0, GL_RED_INTEGER,  GL_BYTE,                         GL_INT,                 false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_R8UI,              InternalFormatInfo::RGBAFormat( 8,  0,  0,  0, 0, GL_RED_INTEGER,  GL_UNSIGNED_BYTE,                GL_UNSIGNED_INT,        false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_R16I,              InternalFormatInfo::RGBAFormat(16,  0,  0,  0, 0, GL_RED_INTEGER,  GL_SHORT,                        GL_INT,                 false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_R16UI,             InternalFormatInfo::RGBAFormat(16,  0,  0,  0, 0, GL_RED_INTEGER,  GL_UNSIGNED_SHORT,               GL_UNSIGNED_INT,        false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_R32I,              InternalFormatInfo::RGBAFormat(32,  0,  0,  0, 0, GL_RED_INTEGER,  GL_INT,                          GL_INT,                 false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_R32UI,             InternalFormatInfo::RGBAFormat(32,  0,  0,  0, 0, GL_RED_INTEGER,  GL_UNSIGNED_INT,                 GL_UNSIGNED_INT,        false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_RG8I,              InternalFormatInfo::RGBAFormat( 8,  8,  0,  0, 0, GL_RG_INTEGER,   GL_BYTE,                         GL_INT,                 false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_RG8UI,             InternalFormatInfo::RGBAFormat( 8,  8,  0,  0, 0, GL_RG_INTEGER,   GL_UNSIGNED_BYTE,                GL_UNSIGNED_INT,        false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_RG16I,             InternalFormatInfo::RGBAFormat(16, 16,  0,  0, 0, GL_RG_INTEGER,   GL_SHORT,                        GL_INT,                 false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_RG16UI,            InternalFormatInfo::RGBAFormat(16, 16,  0,  0, 0, GL_RG_INTEGER,   GL_UNSIGNED_SHORT,               GL_UNSIGNED_INT,        false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_RG32I,             InternalFormatInfo::RGBAFormat(32, 32,  0,  0, 0, GL_RG_INTEGER,   GL_INT,                          GL_INT,                 false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_RG32UI,            InternalFormatInfo::RGBAFormat(32, 32,  0,  0, 0, GL_RG_INTEGER,   GL_UNSIGNED_INT,                 GL_UNSIGNED_INT,        false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_RGB8I,             InternalFormatInfo::RGBAFormat( 8,  8,  8,  0, 0, GL_RGB_INTEGER,  GL_BYTE,                         GL_INT,                 false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_RGB8UI,            InternalFormatInfo::RGBAFormat( 8,  8,  8,  0, 0, GL_RGB_INTEGER,  GL_UNSIGNED_BYTE,                GL_UNSIGNED_INT,        false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_RGB16I,            InternalFormatInfo::RGBAFormat(16, 16, 16,  0, 0, GL_RGB_INTEGER,  GL_SHORT,                        GL_INT,                 false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_RGB16UI,           InternalFormatInfo::RGBAFormat(16, 16, 16,  0, 0, GL_RGB_INTEGER,  GL_UNSIGNED_SHORT,               GL_UNSIGNED_INT,        false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_RGB32I,            InternalFormatInfo::RGBAFormat(32, 32, 32,  0, 0, GL_RGB_INTEGER,  GL_INT,                          GL_INT,                 false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_RGB32UI,           InternalFormatInfo::RGBAFormat(32, 32, 32,  0, 0, GL_RGB_INTEGER,  GL_UNSIGNED_INT,                 GL_UNSIGNED_INT,        false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_RGBA8I,            InternalFormatInfo::RGBAFormat( 8,  8,  8,  8, 0, GL_RGBA_INTEGER, GL_BYTE,                         GL_INT,                 false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_RGBA8UI,           InternalFormatInfo::RGBAFormat( 8,  8,  8,  8, 0, GL_RGBA_INTEGER, GL_UNSIGNED_BYTE,                GL_UNSIGNED_INT,        false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_RGBA16I,           InternalFormatInfo::RGBAFormat(16, 16, 16, 16, 0, GL_RGBA_INTEGER, GL_SHORT,                        GL_INT,                 false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_RGBA16UI,          InternalFormatInfo::RGBAFormat(16, 16, 16, 16, 0, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT,               GL_UNSIGNED_INT,        false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_RGBA32I,           InternalFormatInfo::RGBAFormat(32, 32, 32, 32, 0, GL_RGBA_INTEGER, GL_INT,                          GL_INT,                 false, RequireESVersion<3>                    )));
+    map.insert(InternalFormatInfoPair(GL_RGBA32UI,          InternalFormatInfo::RGBAFormat(32, 32, 32, 32, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT,                 GL_UNSIGNED_INT,        false, RequireESVersion<3>                    )));
 
-    map.insert(InternalFormatInfoPair(GL_BGRA8_EXT,         InternalFormatInfo::RGBAFormat( 8,  8,  8,  8, 0, GL_BGRA_EXT,     GL_UNSIGNED_BYTE,                  GL_UNSIGNED_NORMALIZED, false, CheckSupport<&Extensions::textureFormatBGRA8888>)));
-    map.insert(InternalFormatInfoPair(GL_BGRA4_ANGLEX,      InternalFormatInfo::RGBAFormat( 4,  4,  4,  4, 0, GL_BGRA_EXT,     GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT, GL_UNSIGNED_NORMALIZED, false, CheckSupport<&Extensions::textureFormatBGRA8888>)));
-    map.insert(InternalFormatInfoPair(GL_BGR5_A1_ANGLEX,    InternalFormatInfo::RGBAFormat( 5,  5,  5,  1, 0, GL_BGRA_EXT,     GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT, GL_UNSIGNED_NORMALIZED, false, CheckSupport<&Extensions::textureFormatBGRA8888>)));
+    map.insert(InternalFormatInfoPair(GL_BGRA8_EXT,         InternalFormatInfo::RGBAFormat( 8,  8,  8,  8, 0, GL_BGRA_EXT,     GL_UNSIGNED_BYTE,                  GL_UNSIGNED_NORMALIZED, false, RequireExtension<&Extensions::textureFormatBGRA8888>)));
+    map.insert(InternalFormatInfoPair(GL_BGRA4_ANGLEX,      InternalFormatInfo::RGBAFormat( 4,  4,  4,  4, 0, GL_BGRA_EXT,     GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT, GL_UNSIGNED_NORMALIZED, false, RequireExtension<&Extensions::textureFormatBGRA8888>)));
+    map.insert(InternalFormatInfoPair(GL_BGR5_A1_ANGLEX,    InternalFormatInfo::RGBAFormat( 5,  5,  5,  1, 0, GL_BGRA_EXT,     GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT, GL_UNSIGNED_NORMALIZED, false, RequireExtension<&Extensions::textureFormatBGRA8888>)));
 
     // Floating point renderability and filtering is provided by OES_texture_float and OES_texture_half_float
-    //                               | Internal format        |                                   | D |S | Format             | Type                           | Comp   | SRGB | Supported                                      |
-    //                               |                        |                                   |   |  |                    |                                | type   |      |                                                |
-    map.insert(InternalFormatInfoPair(GL_R16F,              InternalFormatInfo::RGBAFormat(16,  0,  0,  0, 0, GL_RED,          GL_HALF_FLOAT,                   GL_FLOAT, false, CheckSupport<&Extensions::textureHalfFloat>    )));
-    map.insert(InternalFormatInfoPair(GL_RG16F,             InternalFormatInfo::RGBAFormat(16, 16,  0,  0, 0, GL_RG,           GL_HALF_FLOAT,                   GL_FLOAT, false, CheckSupport<&Extensions::textureHalfFloat>    )));
-    map.insert(InternalFormatInfoPair(GL_RGB16F,            InternalFormatInfo::RGBAFormat(16, 16, 16,  0, 0, GL_RGB,          GL_HALF_FLOAT,                   GL_FLOAT, false, CheckSupport<&Extensions::textureHalfFloat>    )));
-    map.insert(InternalFormatInfoPair(GL_RGBA16F,           InternalFormatInfo::RGBAFormat(16, 16, 16, 16, 0, GL_RGBA,         GL_HALF_FLOAT,                   GL_FLOAT, false, CheckSupport<&Extensions::textureHalfFloat>    )));
-    map.insert(InternalFormatInfoPair(GL_R32F,              InternalFormatInfo::RGBAFormat(32,  0,  0,  0, 0, GL_RED,          GL_FLOAT,                        GL_FLOAT, false, CheckSupport<&Extensions::textureFloat>        )));
-    map.insert(InternalFormatInfoPair(GL_RG32F,             InternalFormatInfo::RGBAFormat(32, 32,  0,  0, 0, GL_RG,           GL_FLOAT,                        GL_FLOAT, false, CheckSupport<&Extensions::textureFloat>        )));
-    map.insert(InternalFormatInfoPair(GL_RGB32F,            InternalFormatInfo::RGBAFormat(32, 32, 32,  0, 0, GL_RGB,          GL_FLOAT,                        GL_FLOAT, false, CheckSupport<&Extensions::textureFloat>        )));
-    map.insert(InternalFormatInfoPair(GL_RGBA32F,           InternalFormatInfo::RGBAFormat(32, 32, 32, 32, 0, GL_RGBA,         GL_FLOAT,                        GL_FLOAT, false, CheckSupport<&Extensions::textureFloat>        )));
+    //                               | Internal format        |                                   | D |S | Format             | Type                           | Comp   | SRGB | Supported                                                                             |
+    //                               |                        |                                   |   |  |                    |                                | type   |      |                                                                                       |
+    map.insert(InternalFormatInfoPair(GL_R16F,              InternalFormatInfo::RGBAFormat(16,  0,  0,  0, 0, GL_RED,          GL_HALF_FLOAT,                   GL_FLOAT, false, RequireESVersionOrExtensions<3, &Extensions::textureHalfFloat, &Extensions::textureRG>)));
+    map.insert(InternalFormatInfoPair(GL_RG16F,             InternalFormatInfo::RGBAFormat(16, 16,  0,  0, 0, GL_RG,           GL_HALF_FLOAT,                   GL_FLOAT, false, RequireESVersionOrExtensions<3, &Extensions::textureHalfFloat, &Extensions::textureRG>)));
+    map.insert(InternalFormatInfoPair(GL_RGB16F,            InternalFormatInfo::RGBAFormat(16, 16, 16,  0, 0, GL_RGB,          GL_HALF_FLOAT,                   GL_FLOAT, false, RequireESVersionOrExtension<3, &Extensions::textureHalfFloat>                         )));
+    map.insert(InternalFormatInfoPair(GL_RGBA16F,           InternalFormatInfo::RGBAFormat(16, 16, 16, 16, 0, GL_RGBA,         GL_HALF_FLOAT,                   GL_FLOAT, false, RequireESVersionOrExtension<3, &Extensions::textureHalfFloat>                         )));
+    map.insert(InternalFormatInfoPair(GL_R32F,              InternalFormatInfo::RGBAFormat(32,  0,  0,  0, 0, GL_RED,          GL_FLOAT,                        GL_FLOAT, false, RequireESVersionOrExtensions<3, &Extensions::textureFloat, &Extensions::textureRG>    )));
+    map.insert(InternalFormatInfoPair(GL_RG32F,             InternalFormatInfo::RGBAFormat(32, 32,  0,  0, 0, GL_RG,           GL_FLOAT,                        GL_FLOAT, false, RequireESVersionOrExtensions<3, &Extensions::textureFloat, &Extensions::textureRG>    )));
+    map.insert(InternalFormatInfoPair(GL_RGB32F,            InternalFormatInfo::RGBAFormat(32, 32, 32,  0, 0, GL_RGB,          GL_FLOAT,                        GL_FLOAT, false, RequireESVersionOrExtension<3, &Extensions::textureFloat>                             )));
+    map.insert(InternalFormatInfoPair(GL_RGBA32F,           InternalFormatInfo::RGBAFormat(32, 32, 32, 32, 0, GL_RGBA,         GL_FLOAT,                        GL_FLOAT, false, RequireESVersionOrExtension<3, &Extensions::textureFloat>                             )));
 
     // Depth stencil formats
     //                               | Internal format         |                                      | D |S | X | Format            | Type                             | Component type        | Supported     |
-    map.insert(InternalFormatInfoPair(GL_DEPTH_COMPONENT16,     InternalFormatInfo::DepthStencilFormat(16, 0,  0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT,                 GL_UNSIGNED_NORMALIZED, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_DEPTH_COMPONENT24,     InternalFormatInfo::DepthStencilFormat(24, 0,  0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT,                   GL_UNSIGNED_NORMALIZED, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_DEPTH_COMPONENT32F,    InternalFormatInfo::DepthStencilFormat(32, 0,  0, GL_DEPTH_COMPONENT, GL_FLOAT,                          GL_FLOAT,               AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_DEPTH_COMPONENT32_OES, InternalFormatInfo::DepthStencilFormat(32, 0,  0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT,                   GL_UNSIGNED_NORMALIZED, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_DEPTH24_STENCIL8,      InternalFormatInfo::DepthStencilFormat(24, 8,  0, GL_DEPTH_STENCIL,   GL_UNSIGNED_INT_24_8,              GL_UNSIGNED_NORMALIZED, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_DEPTH32F_STENCIL8,     InternalFormatInfo::DepthStencilFormat(32, 8, 24, GL_DEPTH_STENCIL,   GL_FLOAT_32_UNSIGNED_INT_24_8_REV, GL_FLOAT,               AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_STENCIL_INDEX8,        InternalFormatInfo::DepthStencilFormat( 0, 8,  0, GL_DEPTH_STENCIL,   GL_UNSIGNED_BYTE,                  GL_UNSIGNED_INT,        AlwaysSupported)));
+    map.insert(InternalFormatInfoPair(GL_DEPTH_COMPONENT16,     InternalFormatInfo::DepthStencilFormat(16, 0,  0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT,                 GL_UNSIGNED_NORMALIZED, RequireESVersion<2>                        )));
+    map.insert(InternalFormatInfoPair(GL_DEPTH_COMPONENT24,     InternalFormatInfo::DepthStencilFormat(24, 0,  0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT,                   GL_UNSIGNED_NORMALIZED, RequireESVersion<3>                        )));
+    map.insert(InternalFormatInfoPair(GL_DEPTH_COMPONENT32F,    InternalFormatInfo::DepthStencilFormat(32, 0,  0, GL_DEPTH_COMPONENT, GL_FLOAT,                          GL_FLOAT,               RequireESVersion<3>                        )));
+    map.insert(InternalFormatInfoPair(GL_DEPTH_COMPONENT32_OES, InternalFormatInfo::DepthStencilFormat(32, 0,  0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT,                   GL_UNSIGNED_NORMALIZED, RequireExtension<&Extensions::depthTextures>)));
+    map.insert(InternalFormatInfoPair(GL_DEPTH24_STENCIL8,      InternalFormatInfo::DepthStencilFormat(24, 8,  0, GL_DEPTH_STENCIL,   GL_UNSIGNED_INT_24_8,              GL_UNSIGNED_NORMALIZED, RequireESVersionOrExtension<2, &Extensions::depthTextures>)));
+    map.insert(InternalFormatInfoPair(GL_DEPTH32F_STENCIL8,     InternalFormatInfo::DepthStencilFormat(32, 8, 24, GL_DEPTH_STENCIL,   GL_FLOAT_32_UNSIGNED_INT_24_8_REV, GL_FLOAT,               RequireESVersion<3>                        )));
+    map.insert(InternalFormatInfoPair(GL_STENCIL_INDEX8,        InternalFormatInfo::DepthStencilFormat( 0, 8,  0, GL_DEPTH_STENCIL,   GL_UNSIGNED_BYTE,                  GL_UNSIGNED_INT,        RequireESVersion<2>                        )));
 
     // Luminance alpha formats
-    //                               | Internal format          |                              | L | A | Format            | Type            | Component type        | Supported                                                              |
-    map.insert(InternalFormatInfoPair(GL_ALPHA8_EXT,             InternalFormatInfo::LUMAFormat( 0,  8, GL_ALPHA,           GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, CheckSupport<&Extensions::textureStorage>                               )));
-    map.insert(InternalFormatInfoPair(GL_LUMINANCE8_EXT,         InternalFormatInfo::LUMAFormat( 8,  0, GL_LUMINANCE,       GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, CheckSupport<&Extensions::textureStorage>                               )));
-    map.insert(InternalFormatInfoPair(GL_ALPHA32F_EXT,           InternalFormatInfo::LUMAFormat( 0, 32, GL_ALPHA,           GL_FLOAT,         GL_FLOAT,               CheckSupport<&Extensions::textureStorage, &Extensions::textureFloat>    )));
-    map.insert(InternalFormatInfoPair(GL_LUMINANCE32F_EXT,       InternalFormatInfo::LUMAFormat(32,  0, GL_LUMINANCE,       GL_FLOAT,         GL_FLOAT,               CheckSupport<&Extensions::textureStorage, &Extensions::textureFloat>    )));
-    map.insert(InternalFormatInfoPair(GL_ALPHA16F_EXT,           InternalFormatInfo::LUMAFormat( 0, 16, GL_ALPHA,           GL_HALF_FLOAT,    GL_FLOAT,               CheckSupport<&Extensions::textureStorage, &Extensions::textureHalfFloat>)));
-    map.insert(InternalFormatInfoPair(GL_LUMINANCE16F_EXT,       InternalFormatInfo::LUMAFormat(16,  0, GL_LUMINANCE,       GL_HALF_FLOAT,    GL_FLOAT,               CheckSupport<&Extensions::textureStorage, &Extensions::textureHalfFloat>)));
-    map.insert(InternalFormatInfoPair(GL_LUMINANCE8_ALPHA8_EXT,  InternalFormatInfo::LUMAFormat( 8,  8, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, CheckSupport<&Extensions::textureStorage>                               )));
-    map.insert(InternalFormatInfoPair(GL_LUMINANCE_ALPHA32F_EXT, InternalFormatInfo::LUMAFormat(32, 32, GL_LUMINANCE_ALPHA, GL_FLOAT,         GL_FLOAT,               CheckSupport<&Extensions::textureStorage, &Extensions::textureFloat>    )));
-    map.insert(InternalFormatInfoPair(GL_LUMINANCE_ALPHA16F_EXT, InternalFormatInfo::LUMAFormat(16, 16, GL_LUMINANCE_ALPHA, GL_HALF_FLOAT,    GL_FLOAT,               CheckSupport<&Extensions::textureStorage, &Extensions::textureHalfFloat>)));
+    //                               | Internal format          |                              | L | A | Format            | Type            | Component type        | Supported                                                                   |
+    map.insert(InternalFormatInfoPair(GL_ALPHA8_EXT,             InternalFormatInfo::LUMAFormat( 0,  8, GL_ALPHA,           GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, RequireExtension<&Extensions::textureStorage>                                )));
+    map.insert(InternalFormatInfoPair(GL_LUMINANCE8_EXT,         InternalFormatInfo::LUMAFormat( 8,  0, GL_LUMINANCE,       GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, RequireExtension<&Extensions::textureStorage>                                )));
+    map.insert(InternalFormatInfoPair(GL_ALPHA32F_EXT,           InternalFormatInfo::LUMAFormat( 0, 32, GL_ALPHA,           GL_FLOAT,         GL_FLOAT,               RequireExtensions<&Extensions::textureStorage, &Extensions::textureFloat>    )));
+    map.insert(InternalFormatInfoPair(GL_LUMINANCE32F_EXT,       InternalFormatInfo::LUMAFormat(32,  0, GL_LUMINANCE,       GL_FLOAT,         GL_FLOAT,               RequireExtensions<&Extensions::textureStorage, &Extensions::textureFloat>    )));
+    map.insert(InternalFormatInfoPair(GL_ALPHA16F_EXT,           InternalFormatInfo::LUMAFormat( 0, 16, GL_ALPHA,           GL_HALF_FLOAT,    GL_FLOAT,               RequireExtensions<&Extensions::textureStorage, &Extensions::textureHalfFloat>)));
+    map.insert(InternalFormatInfoPair(GL_LUMINANCE16F_EXT,       InternalFormatInfo::LUMAFormat(16,  0, GL_LUMINANCE,       GL_HALF_FLOAT,    GL_FLOAT,               RequireExtensions<&Extensions::textureStorage, &Extensions::textureHalfFloat>)));
+    map.insert(InternalFormatInfoPair(GL_LUMINANCE8_ALPHA8_EXT,  InternalFormatInfo::LUMAFormat( 8,  8, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, RequireExtension<&Extensions::textureStorage>                                )));
+    map.insert(InternalFormatInfoPair(GL_LUMINANCE_ALPHA32F_EXT, InternalFormatInfo::LUMAFormat(32, 32, GL_LUMINANCE_ALPHA, GL_FLOAT,         GL_FLOAT,               RequireExtensions<&Extensions::textureStorage, &Extensions::textureFloat>    )));
+    map.insert(InternalFormatInfoPair(GL_LUMINANCE_ALPHA16F_EXT, InternalFormatInfo::LUMAFormat(16, 16, GL_LUMINANCE_ALPHA, GL_HALF_FLOAT,    GL_FLOAT,               RequireExtensions<&Extensions::textureStorage, &Extensions::textureHalfFloat>)));
 
     // Unsized formats
-    //                               | Internal format   |                                 | Format            | Supported     |
-    map.insert(InternalFormatInfoPair(GL_ALPHA,           InternalFormatInfo::UnsizedFormat(GL_ALPHA,           AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_LUMINANCE,       InternalFormatInfo::UnsizedFormat(GL_LUMINANCE,       AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_LUMINANCE_ALPHA, InternalFormatInfo::UnsizedFormat(GL_LUMINANCE_ALPHA, AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RED,             InternalFormatInfo::UnsizedFormat(GL_RED,             AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RG,              InternalFormatInfo::UnsizedFormat(GL_RG,              AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGB,             InternalFormatInfo::UnsizedFormat(GL_RGB,             AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGBA,            InternalFormatInfo::UnsizedFormat(GL_RGBA,            AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RED_INTEGER,     InternalFormatInfo::UnsizedFormat(GL_RED_INTEGER,     AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RG_INTEGER,      InternalFormatInfo::UnsizedFormat(GL_RG_INTEGER,      AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGB_INTEGER,     InternalFormatInfo::UnsizedFormat(GL_RGB_INTEGER,     AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_RGBA_INTEGER,    InternalFormatInfo::UnsizedFormat(GL_RGBA_INTEGER,    AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_BGRA_EXT,        InternalFormatInfo::UnsizedFormat(GL_BGRA_EXT,        AlwaysSupported)));
-    map.insert(InternalFormatInfoPair(GL_SRGB_EXT,        InternalFormatInfo::UnsizedFormat(GL_RGB,             CheckSupport<&Extensions::sRGB>)));
-    map.insert(InternalFormatInfoPair(GL_SRGB_ALPHA_EXT,  InternalFormatInfo::UnsizedFormat(GL_RGBA,            CheckSupport<&Extensions::sRGB>)));
+    //                               | Internal format   |                                 | Format            | Supported                                                     |
+    map.insert(InternalFormatInfoPair(GL_ALPHA,           InternalFormatInfo::UnsizedFormat(GL_ALPHA,           RequireESVersion<2>                                            )));
+    map.insert(InternalFormatInfoPair(GL_LUMINANCE,       InternalFormatInfo::UnsizedFormat(GL_LUMINANCE,       RequireESVersion<2>                                            )));
+    map.insert(InternalFormatInfoPair(GL_LUMINANCE_ALPHA, InternalFormatInfo::UnsizedFormat(GL_LUMINANCE_ALPHA, RequireESVersion<2>                                            )));
+    map.insert(InternalFormatInfoPair(GL_RED,             InternalFormatInfo::UnsizedFormat(GL_RED,             RequireESVersionOrExtension<3, &Extensions::textureRG>         )));
+    map.insert(InternalFormatInfoPair(GL_RG,              InternalFormatInfo::UnsizedFormat(GL_RG,              RequireESVersionOrExtension<3, &Extensions::textureRG>         )));
+    map.insert(InternalFormatInfoPair(GL_RGB,             InternalFormatInfo::UnsizedFormat(GL_RGB,             RequireESVersion<2>                                            )));
+    map.insert(InternalFormatInfoPair(GL_RGBA,            InternalFormatInfo::UnsizedFormat(GL_RGBA,            RequireESVersion<2>                                            )));
+    map.insert(InternalFormatInfoPair(GL_RED_INTEGER,     InternalFormatInfo::UnsizedFormat(GL_RED_INTEGER,     RequireESVersion<3>                                            )));
+    map.insert(InternalFormatInfoPair(GL_RG_INTEGER,      InternalFormatInfo::UnsizedFormat(GL_RG_INTEGER,      RequireESVersion<3>                                            )));
+    map.insert(InternalFormatInfoPair(GL_RGB_INTEGER,     InternalFormatInfo::UnsizedFormat(GL_RGB_INTEGER,     RequireESVersion<3>                                            )));
+    map.insert(InternalFormatInfoPair(GL_RGBA_INTEGER,    InternalFormatInfo::UnsizedFormat(GL_RGBA_INTEGER,    RequireESVersion<3>                                            )));
+    map.insert(InternalFormatInfoPair(GL_BGRA_EXT,        InternalFormatInfo::UnsizedFormat(GL_BGRA_EXT,        RequireExtension<&Extensions::textureFormatBGRA8888>           )));
+    map.insert(InternalFormatInfoPair(GL_DEPTH_COMPONENT, InternalFormatInfo::UnsizedFormat(GL_DEPTH_COMPONENT, RequireESVersion<2>                                            )));
+    map.insert(InternalFormatInfoPair(GL_DEPTH_STENCIL,   InternalFormatInfo::UnsizedFormat(GL_DEPTH_STENCIL,   RequireESVersionOrExtension<3, &Extensions::packedDepthStencil>)));
+    map.insert(InternalFormatInfoPair(GL_SRGB_EXT,        InternalFormatInfo::UnsizedFormat(GL_RGB,             RequireESVersionOrExtension<3, &Extensions::sRGB>              )));
+    map.insert(InternalFormatInfoPair(GL_SRGB_ALPHA_EXT,  InternalFormatInfo::UnsizedFormat(GL_RGBA,            RequireESVersionOrExtension<3, &Extensions::sRGB>              )));
 
     // Compressed formats, From ES 3.0.1 spec, table 3.16
     //                               | Internal format                             |                                    |W |H | BS |CC| Format                                      | Type            | SRGB | Supported          |
@@ -741,128 +705,28 @@
     map.insert(InternalFormatInfoPair(GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,          InternalFormatInfo::CompressedFormat(4, 4, 128, 4, GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,          GL_UNSIGNED_BYTE, true,  UnimplementedSupport)));
 
     // From GL_EXT_texture_compression_dxt1
-    //                               | Internal format                   |                                    |W |H | BS |CC| Format                            | Type            | SRGB | Supported                                |
-    map.insert(InternalFormatInfoPair(GL_COMPRESSED_RGB_S3TC_DXT1_EXT,    InternalFormatInfo::CompressedFormat(4, 4,  64, 3, GL_COMPRESSED_RGB_S3TC_DXT1_EXT,    GL_UNSIGNED_BYTE, false, CheckSupport<&Extensions::textureCompressionDXT1>)));
-    map.insert(InternalFormatInfoPair(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,   InternalFormatInfo::CompressedFormat(4, 4,  64, 4, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,   GL_UNSIGNED_BYTE, false, CheckSupport<&Extensions::textureCompressionDXT1>)));
+    //                               | Internal format                   |                                    |W |H | BS |CC| Format                            | Type            | SRGB | Supported                                           |
+    map.insert(InternalFormatInfoPair(GL_COMPRESSED_RGB_S3TC_DXT1_EXT,    InternalFormatInfo::CompressedFormat(4, 4,  64, 3, GL_COMPRESSED_RGB_S3TC_DXT1_EXT,    GL_UNSIGNED_BYTE, false, RequireExtension<&Extensions::textureCompressionDXT1>)));
+    map.insert(InternalFormatInfoPair(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,   InternalFormatInfo::CompressedFormat(4, 4,  64, 4, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,   GL_UNSIGNED_BYTE, false, RequireExtension<&Extensions::textureCompressionDXT1>)));
 
     // From GL_ANGLE_texture_compression_dxt3
-    map.insert(InternalFormatInfoPair(GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, InternalFormatInfo::CompressedFormat(4, 4, 128, 4, GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, GL_UNSIGNED_BYTE, false, CheckSupport<&Extensions::textureCompressionDXT5>)));
+    map.insert(InternalFormatInfoPair(GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, InternalFormatInfo::CompressedFormat(4, 4, 128, 4, GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, GL_UNSIGNED_BYTE, false, RequireExtension<&Extensions::textureCompressionDXT5>)));
 
     // From GL_ANGLE_texture_compression_dxt5
-    map.insert(InternalFormatInfoPair(GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, InternalFormatInfo::CompressedFormat(4, 4, 128, 4, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, GL_UNSIGNED_BYTE, false, CheckSupport<&Extensions::textureCompressionDXT5>)));
+    map.insert(InternalFormatInfoPair(GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, InternalFormatInfo::CompressedFormat(4, 4, 128, 4, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, GL_UNSIGNED_BYTE, false, RequireExtension<&Extensions::textureCompressionDXT5>)));
 
     return map;
 }
 
-static InternalFormatInfoMap BuildES2InternalFormatInfoMap()
+static const InternalFormatInfoMap &GetInternalFormatMap()
 {
-    InternalFormatInfoMap map;
-
-    // From ES 2.0.25 table 4.5
-    map.insert(InternalFormatInfoPair(GL_NONE,                 InternalFormatInfo()));
-
-    //                               | Internal format        |                              | R | G | B | A |S | Format          | Type                     | Component type        | SRGB |  Supported                                     |
-    map.insert(InternalFormatInfoPair(GL_RGBA4,                InternalFormatInfo::RGBAFormat( 4,  4,  4,  4, 0, GL_RGBA,          GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_NORMALIZED, false, AlwaysSupported                                 )));
-    map.insert(InternalFormatInfoPair(GL_RGB5_A1,              InternalFormatInfo::RGBAFormat( 5,  5,  5,  1, 0, GL_RGBA,          GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_NORMALIZED, false, AlwaysSupported                                 )));
-    map.insert(InternalFormatInfoPair(GL_RGB565,               InternalFormatInfo::RGBAFormat( 5,  6,  5,  0, 0, GL_RGB,           GL_UNSIGNED_SHORT_5_6_5,   GL_UNSIGNED_NORMALIZED, false, AlwaysSupported                                 )));
-
-    // Extension formats
-    map.insert(InternalFormatInfoPair(GL_R8_EXT,               InternalFormatInfo::RGBAFormat( 8,  0,  0,  0, 0, GL_RED_EXT,       GL_UNSIGNED_BYTE,          GL_UNSIGNED_NORMALIZED, false, CheckSupport<&Extensions::textureRG>            )));
-    map.insert(InternalFormatInfoPair(GL_RG8_EXT,              InternalFormatInfo::RGBAFormat( 8,  8,  0,  0, 0, GL_RG_EXT,        GL_UNSIGNED_BYTE,          GL_UNSIGNED_NORMALIZED, false, CheckSupport<&Extensions::textureRG>            )));
-    map.insert(InternalFormatInfoPair(GL_RGB8_OES,             InternalFormatInfo::RGBAFormat( 8,  8,  8,  0, 0, GL_RGB,           GL_UNSIGNED_BYTE,          GL_UNSIGNED_NORMALIZED, false, CheckSupport<&Extensions::rgb8rgba8>            )));
-    map.insert(InternalFormatInfoPair(GL_RGBA8_OES,            InternalFormatInfo::RGBAFormat( 8,  8,  8,  8, 0, GL_RGBA,          GL_UNSIGNED_BYTE,          GL_UNSIGNED_NORMALIZED, false, CheckSupport<&Extensions::rgb8rgba8>            )));
-    map.insert(InternalFormatInfoPair(GL_BGRA8_EXT,            InternalFormatInfo::RGBAFormat( 8,  8,  8,  8, 0, GL_BGRA_EXT,      GL_UNSIGNED_BYTE,          GL_UNSIGNED_NORMALIZED, false, CheckSupport<&Extensions::textureFormatBGRA8888>)));
-    map.insert(InternalFormatInfoPair(GL_BGRA4_ANGLEX,         InternalFormatInfo::RGBAFormat( 4,  4,  4,  4, 0, GL_BGRA_EXT,      GL_UNSIGNED_SHORT_4_4_4_4, GL_UNSIGNED_NORMALIZED, false, CheckSupport<&Extensions::textureFormatBGRA8888>)));
-    map.insert(InternalFormatInfoPair(GL_BGR5_A1_ANGLEX,       InternalFormatInfo::RGBAFormat( 5,  5,  5,  1, 0, GL_BGRA_EXT,      GL_UNSIGNED_SHORT_5_5_5_1, GL_UNSIGNED_NORMALIZED, false, CheckSupport<&Extensions::textureFormatBGRA8888>)));
-
-    // From GL_EXT_sRGB
-    map.insert(InternalFormatInfoPair(GL_SRGB8,                InternalFormatInfo::RGBAFormat( 8,  8,  8,  0, 0, GL_RGB,           GL_UNSIGNED_BYTE,           GL_UNSIGNED_NORMALIZED, true,  CheckSupport<&Extensions::sRGB>)));
-    map.insert(InternalFormatInfoPair(GL_SRGB8_ALPHA8,         InternalFormatInfo::RGBAFormat( 8,  8,  8,  8, 0, GL_RGBA,          GL_UNSIGNED_BYTE,           GL_UNSIGNED_NORMALIZED, true,  CheckSupport<&Extensions::sRGB>)));
-
-    // Floating point formats have to query the renderer for support
-    //                               | Internal format        |                              | R | G | B | A |S | Format          | Type                     | Comp    | SRGB | Supported                                                         |
-    //                               |                        |                              |   |   |   |   |  |                 |                          | type    |      |                                                                   |
-    map.insert(InternalFormatInfoPair(GL_R16F_EXT,             InternalFormatInfo::RGBAFormat(16,  0,  0,  0, 0, GL_RED,           GL_HALF_FLOAT_OES,         GL_FLOAT, false, CheckSupport<&Extensions::textureHalfFloat, &Extensions::textureRG>)));
-    map.insert(InternalFormatInfoPair(GL_R32F_EXT,             InternalFormatInfo::RGBAFormat(32,  0,  0,  0, 0, GL_RED,           GL_FLOAT,                  GL_FLOAT, false, CheckSupport<&Extensions::textureFloat,     &Extensions::textureRG>)));
-    map.insert(InternalFormatInfoPair(GL_RG16F_EXT,            InternalFormatInfo::RGBAFormat(16, 16,  0,  0, 0, GL_RG,            GL_HALF_FLOAT_OES,         GL_FLOAT, false, CheckSupport<&Extensions::textureHalfFloat, &Extensions::textureRG>)));
-    map.insert(InternalFormatInfoPair(GL_RG32F_EXT,            InternalFormatInfo::RGBAFormat(32, 32,  0,  0, 0, GL_RG,            GL_FLOAT,                  GL_FLOAT, false, CheckSupport<&Extensions::textureFloat,     &Extensions::textureRG>)));
-    map.insert(InternalFormatInfoPair(GL_RGB16F_EXT,           InternalFormatInfo::RGBAFormat(16, 16, 16,  0, 0, GL_RGB,           GL_HALF_FLOAT_OES,         GL_FLOAT, false, CheckSupport<&Extensions::textureHalfFloat>                        )));
-    map.insert(InternalFormatInfoPair(GL_RGB32F_EXT,           InternalFormatInfo::RGBAFormat(32, 32, 32,  0, 0, GL_RGB,           GL_FLOAT,                  GL_FLOAT, false, CheckSupport<&Extensions::textureFloat>                            )));
-    map.insert(InternalFormatInfoPair(GL_RGBA16F_EXT,          InternalFormatInfo::RGBAFormat(16, 16, 16, 16, 0, GL_RGBA,          GL_HALF_FLOAT_OES,         GL_FLOAT, false, CheckSupport<&Extensions::textureHalfFloat>                        )));
-    map.insert(InternalFormatInfoPair(GL_RGBA32F_EXT,          InternalFormatInfo::RGBAFormat(32, 32, 32, 32, 0, GL_RGBA,          GL_FLOAT,                  GL_FLOAT, false, CheckSupport<&Extensions::textureFloat>                            )));
-
-    // Depth and stencil formats
-    //                               | Internal format        |                                      | D |S |X | Format              | Type                     | Internal format     | Supported                                |
-    //                               |                        |                                      |   |  |  |                     |                          | type                |                                          |
-    map.insert(InternalFormatInfoPair(GL_DEPTH_COMPONENT32_OES,InternalFormatInfo::DepthStencilFormat(32, 0, 0, GL_DEPTH_COMPONENT,   GL_UNSIGNED_INT,           GL_UNSIGNED_NORMALIZED, CheckSupport<&Extensions::depthTextures>)));
-    map.insert(InternalFormatInfoPair(GL_DEPTH24_STENCIL8_OES, InternalFormatInfo::DepthStencilFormat(24, 8, 0, GL_DEPTH_STENCIL_OES, GL_UNSIGNED_INT_24_8_OES,  GL_UNSIGNED_NORMALIZED, AlwaysSupported                         )));
-    map.insert(InternalFormatInfoPair(GL_DEPTH_COMPONENT16,    InternalFormatInfo::DepthStencilFormat(16, 0, 0, GL_DEPTH_COMPONENT,   GL_UNSIGNED_SHORT,         GL_UNSIGNED_NORMALIZED, AlwaysSupported                         )));
-    map.insert(InternalFormatInfoPair(GL_STENCIL_INDEX8,       InternalFormatInfo::DepthStencilFormat( 0, 8, 0, GL_DEPTH_STENCIL_OES, GL_UNSIGNED_BYTE,          GL_UNSIGNED_NORMALIZED, AlwaysSupported                         )));
-
-    // Unsized formats
-    //                               | Internal format        |                                 | Format              | Supported                                      |
-    map.insert(InternalFormatInfoPair(GL_ALPHA,                InternalFormatInfo::UnsizedFormat(GL_ALPHA,             AlwaysSupported                                 )));
-    map.insert(InternalFormatInfoPair(GL_LUMINANCE,            InternalFormatInfo::UnsizedFormat(GL_LUMINANCE,         AlwaysSupported                                 )));
-    map.insert(InternalFormatInfoPair(GL_LUMINANCE_ALPHA,      InternalFormatInfo::UnsizedFormat(GL_LUMINANCE_ALPHA,   AlwaysSupported                                 )));
-    map.insert(InternalFormatInfoPair(GL_RED_EXT,              InternalFormatInfo::UnsizedFormat(GL_RED_EXT,           CheckSupport<&Extensions::textureRG>            )));
-    map.insert(InternalFormatInfoPair(GL_RG_EXT,               InternalFormatInfo::UnsizedFormat(GL_RG_EXT,            CheckSupport<&Extensions::textureRG>            )));
-    map.insert(InternalFormatInfoPair(GL_RGB,                  InternalFormatInfo::UnsizedFormat(GL_RGB,               AlwaysSupported                                 )));
-    map.insert(InternalFormatInfoPair(GL_RGBA,                 InternalFormatInfo::UnsizedFormat(GL_RGBA,              AlwaysSupported                                 )));
-    map.insert(InternalFormatInfoPair(GL_BGRA_EXT,             InternalFormatInfo::UnsizedFormat(GL_BGRA_EXT,          CheckSupport<&Extensions::textureFormatBGRA8888>)));
-    map.insert(InternalFormatInfoPair(GL_DEPTH_COMPONENT,      InternalFormatInfo::UnsizedFormat(GL_DEPTH_COMPONENT,   AlwaysSupported                                 )));
-    map.insert(InternalFormatInfoPair(GL_DEPTH_STENCIL_OES,    InternalFormatInfo::UnsizedFormat(GL_DEPTH_STENCIL_OES, CheckSupport<&Extensions::packedDepthStencil>   )));
-    map.insert(InternalFormatInfoPair(GL_SRGB_EXT,             InternalFormatInfo::UnsizedFormat(GL_RGB,               CheckSupport<&Extensions::sRGB>                 )));
-    map.insert(InternalFormatInfoPair(GL_SRGB_ALPHA_EXT,       InternalFormatInfo::UnsizedFormat(GL_RGBA,              CheckSupport<&Extensions::sRGB>                 )));
-
-    // Luminance alpha formats from GL_EXT_texture_storage
-    //                               | Internal format          |                              | L | A | Format             | Type            | Component type        | Supported                                                              |
-    map.insert(InternalFormatInfoPair(GL_ALPHA8_EXT,             InternalFormatInfo::LUMAFormat( 0,  8, GL_ALPHA,           GL_UNSIGNED_BYTE,  GL_UNSIGNED_NORMALIZED, CheckSupport<&Extensions::textureStorage>                               )));
-    map.insert(InternalFormatInfoPair(GL_LUMINANCE8_EXT,         InternalFormatInfo::LUMAFormat( 8,  0, GL_LUMINANCE,       GL_UNSIGNED_BYTE,  GL_UNSIGNED_NORMALIZED, CheckSupport<&Extensions::textureStorage>                               )));
-    map.insert(InternalFormatInfoPair(GL_ALPHA32F_EXT,           InternalFormatInfo::LUMAFormat( 0, 32, GL_ALPHA,           GL_FLOAT,          GL_FLOAT,               CheckSupport<&Extensions::textureStorage, &Extensions::textureFloat>    )));
-    map.insert(InternalFormatInfoPair(GL_LUMINANCE32F_EXT,       InternalFormatInfo::LUMAFormat(32,  0, GL_LUMINANCE,       GL_FLOAT,          GL_FLOAT,               CheckSupport<&Extensions::textureStorage, &Extensions::textureFloat>    )));
-    map.insert(InternalFormatInfoPair(GL_ALPHA16F_EXT,           InternalFormatInfo::LUMAFormat( 0, 16, GL_ALPHA,           GL_HALF_FLOAT_OES, GL_FLOAT,               CheckSupport<&Extensions::textureStorage, &Extensions::textureHalfFloat>)));
-    map.insert(InternalFormatInfoPair(GL_LUMINANCE16F_EXT,       InternalFormatInfo::LUMAFormat(16,  0, GL_LUMINANCE,       GL_HALF_FLOAT_OES, GL_FLOAT,               CheckSupport<&Extensions::textureStorage, &Extensions::textureHalfFloat>)));
-    map.insert(InternalFormatInfoPair(GL_LUMINANCE8_ALPHA8_EXT,  InternalFormatInfo::LUMAFormat( 8,  8, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE,  GL_UNSIGNED_NORMALIZED, CheckSupport<&Extensions::textureStorage>                               )));
-    map.insert(InternalFormatInfoPair(GL_LUMINANCE_ALPHA32F_EXT, InternalFormatInfo::LUMAFormat(32, 32, GL_LUMINANCE_ALPHA, GL_FLOAT,          GL_FLOAT,               CheckSupport<&Extensions::textureStorage, &Extensions::textureFloat>    )));
-    map.insert(InternalFormatInfoPair(GL_LUMINANCE_ALPHA16F_EXT, InternalFormatInfo::LUMAFormat(16, 16, GL_LUMINANCE_ALPHA, GL_HALF_FLOAT_OES, GL_FLOAT,               CheckSupport<&Extensions::textureStorage, &Extensions::textureHalfFloat>)));
-
-    // From GL_EXT_texture_compression_dxt1
-    //                               | Internal format                   |                                    |W |H | BS |CC| Format                            | Type            | SRGB | Supported                                |
-    map.insert(InternalFormatInfoPair(GL_COMPRESSED_RGB_S3TC_DXT1_EXT,    InternalFormatInfo::CompressedFormat(4, 4,  64, 3, GL_COMPRESSED_RGB_S3TC_DXT1_EXT,    GL_UNSIGNED_BYTE, false, CheckSupport<&Extensions::textureCompressionDXT1>)));
-    map.insert(InternalFormatInfoPair(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,   InternalFormatInfo::CompressedFormat(4, 4,  64, 4, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,   GL_UNSIGNED_BYTE, false, CheckSupport<&Extensions::textureCompressionDXT1>)));
-
-    // From GL_ANGLE_texture_compression_dxt3
-    map.insert(InternalFormatInfoPair(GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, InternalFormatInfo::CompressedFormat(4, 4, 128, 4, GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, GL_UNSIGNED_BYTE, false, CheckSupport<&Extensions::textureCompressionDXT3>)));
-
-    // From GL_ANGLE_texture_compression_dxt5
-    map.insert(InternalFormatInfoPair(GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, InternalFormatInfo::CompressedFormat(4, 4, 128, 4, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, GL_UNSIGNED_BYTE, false, CheckSupport<&Extensions::textureCompressionDXT5>)));
-
-    return map;
+    static const InternalFormatInfoMap formatMap = BuildInternalFormatInfoMap();
+    return formatMap;
 }
 
-static const InternalFormatInfoMap &GetInternalFormatMap(GLuint clientVersion)
+static bool GetInternalFormatInfo(GLenum internalFormat, InternalFormatInfo *outFormatInfo)
 {
-    if (clientVersion == 2)
-    {
-        static const InternalFormatInfoMap formatMap = BuildES2InternalFormatInfoMap();
-        return formatMap;
-    }
-    else if (clientVersion == 3)
-    {
-        static const InternalFormatInfoMap formatMap = BuildES3InternalFormatInfoMap();
-        return formatMap;
-    }
-    else
-    {
-        UNREACHABLE();
-        static const InternalFormatInfoMap emptyFormatMap;
-        return emptyFormatMap;
-    }
-}
-
-static bool GetInternalFormatInfo(GLenum internalFormat, GLuint clientVersion, InternalFormatInfo *outFormatInfo)
-{
-    const InternalFormatInfoMap &map = GetInternalFormatMap(clientVersion);
+    const InternalFormatInfoMap &map = GetInternalFormatMap();
     InternalFormatInfoMap::const_iterator iter = map.find(internalFormat);
     if (iter != map.end())
     {
@@ -878,11 +742,11 @@
     }
 }
 
-static FormatSet BuildAllSizedInternalFormatSet(GLuint clientVersion)
+static FormatSet BuildAllSizedInternalFormatSet()
 {
     FormatSet result;
 
-    const InternalFormatInfoMap &formats = GetInternalFormatMap(clientVersion);
+    const InternalFormatInfoMap &formats = GetInternalFormatMap();
     for (InternalFormatInfoMap::const_iterator i = formats.begin(); i != formats.end(); i++)
     {
         if (i->second.mPixelBits > 0)
@@ -894,68 +758,8 @@
     return result;
 }
 
-static FormatSet BuildES2ValidFormatSet()
-{
-    static const FormatMap &formatMap = GetFormatMap(2);
-
-    FormatSet set;
-
-    for (FormatMap::const_iterator i = formatMap.begin(); i != formatMap.end(); i++)
-    {
-        const FormatTypePair& formatPair = i->first;
-        set.insert(formatPair.first);
-    }
-
-    return set;
-}
-
-static FormatSet BuildES3ValidFormatSet()
-{
-    static const ES3FormatSet &formatSet = GetES3FormatSet();
-
-    FormatSet set;
-
-    for (ES3FormatSet::const_iterator i = formatSet.begin(); i != formatSet.end(); i++)
-    {
-        const FormatInfo& formatInfo = *i;
-        set.insert(formatInfo.mFormat);
-    }
-
-    return set;
-}
-
 typedef std::set<GLenum> TypeSet;
 
-static TypeSet BuildES2ValidTypeSet()
-{
-    static const FormatMap &formatMap = GetFormatMap(2);
-
-    TypeSet set;
-
-    for (FormatMap::const_iterator i = formatMap.begin(); i != formatMap.end(); i++)
-    {
-        const FormatTypePair& formatPair = i->first;
-        set.insert(formatPair.second);
-    }
-
-    return set;
-}
-
-static TypeSet BuildES3ValidTypeSet()
-{
-    static const ES3FormatSet &formatSet = GetES3FormatSet();
-
-    TypeSet set;
-
-    for (ES3FormatSet::const_iterator i = formatSet.begin(); i != formatSet.end(); i++)
-    {
-        const FormatInfo& formatInfo = *i;
-        set.insert(formatInfo.mType);
-    }
-
-    return set;
-}
-
 struct EffectiveInternalFormatInfo
 {
     GLenum mEffectiveFormat;
@@ -1023,12 +827,12 @@
 }
 
 static bool GetEffectiveInternalFormat(const InternalFormatInfo &srcFormat, const InternalFormatInfo &destFormat,
-                                       GLuint clientVersion, GLenum *outEffectiveFormat)
+                                       GLenum *outEffectiveFormat)
 {
     const EffectiveInternalFormatList *list = NULL;
     GLenum targetFormat = GL_NONE;
 
-    if (gl::IsSizedInternalFormat(destFormat.mFormat, clientVersion))
+    if (gl::IsSizedInternalFormat(destFormat.mFormat))
     {
         static const EffectiveInternalFormatList sizedList = BuildSizedEffectiveInternalFormatList();
         list = &sizedList;
@@ -1121,10 +925,10 @@
 bool IsValidInternalFormat(GLenum internalFormat, const Extensions &extensions, GLuint clientVersion)
 {
     InternalFormatInfo internalFormatInfo;
-    if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
+    if (GetInternalFormatInfo(internalFormat, &internalFormatInfo))
     {
         ASSERT(internalFormatInfo.mSupportFunction != NULL);
-        return internalFormatInfo.mSupportFunction(extensions);
+        return internalFormatInfo.mSupportFunction(clientVersion, extensions);
     }
     else
     {
@@ -1132,51 +936,54 @@
     }
 }
 
-bool IsValidFormat(GLenum format, GLuint clientVersion)
+bool IsValidFormat(GLenum format, const Extensions &extensions, GLuint clientVersion)
 {
-    if (clientVersion == 2)
+    const InternalFormatInfoMap &internalFormats = GetInternalFormatMap();
+    for (InternalFormatInfoMap::const_iterator i = internalFormats.begin(); i != internalFormats.end(); i++)
     {
-        static const FormatSet formatSet = BuildES2ValidFormatSet();
-        return formatSet.find(format) != formatSet.end();
+        if (i->second.mFormat == format && i->second.mSupportFunction(clientVersion, extensions))
+        {
+            return true;
+        }
     }
-    else if (clientVersion == 3)
+
+    return false;
+}
+
+bool IsValidType(GLenum type, const Extensions &extensions, GLuint clientVersion)
+{
+    const InternalFormatInfoMap &internalFormats = GetInternalFormatMap();
+    for (InternalFormatInfoMap::const_iterator i = internalFormats.begin(); i != internalFormats.end(); i++)
     {
-        static const FormatSet formatSet = BuildES3ValidFormatSet();
-        return formatSet.find(format) != formatSet.end();
+        if (i->second.mType == type && i->second.mSupportFunction(clientVersion, extensions))
+        {
+            return true;
+        }
+    }
+
+    return false;
+}
+
+bool IsValidFormatCombination(GLenum internalFormat, GLenum format, GLenum type, const Extensions &extensions, GLuint clientVersion)
+{
+    InternalFormatInfo internalFormatInfo;
+    if (GetInternalFormatInfo(internalFormat, &internalFormatInfo))
+    {
+        if (!internalFormatInfo.mSupportFunction(clientVersion, extensions))
+        {
+            return false;
+        }
     }
     else
     {
         UNREACHABLE();
         return false;
     }
-}
 
-bool IsValidType(GLenum type, GLuint clientVersion)
-{
     if (clientVersion == 2)
     {
-        static const TypeSet typeSet = BuildES2ValidTypeSet();
-        return typeSet.find(type) != typeSet.end();
-    }
-    else if (clientVersion == 3)
-    {
-        static const TypeSet typeSet = BuildES3ValidTypeSet();
-        return typeSet.find(type) != typeSet.end();
-    }
-    else
-    {
-        UNREACHABLE();
-        return false;
-    }
-}
-
-bool IsValidFormatCombination(GLenum internalFormat, GLenum format, GLenum type, GLuint clientVersion)
-{
-    if (clientVersion == 2)
-    {
-        static const FormatMap &formats = GetFormatMap(clientVersion);
+        static const FormatMap &formats = GetFormatMap();
         FormatMap::const_iterator iter = formats.find(FormatTypePair(format, type));
-
         return (iter != formats.end()) && ((internalFormat == (GLint)type) || (internalFormat == iter->second.mInternalFormat));
     }
     else if (clientVersion == 3)
@@ -1195,8 +1002,8 @@
 {
     InternalFormatInfo textureInternalFormatInfo;
     InternalFormatInfo framebufferInternalFormatInfo;
-    if (GetInternalFormatInfo(textureInternalFormat, clientVersion, &textureInternalFormatInfo) &&
-        GetInternalFormatInfo(frameBufferInternalFormat, clientVersion, &framebufferInternalFormatInfo))
+    if (GetInternalFormatInfo(textureInternalFormat, &textureInternalFormatInfo) &&
+        GetInternalFormatInfo(frameBufferInternalFormat, &framebufferInternalFormatInfo))
     {
         if (clientVersion == 2)
         {
@@ -1249,7 +1056,7 @@
                 if (readBufferHandle != 0)
                 {
                     // Not the default framebuffer, therefore the read buffer must be a user-created texture or renderbuffer
-                    if (gl::IsSizedInternalFormat(framebufferInternalFormatInfo.mFormat, clientVersion))
+                    if (gl::IsSizedInternalFormat(framebufferInternalFormatInfo.mFormat))
                     {
                         sourceEffectiveFormat = framebufferInternalFormatInfo;
                     }
@@ -1258,8 +1065,8 @@
                         // Renderbuffers cannot be created with an unsized internal format, so this must be an unsized-format
                         // texture. We can use the same table we use when creating textures to get its effective sized format.
                         GLenum effectiveFormat = gl::GetSizedInternalFormat(framebufferInternalFormatInfo.mFormat,
-                                                                            framebufferInternalFormatInfo.mType, clientVersion);
-                        gl::GetInternalFormatInfo(effectiveFormat, clientVersion, &sourceEffectiveFormat);
+                                                                            framebufferInternalFormatInfo.mType);
+                        gl::GetInternalFormatInfo(effectiveFormat, &sourceEffectiveFormat);
                     }
                 }
                 else
@@ -1269,9 +1076,9 @@
                     if (framebufferInternalFormatInfo.mColorEncoding == GL_LINEAR)
                     {
                         GLenum effectiveFormat;
-                        if (GetEffectiveInternalFormat(framebufferInternalFormatInfo, textureInternalFormatInfo, clientVersion, &effectiveFormat))
+                        if (GetEffectiveInternalFormat(framebufferInternalFormatInfo, textureInternalFormatInfo, &effectiveFormat))
                         {
-                            gl::GetInternalFormatInfo(effectiveFormat, clientVersion, &sourceEffectiveFormat);
+                            gl::GetInternalFormatInfo(effectiveFormat, &sourceEffectiveFormat);
                         }
                         else
                         {
@@ -1281,13 +1088,13 @@
                     else if (framebufferInternalFormatInfo.mColorEncoding == GL_SRGB)
                     {
                         // SRGB buffers can only be copied to sized format destinations according to table 3.18
-                        if (gl::IsSizedInternalFormat(textureInternalFormat, clientVersion) &&
+                        if (gl::IsSizedInternalFormat(textureInternalFormat) &&
                             (framebufferInternalFormatInfo.mRedBits   >= 1 && framebufferInternalFormatInfo.mRedBits   <= 8) &&
                             (framebufferInternalFormatInfo.mGreenBits >= 1 && framebufferInternalFormatInfo.mGreenBits <= 8) &&
                             (framebufferInternalFormatInfo.mBlueBits  >= 1 && framebufferInternalFormatInfo.mBlueBits  <= 8) &&
                             (framebufferInternalFormatInfo.mAlphaBits >= 1 && framebufferInternalFormatInfo.mAlphaBits <= 8))
                         {
-                            gl::GetInternalFormatInfo(GL_SRGB8_ALPHA8, clientVersion, &sourceEffectiveFormat);
+                            gl::GetInternalFormatInfo(GL_SRGB8_ALPHA8, &sourceEffectiveFormat);
                         }
                         else
                         {
@@ -1300,7 +1107,7 @@
                     }
                 }
 
-                if (gl::IsSizedInternalFormat(textureInternalFormatInfo.mFormat, clientVersion))
+                if (gl::IsSizedInternalFormat(textureInternalFormatInfo.mFormat))
                 {
                     // Section 3.8.5 of the GLES 3.0.3 spec, pg 139, requires that, if the destination format is sized,
                     // component sizes of the source and destination formats must exactly match
@@ -1333,10 +1140,10 @@
     }
 }
 
-bool IsSizedInternalFormat(GLenum internalFormat, GLuint clientVersion)
+bool IsSizedInternalFormat(GLenum internalFormat)
 {
     InternalFormatInfo internalFormatInfo;
-    if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
+    if (GetInternalFormatInfo(internalFormat, &internalFormatInfo))
     {
         return internalFormatInfo.mPixelBits > 0;
     }
@@ -1347,17 +1154,17 @@
     }
 }
 
-GLenum GetSizedInternalFormat(GLenum format, GLenum type, GLuint clientVersion)
+GLenum GetSizedInternalFormat(GLenum format, GLenum type)
 {
-    const FormatMap &formats = GetFormatMap(clientVersion);
+    const FormatMap &formats = GetFormatMap();
     FormatMap::const_iterator iter = formats.find(FormatTypePair(format, type));
     return (iter != formats.end()) ? iter->second.mInternalFormat : GL_NONE;
 }
 
-GLuint GetPixelBytes(GLenum internalFormat, GLuint clientVersion)
+GLuint GetPixelBytes(GLenum internalFormat)
 {
     InternalFormatInfo internalFormatInfo;
-    if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
+    if (GetInternalFormatInfo(internalFormat, &internalFormatInfo))
     {
         return internalFormatInfo.mPixelBits / 8;
     }
@@ -1368,10 +1175,10 @@
     }
 }
 
-GLuint GetAlphaBits(GLenum internalFormat, GLuint clientVersion)
+GLuint GetAlphaBits(GLenum internalFormat)
 {
     InternalFormatInfo internalFormatInfo;
-    if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
+    if (GetInternalFormatInfo(internalFormat, &internalFormatInfo))
     {
         return internalFormatInfo.mAlphaBits;
     }
@@ -1382,10 +1189,10 @@
     }
 }
 
-GLuint GetRedBits(GLenum internalFormat, GLuint clientVersion)
+GLuint GetRedBits(GLenum internalFormat)
 {
     InternalFormatInfo internalFormatInfo;
-    if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
+    if (GetInternalFormatInfo(internalFormat, &internalFormatInfo))
     {
         return internalFormatInfo.mRedBits;
     }
@@ -1396,10 +1203,10 @@
     }
 }
 
-GLuint GetGreenBits(GLenum internalFormat, GLuint clientVersion)
+GLuint GetGreenBits(GLenum internalFormat)
 {
     InternalFormatInfo internalFormatInfo;
-    if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
+    if (GetInternalFormatInfo(internalFormat, &internalFormatInfo))
     {
         return internalFormatInfo.mGreenBits;
     }
@@ -1410,10 +1217,10 @@
     }
 }
 
-GLuint GetBlueBits(GLenum internalFormat, GLuint clientVersion)
+GLuint GetBlueBits(GLenum internalFormat)
 {
     InternalFormatInfo internalFormatInfo;
-    if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
+    if (GetInternalFormatInfo(internalFormat, &internalFormatInfo))
     {
         return internalFormatInfo.mBlueBits;
     }
@@ -1424,10 +1231,10 @@
     }
 }
 
-GLuint GetLuminanceBits(GLenum internalFormat, GLuint clientVersion)
+GLuint GetLuminanceBits(GLenum internalFormat)
 {
     InternalFormatInfo internalFormatInfo;
-    if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
+    if (GetInternalFormatInfo(internalFormat, &internalFormatInfo))
     {
         return internalFormatInfo.mLuminanceBits;
     }
@@ -1438,10 +1245,10 @@
     }
 }
 
-GLuint GetDepthBits(GLenum internalFormat, GLuint clientVersion)
+GLuint GetDepthBits(GLenum internalFormat)
 {
     InternalFormatInfo internalFormatInfo;
-    if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
+    if (GetInternalFormatInfo(internalFormat, &internalFormatInfo))
     {
         return internalFormatInfo.mDepthBits;
     }
@@ -1452,10 +1259,10 @@
     }
 }
 
-GLuint GetStencilBits(GLenum internalFormat, GLuint clientVersion)
+GLuint GetStencilBits(GLenum internalFormat)
 {
     InternalFormatInfo internalFormatInfo;
-    if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
+    if (GetInternalFormatInfo(internalFormat, &internalFormatInfo))
     {
         return internalFormatInfo.mStencilBits;
     }
@@ -1508,10 +1315,10 @@
     }
 }
 
-GLenum GetFormat(GLenum internalFormat, GLuint clientVersion)
+GLenum GetFormat(GLenum internalFormat)
 {
     InternalFormatInfo internalFormatInfo;
-    if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
+    if (GetInternalFormatInfo(internalFormat, &internalFormatInfo))
     {
         return internalFormatInfo.mFormat;
     }
@@ -1522,10 +1329,10 @@
     }
 }
 
-GLenum GetType(GLenum internalFormat, GLuint clientVersion)
+GLenum GetType(GLenum internalFormat)
 {
     InternalFormatInfo internalFormatInfo;
-    if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
+    if (GetInternalFormatInfo(internalFormat, &internalFormatInfo))
     {
         return internalFormatInfo.mType;
     }
@@ -1536,10 +1343,10 @@
     }
 }
 
-GLenum GetComponentType(GLenum internalFormat, GLuint clientVersion)
+GLenum GetComponentType(GLenum internalFormat)
 {
     InternalFormatInfo internalFormatInfo;
-    if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
+    if (GetInternalFormatInfo(internalFormat, &internalFormatInfo))
     {
         return internalFormatInfo.mComponentType;
     }
@@ -1550,10 +1357,10 @@
     }
 }
 
-GLuint GetComponentCount(GLenum internalFormat, GLuint clientVersion)
+GLuint GetComponentCount(GLenum internalFormat)
 {
     InternalFormatInfo internalFormatInfo;
-    if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
+    if (GetInternalFormatInfo(internalFormat, &internalFormatInfo))
     {
         return internalFormatInfo.mComponentCount;
     }
@@ -1564,10 +1371,10 @@
     }
 }
 
-GLenum GetColorEncoding(GLenum internalFormat, GLuint clientVersion)
+GLenum GetColorEncoding(GLenum internalFormat)
 {
     InternalFormatInfo internalFormatInfo;
-    if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
+    if (GetInternalFormatInfo(internalFormat, &internalFormatInfo))
     {
         return internalFormatInfo.mColorEncoding;
     }
@@ -1578,21 +1385,21 @@
     }
 }
 
-GLuint GetRowPitch(GLenum internalFormat, GLenum type, GLuint clientVersion, GLsizei width, GLint alignment)
+GLuint GetRowPitch(GLenum internalFormat, GLenum type, GLsizei width, GLint alignment)
 {
     ASSERT(alignment > 0 && isPow2(alignment));
-    return rx::roundUp(GetBlockSize(internalFormat, type, clientVersion, width, 1), static_cast<GLuint>(alignment));
+    return rx::roundUp(GetBlockSize(internalFormat, type, width, 1), static_cast<GLuint>(alignment));
 }
 
-GLuint GetDepthPitch(GLenum internalFormat, GLenum type, GLuint clientVersion, GLsizei width, GLsizei height, GLint alignment)
+GLuint GetDepthPitch(GLenum internalFormat, GLenum type, GLsizei width, GLsizei height, GLint alignment)
 {
-    return GetRowPitch(internalFormat, type, clientVersion, width, alignment) * height;
+    return GetRowPitch(internalFormat, type, width, alignment) * height;
 }
 
-GLuint GetBlockSize(GLenum internalFormat, GLenum type, GLuint clientVersion, GLsizei width, GLsizei height)
+GLuint GetBlockSize(GLenum internalFormat, GLenum type, GLsizei width, GLsizei height)
 {
     InternalFormatInfo internalFormatInfo;
-    if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
+    if (GetInternalFormatInfo(internalFormat, &internalFormatInfo))
     {
         if (internalFormatInfo.mIsCompressed)
         {
@@ -1629,10 +1436,10 @@
     }
 }
 
-bool IsFormatCompressed(GLenum internalFormat, GLuint clientVersion)
+bool IsFormatCompressed(GLenum internalFormat)
 {
     InternalFormatInfo internalFormatInfo;
-    if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
+    if (GetInternalFormatInfo(internalFormat, &internalFormatInfo))
     {
         return internalFormatInfo.mIsCompressed;
     }
@@ -1643,10 +1450,10 @@
     }
 }
 
-GLuint GetCompressedBlockWidth(GLenum internalFormat, GLuint clientVersion)
+GLuint GetCompressedBlockWidth(GLenum internalFormat)
 {
     InternalFormatInfo internalFormatInfo;
-    if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
+    if (GetInternalFormatInfo(internalFormat, &internalFormatInfo))
     {
         return internalFormatInfo.mCompressedBlockWidth;
     }
@@ -1657,10 +1464,10 @@
     }
 }
 
-GLuint GetCompressedBlockHeight(GLenum internalFormat, GLuint clientVersion)
+GLuint GetCompressedBlockHeight(GLenum internalFormat)
 {
     InternalFormatInfo internalFormatInfo;
-    if (GetInternalFormatInfo(internalFormat, clientVersion, &internalFormatInfo))
+    if (GetInternalFormatInfo(internalFormat, &internalFormatInfo))
     {
         return internalFormatInfo.mCompressedBlockHeight;
     }
@@ -1671,15 +1478,15 @@
     }
 }
 
-const FormatSet &GetAllSizedInternalFormats(GLuint clientVersion)
+const FormatSet &GetAllSizedInternalFormats()
 {
-    static FormatSet formatSet = BuildAllSizedInternalFormatSet(clientVersion);
+    static FormatSet formatSet = BuildAllSizedInternalFormatSet();
     return formatSet;
 }
 
-ColorWriteFunction GetColorWriteFunction(GLenum format, GLenum type, GLuint clientVersion)
+ColorWriteFunction GetColorWriteFunction(GLenum format, GLenum type)
 {
-    static const FormatMap &formats = GetFormatMap(clientVersion);
+    static const FormatMap &formats = GetFormatMap();
     FormatMap::const_iterator iter = formats.find(FormatTypePair(format, type));
     return (iter != formats.end()) ? iter->second.mColorWriteFunction : NULL;
 }
diff --git a/src/libGLESv2/formatutils.h b/src/libGLESv2/formatutils.h
index f321130..692ab88 100644
--- a/src/libGLESv2/formatutils.h
+++ b/src/libGLESv2/formatutils.h
@@ -37,46 +37,46 @@
 typedef std::set<GLenum> FormatSet;
 
 bool IsValidInternalFormat(GLenum internalFormat, const Extensions &extensions, GLuint clientVersion);
-bool IsValidFormat(GLenum format, GLuint clientVersion);
-bool IsValidType(GLenum type, GLuint clientVersion);
+bool IsValidFormat(GLenum format, const Extensions &extensions, GLuint clientVersion);
+bool IsValidType(GLenum type, const Extensions &extensions, GLuint clientVersion);
 
-bool IsValidFormatCombination(GLenum internalFormat, GLenum format, GLenum type, GLuint clientVersion);
+bool IsValidFormatCombination(GLenum internalFormat, GLenum format, GLenum type, const Extensions &extensions, GLuint clientVersion);
 bool IsValidCopyTexImageCombination(GLenum textureInternalFormat, GLenum frameBufferInternalFormat, GLuint readBufferHandle, GLuint clientVersion);
 
-bool IsSizedInternalFormat(GLenum internalFormat, GLuint clientVersion);
-GLenum GetSizedInternalFormat(GLenum format, GLenum type, GLuint clientVersion);
+bool IsSizedInternalFormat(GLenum internalFormat);
+GLenum GetSizedInternalFormat(GLenum format, GLenum type);
 
-GLuint GetPixelBytes(GLenum internalFormat, GLuint clientVersion);
-GLuint GetAlphaBits(GLenum internalFormat, GLuint clientVersion);
-GLuint GetRedBits(GLenum internalFormat, GLuint clientVersion);
-GLuint GetGreenBits(GLenum internalFormat, GLuint clientVersion);
-GLuint GetBlueBits(GLenum internalFormat, GLuint clientVersion);
-GLuint GetLuminanceBits(GLenum internalFormat, GLuint clientVersion);
-GLuint GetDepthBits(GLenum internalFormat, GLuint clientVersion);
-GLuint GetStencilBits(GLenum internalFormat, GLuint clientVersion);
+GLuint GetPixelBytes(GLenum internalFormat);
+GLuint GetAlphaBits(GLenum internalFormat);
+GLuint GetRedBits(GLenum internalFormat);
+GLuint GetGreenBits(GLenum internalFormat);
+GLuint GetBlueBits(GLenum internalFormat);
+GLuint GetLuminanceBits(GLenum internalFormat);
+GLuint GetDepthBits(GLenum internalFormat);
+GLuint GetStencilBits(GLenum internalFormat);
 
 GLuint GetTypeBytes(GLenum type);
 bool IsSpecialInterpretationType(GLenum type);
 bool IsFloatOrFixedComponentType(GLenum type);
 
-GLenum GetFormat(GLenum internalFormat, GLuint clientVersion);
-GLenum GetType(GLenum internalFormat, GLuint clientVersion);
+GLenum GetFormat(GLenum internalFormat);
+GLenum GetType(GLenum internalFormat);
 
-GLenum GetComponentType(GLenum internalFormat, GLuint clientVersion);
-GLuint GetComponentCount(GLenum internalFormat, GLuint clientVersion);
-GLenum GetColorEncoding(GLenum internalFormat, GLuint clientVersion);
+GLenum GetComponentType(GLenum internalFormat);
+GLuint GetComponentCount(GLenum internalFormat);
+GLenum GetColorEncoding(GLenum internalFormat);
 
-GLuint GetRowPitch(GLenum internalFormat, GLenum type, GLuint clientVersion, GLsizei width, GLint alignment);
-GLuint GetDepthPitch(GLenum internalFormat, GLenum type, GLuint clientVersion, GLsizei width, GLsizei height, GLint alignment);
-GLuint GetBlockSize(GLenum internalFormat, GLenum type, GLuint clientVersion, GLsizei width, GLsizei height);
+GLuint GetRowPitch(GLenum internalFormat, GLenum type, GLsizei width, GLint alignment);
+GLuint GetDepthPitch(GLenum internalFormat, GLenum type, GLsizei width, GLsizei height, GLint alignment);
+GLuint GetBlockSize(GLenum internalFormat, GLenum type, GLsizei width, GLsizei height);
 
-bool IsFormatCompressed(GLenum internalFormat, GLuint clientVersion);
-GLuint GetCompressedBlockWidth(GLenum internalFormat, GLuint clientVersion);
-GLuint GetCompressedBlockHeight(GLenum internalFormat, GLuint clientVersion);
+bool IsFormatCompressed(GLenum internalFormat);
+GLuint GetCompressedBlockWidth(GLenum internalFormat);
+GLuint GetCompressedBlockHeight(GLenum internalFormat);
 
-const FormatSet &GetAllSizedInternalFormats(GLuint clientVersion);
+const FormatSet &GetAllSizedInternalFormats();
 
-ColorWriteFunction GetColorWriteFunction(GLenum format, GLenum type, GLuint clientVersion);
+ColorWriteFunction GetColorWriteFunction(GLenum format, GLenum type);
 
 }
 
diff --git a/src/libGLESv2/libGLESv2.cpp b/src/libGLESv2/libGLESv2.cpp
index a87ff60..5bd564f 100644
--- a/src/libGLESv2/libGLESv2.cpp
+++ b/src/libGLESv2/libGLESv2.cpp
@@ -858,7 +858,7 @@
                 return;
             }
 
-            if (imageSize < 0 || imageSize != (GLsizei)gl::GetBlockSize(internalformat, GL_UNSIGNED_BYTE, context->getClientVersion(), width, height))
+            if (imageSize < 0 || imageSize != (GLsizei)gl::GetBlockSize(internalformat, GL_UNSIGNED_BYTE, width, height))
             {
                 return gl::error(GL_INVALID_VALUE);
             }
@@ -923,7 +923,7 @@
                 return;
             }
 
-            if (imageSize < 0 || imageSize != (GLsizei)gl::GetBlockSize(format, GL_UNSIGNED_BYTE, context->getClientVersion(), width, height))
+            if (imageSize < 0 || imageSize != (GLsizei)gl::GetBlockSize(format, GL_UNSIGNED_BYTE, width, height))
             {
                 return gl::error(GL_INVALID_VALUE);
             }
@@ -2012,14 +2012,13 @@
                           internalFormat == GL_ALPHA8_EXT;
 
             if (formatCaps.depthRendering || !formatCaps.filtering || (!formatCaps.colorRendering && !isLUMA) ||
-                gl::IsFormatCompressed(internalFormat, context->getClientVersion()))
+                gl::IsFormatCompressed(internalFormat))
             {
                 return gl::error(GL_INVALID_OPERATION);
             }
 
             // GL_EXT_sRGB does not support mipmap generation on sRGB textures
-            if (context->getClientVersion() == 2 &&
-                gl::GetColorEncoding(internalFormat, context->getClientVersion()) == GL_SRGB)
+            if (context->getClientVersion() == 2 && gl::GetColorEncoding(internalFormat) == GL_SRGB)
             {
                 return gl::error(GL_INVALID_OPERATION);
             }
@@ -2790,27 +2789,27 @@
                     break;
 
                   case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE:
-                    *params = attachmentObject->getRedSize(clientVersion);
+                    *params = attachmentObject->getRedSize();
                     break;
 
                   case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:
-                    *params = attachmentObject->getGreenSize(clientVersion);
+                    *params = attachmentObject->getGreenSize();
                     break;
 
                   case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:
-                    *params = attachmentObject->getBlueSize(clientVersion);
+                    *params = attachmentObject->getBlueSize();
                     break;
 
                   case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:
-                    *params = attachmentObject->getAlphaSize(clientVersion);
+                    *params = attachmentObject->getAlphaSize();
                     break;
 
                   case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:
-                    *params = attachmentObject->getDepthSize(clientVersion);
+                    *params = attachmentObject->getDepthSize();
                     break;
 
                   case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:
-                    *params = attachmentObject->getStencilSize(clientVersion);
+                    *params = attachmentObject->getStencilSize();
                     break;
 
                   case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:
@@ -2818,11 +2817,11 @@
                     {
                         gl::error(GL_INVALID_OPERATION);
                     }
-                    *params = attachmentObject->getComponentType(clientVersion);
+                    *params = attachmentObject->getComponentType();
                     break;
 
                   case GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:
-                    *params = attachmentObject->getColorEncoding(clientVersion);
+                    *params = attachmentObject->getColorEncoding();
                     break;
 
                   case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:
@@ -6095,7 +6094,7 @@
                 return gl::error(GL_INVALID_OPERATION);
             }
 
-            if (imageSize < 0 || imageSize != (GLsizei)gl::GetBlockSize(internalformat, GL_UNSIGNED_BYTE, context->getClientVersion(), width, height))
+            if (imageSize < 0 || imageSize != (GLsizei)gl::GetBlockSize(internalformat, GL_UNSIGNED_BYTE, width, height))
             {
                 return gl::error(GL_INVALID_VALUE);
             }
@@ -6152,7 +6151,7 @@
                 return gl::error(GL_INVALID_OPERATION);
             }
 
-            if (imageSize < 0 || imageSize != (GLsizei)gl::GetBlockSize(format, GL_UNSIGNED_BYTE, context->getClientVersion(), width, height))
+            if (imageSize < 0 || imageSize != (GLsizei)gl::GetBlockSize(format, GL_UNSIGNED_BYTE, width, height))
             {
                 return gl::error(GL_INVALID_VALUE);
             }
diff --git a/src/libGLESv2/renderer/d3d/d3d11/Blit11.cpp b/src/libGLESv2/renderer/d3d/d3d11/Blit11.cpp
index 0eff838..2199dd8 100644
--- a/src/libGLESv2/renderer/d3d/d3d11/Blit11.cpp
+++ b/src/libGLESv2/renderer/d3d/d3d11/Blit11.cpp
@@ -377,10 +377,10 @@
 
     D3D11_SHADER_RESOURCE_VIEW_DESC sourceSRVDesc;
     source->GetDesc(&sourceSRVDesc);
-    GLenum sourceInternalFormat = d3d11_gl::GetInternalFormat(sourceSRVDesc.Format, mRenderer->getCurrentClientVersion());
+    GLenum sourceInternalFormat = d3d11_gl::GetInternalFormat(sourceSRVDesc.Format);
 
     GLenum shaderType = GL_NONE;
-    switch (gl::GetComponentType(sourceInternalFormat, mRenderer->getCurrentClientVersion()))
+    switch (gl::GetComponentType(sourceInternalFormat))
     {
       case GL_UNSIGNED_NORMALIZED:
       case GL_SIGNED_NORMALIZED:
@@ -516,11 +516,11 @@
     // be GL_XXXX_INTEGER but it does not tell us if it is signed or unsigned.
     D3D11_SHADER_RESOURCE_VIEW_DESC sourceSRVDesc;
     source->GetDesc(&sourceSRVDesc);
-    GLenum sourceInternalFormat = d3d11_gl::GetInternalFormat(sourceSRVDesc.Format, mRenderer->getCurrentClientVersion());
+    GLenum sourceInternalFormat = d3d11_gl::GetInternalFormat(sourceSRVDesc.Format);
 
     BlitParameters parameters = { 0 };
     parameters.mDestinationFormat = destFormat;
-    parameters.mSignedInteger = gl::GetComponentType(sourceInternalFormat, mRenderer->getCurrentClientVersion()) == GL_INT;
+    parameters.mSignedInteger = gl::GetComponentType(sourceInternalFormat) == GL_INT;
     parameters.m3DBlit = sourceArea.depth > 1;
 
     BlitShaderMap::const_iterator i = mBlitShaderMap.find(parameters);
diff --git a/src/libGLESv2/renderer/d3d/d3d11/Clear11.cpp b/src/libGLESv2/renderer/d3d/d3d11/Clear11.cpp
index 37eb1b1..2f241f9 100644
--- a/src/libGLESv2/renderer/d3d/d3d11/Clear11.cpp
+++ b/src/libGLESv2/renderer/d3d/d3d11/Clear11.cpp
@@ -200,8 +200,6 @@
                                                              clearParams.scissor.x + clearParams.scissor.width < framebufferSize.width ||
                                                              clearParams.scissor.y + clearParams.scissor.height < framebufferSize.height);
 
-    GLuint clientVersion = mRenderer->getCurrentClientVersion();
-
     std::vector<RenderTarget11*> maskedClearRenderTargets;
     RenderTarget11* maskedClearDepthStencil = NULL;
 
@@ -223,7 +221,7 @@
 
                 GLenum internalFormat = attachment->getInternalFormat();
                 GLenum actualFormat = attachment->getActualFormat();
-                GLenum componentType = gl::GetComponentType(internalFormat, clientVersion);
+                GLenum componentType = gl::GetComponentType(internalFormat);
                 if (clearParams.colorClearType == GL_FLOAT &&
                     !(componentType == GL_FLOAT || componentType == GL_UNSIGNED_NORMALIZED || componentType == GL_SIGNED_NORMALIZED))
                 {
@@ -231,10 +229,10 @@
                         "point to floating point values (color attachment %u has internal format 0x%X).", colorAttachment, internalFormat);
                 }
 
-                GLuint internalRedBits = gl::GetRedBits(internalFormat, clientVersion);
-                GLuint internalGreenBits = gl::GetGreenBits(internalFormat, clientVersion);
-                GLuint internalBlueBits = gl::GetBlueBits(internalFormat, clientVersion);
-                GLuint internalAlphaBits = gl::GetAlphaBits(internalFormat, clientVersion);
+                GLuint internalRedBits = gl::GetRedBits(internalFormat);
+                GLuint internalGreenBits = gl::GetGreenBits(internalFormat);
+                GLuint internalBlueBits = gl::GetBlueBits(internalFormat);
+                GLuint internalAlphaBits = gl::GetAlphaBits(internalFormat);
 
                 if ((internalRedBits   == 0 || !clearParams.colorMaskRed) &&
                     (internalGreenBits == 0 || !clearParams.colorMaskGreen) &&
@@ -266,10 +264,10 @@
 
                     // Check if the actual format has a channel that the internal format does not and set them to the
                     // default values
-                    GLuint actualRedBits   = gl::GetRedBits(actualFormat, clientVersion);
-                    GLuint actualGreenBits = gl::GetGreenBits(actualFormat, clientVersion);
-                    GLuint actualBlueBits  = gl::GetBlueBits(actualFormat, clientVersion);
-                    GLuint actualAlphaBits = gl::GetAlphaBits(actualFormat, clientVersion);
+                    GLuint actualRedBits   = gl::GetRedBits(actualFormat);
+                    GLuint actualGreenBits = gl::GetGreenBits(actualFormat);
+                    GLuint actualBlueBits  = gl::GetBlueBits(actualFormat);
+                    GLuint actualAlphaBits = gl::GetAlphaBits(actualFormat);
 
                     const float clearValues[4] =
                     {
@@ -299,7 +297,7 @@
 
             GLenum actualFormat = attachment->getActualFormat();
 
-            unsigned int stencilUnmasked = frameBuffer->hasStencil() ? (1 << gl::GetStencilBits(actualFormat, clientVersion)) - 1 : 0;
+            unsigned int stencilUnmasked = frameBuffer->hasStencil() ? (1 << gl::GetStencilBits(actualFormat)) - 1 : 0;
             bool needMaskedStencilClear = clearParams.clearStencil && (clearParams.stencilWriteMask & stencilUnmasked) != stencilUnmasked;
 
             if (needScissoredClear || needMaskedStencilClear)
@@ -451,8 +449,6 @@
 
 ID3D11BlendState *Clear11::getBlendState(const gl::ClearParameters &clearParams, const std::vector<RenderTarget11*>& rts)
 {
-    GLuint clientVersion = mRenderer->getCurrentClientVersion();
-
     ClearBlendInfo blendKey = { 0 };
     for (unsigned int i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; i++)
     {
@@ -460,10 +456,10 @@
         {
             GLint internalFormat = rts[i]->getInternalFormat();
 
-            blendKey.maskChannels[i][0] = clearParams.clearColor ? (clearParams.colorMaskRed   && gl::GetRedBits(internalFormat, clientVersion)   > 0) : false;
-            blendKey.maskChannels[i][1] = clearParams.clearColor ? (clearParams.colorMaskGreen && gl::GetGreenBits(internalFormat, clientVersion) > 0) : false;
-            blendKey.maskChannels[i][2] = clearParams.clearColor ? (clearParams.colorMaskBlue  && gl::GetBlueBits(internalFormat, clientVersion)  > 0) : false;
-            blendKey.maskChannels[i][3] = clearParams.clearColor ? (clearParams.colorMaskAlpha && gl::GetAlphaBits(internalFormat, clientVersion) > 0) : false;
+            blendKey.maskChannels[i][0] = clearParams.clearColor ? (clearParams.colorMaskRed   && gl::GetRedBits(internalFormat)   > 0) : false;
+            blendKey.maskChannels[i][1] = clearParams.clearColor ? (clearParams.colorMaskGreen && gl::GetGreenBits(internalFormat) > 0) : false;
+            blendKey.maskChannels[i][2] = clearParams.clearColor ? (clearParams.colorMaskBlue  && gl::GetBlueBits(internalFormat)  > 0) : false;
+            blendKey.maskChannels[i][3] = clearParams.clearColor ? (clearParams.colorMaskAlpha && gl::GetAlphaBits(internalFormat) > 0) : false;
         }
         else
         {
diff --git a/src/libGLESv2/renderer/d3d/d3d11/Image11.cpp b/src/libGLESv2/renderer/d3d/d3d11/Image11.cpp
index a159c36..4cc5ba7 100644
--- a/src/libGLESv2/renderer/d3d/d3d11/Image11.cpp
+++ b/src/libGLESv2/renderer/d3d/d3d11/Image11.cpp
@@ -40,7 +40,7 @@
     return static_cast<rx::Image11*>(img);
 }
 
-void Image11::generateMipmap(GLuint clientVersion, Image11 *dest, Image11 *src)
+void Image11::generateMipmap(Image11 *dest, Image11 *src)
 {
     ASSERT(src->getDXGIFormat() == dest->getDXGIFormat());
     ASSERT(src->getWidth() == 1 || src->getWidth() / 2 == dest->getWidth());
@@ -118,7 +118,6 @@
         forceRelease)
     {
         mRenderer = Renderer11::makeRenderer11(renderer);
-        GLuint clientVersion = mRenderer->getCurrentClientVersion();
 
         mWidth = width;
         mHeight = height;
@@ -127,9 +126,9 @@
         mTarget = target;
 
         // compute the d3d format that will be used
-        mDXGIFormat = gl_d3d11::GetTexFormat(internalformat, clientVersion);
-        mActualFormat = d3d11_gl::GetInternalFormat(mDXGIFormat, clientVersion);
-        mRenderable = gl_d3d11::GetRTVFormat(internalformat, clientVersion) != DXGI_FORMAT_UNKNOWN;
+        mDXGIFormat = gl_d3d11::GetTexFormat(internalformat);
+        mActualFormat = d3d11_gl::GetInternalFormat(mDXGIFormat);
+        mRenderable = gl_d3d11::GetRTVFormat(internalformat) != DXGI_FORMAT_UNKNOWN;
 
         SafeRelease(mStagingTexture);
         mDirty = gl_d3d11::RequiresTextureDataInitialization(mInternalFormat);
@@ -154,12 +153,11 @@
 void Image11::loadData(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth,
                        GLint unpackAlignment, GLenum type, const void *input)
 {
-    GLuint clientVersion = mRenderer->getCurrentClientVersion();
-    GLsizei inputRowPitch = gl::GetRowPitch(mInternalFormat, type, clientVersion, width, unpackAlignment);
-    GLsizei inputDepthPitch = gl::GetDepthPitch(mInternalFormat, type, clientVersion, width, height, unpackAlignment);
+    GLsizei inputRowPitch = gl::GetRowPitch(mInternalFormat, type, width, unpackAlignment);
+    GLsizei inputDepthPitch = gl::GetDepthPitch(mInternalFormat, type, width, height, unpackAlignment);
     GLuint outputPixelSize = d3d11::GetFormatPixelBytes(mDXGIFormat);
 
-    LoadImageFunction loadFunction = d3d11::GetImageLoadFunction(mInternalFormat, type, clientVersion);
+    LoadImageFunction loadFunction = d3d11::GetImageLoadFunction(mInternalFormat, type);
     ASSERT(loadFunction != NULL);
 
     D3D11_MAPPED_SUBRESOURCE mappedImage;
@@ -179,9 +177,8 @@
 void Image11::loadCompressedData(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth,
                                  const void *input)
 {
-    GLuint clientVersion = mRenderer->getCurrentClientVersion();
-    GLsizei inputRowPitch = gl::GetRowPitch(mInternalFormat, GL_UNSIGNED_BYTE, clientVersion, width, 1);
-    GLsizei inputDepthPitch = gl::GetDepthPitch(mInternalFormat, GL_UNSIGNED_BYTE, clientVersion, width, height, 1);
+    GLsizei inputRowPitch = gl::GetRowPitch(mInternalFormat, GL_UNSIGNED_BYTE, width, 1);
+    GLsizei inputDepthPitch = gl::GetDepthPitch(mInternalFormat, GL_UNSIGNED_BYTE, width, height, 1);
 
     GLuint outputPixelSize = d3d11::GetFormatPixelBytes(mDXGIFormat);
     GLuint outputBlockWidth = d3d11::GetBlockWidth(mDXGIFormat);
@@ -190,7 +187,7 @@
     ASSERT(xoffset % outputBlockWidth == 0);
     ASSERT(yoffset % outputBlockHeight == 0);
 
-    LoadImageFunction loadFunction = d3d11::GetImageLoadFunction(mInternalFormat, GL_UNSIGNED_BYTE, clientVersion);
+    LoadImageFunction loadFunction = d3d11::GetImageLoadFunction(mInternalFormat, GL_UNSIGNED_BYTE);
     ASSERT(loadFunction != NULL);
 
     D3D11_MAPPED_SUBRESOURCE mappedImage;
@@ -287,12 +284,11 @@
         }
 
         // determine the offset coordinate into the destination buffer
-        GLuint clientVersion = mRenderer->getCurrentClientVersion();
-        GLsizei rowOffset = gl::GetPixelBytes(mActualFormat, clientVersion) * xoffset;
+        GLsizei rowOffset = gl::GetPixelBytes(mActualFormat) * xoffset;
         void *dataOffset = static_cast<unsigned char*>(mappedImage.pData) + mappedImage.RowPitch * yoffset + rowOffset + zoffset * mappedImage.DepthPitch;
 
-        GLenum format = gl::GetFormat(mInternalFormat, clientVersion);
-        GLenum type = gl::GetType(mInternalFormat, clientVersion);
+        GLenum format = gl::GetFormat(mInternalFormat);
+        GLenum type = gl::GetType(mInternalFormat);
 
         mRenderer->readPixels(source, x, y, width, height, format, type, mappedImage.RowPitch, gl::PixelPackState(), dataOffset);
 
@@ -354,8 +350,8 @@
             {
                 std::vector<D3D11_SUBRESOURCE_DATA> initialData;
                 std::vector< std::vector<BYTE> > textureData;
-                d3d11::GenerateInitialTextureData(mInternalFormat, mRenderer->getCurrentClientVersion(), width, height,
-                                                  mDepth, lodOffset + 1, &initialData, &textureData);
+                d3d11::GenerateInitialTextureData(mInternalFormat, width, height, mDepth,
+                                                  lodOffset + 1, &initialData, &textureData);
 
                 result = device->CreateTexture3D(&desc, initialData.data(), &newTexture);
             }
@@ -395,8 +391,8 @@
             {
                 std::vector<D3D11_SUBRESOURCE_DATA> initialData;
                 std::vector< std::vector<BYTE> > textureData;
-                d3d11::GenerateInitialTextureData(mInternalFormat, mRenderer->getCurrentClientVersion(), width, height,
-                                                  1, lodOffset + 1, &initialData, &textureData);
+                d3d11::GenerateInitialTextureData(mInternalFormat, width, height, 1,
+                                                  lodOffset + 1, &initialData, &textureData);
 
                 result = device->CreateTexture2D(&desc, initialData.data(), &newTexture);
             }
diff --git a/src/libGLESv2/renderer/d3d/d3d11/Image11.h b/src/libGLESv2/renderer/d3d/d3d11/Image11.h
index 300774c..0ac7ac0 100644
--- a/src/libGLESv2/renderer/d3d/d3d11/Image11.h
+++ b/src/libGLESv2/renderer/d3d/d3d11/Image11.h
@@ -34,7 +34,7 @@
 
     static Image11 *makeImage11(Image *img);
 
-    static void generateMipmap(GLuint clientVersion, Image11 *dest, Image11 *src);
+    static void generateMipmap(Image11 *dest, Image11 *src);
 
     virtual bool isDirty() const;
 
diff --git a/src/libGLESv2/renderer/d3d/d3d11/PixelTransfer11.cpp b/src/libGLESv2/renderer/d3d/d3d11/PixelTransfer11.cpp
index 66107ff..566ec26 100644
--- a/src/libGLESv2/renderer/d3d/d3d11/PixelTransfer11.cpp
+++ b/src/libGLESv2/renderer/d3d/d3d11/PixelTransfer11.cpp
@@ -122,7 +122,7 @@
     float texelCenterX = 0.5f / static_cast<float>(destSize.width - 1);
     float texelCenterY = 0.5f / static_cast<float>(destSize.height - 1);
 
-    unsigned int bytesPerPixel = gl::GetPixelBytes(internalFormat, 3);
+    unsigned int bytesPerPixel = gl::GetPixelBytes(internalFormat);
     unsigned int alignmentBytes = static_cast<unsigned int>(unpack.alignment);
     unsigned int alignmentPixels = (alignmentBytes <= bytesPerPixel ? 1 : alignmentBytes / bytesPerPixel);
 
@@ -148,7 +148,6 @@
         return false;
     }
 
-    int clientVersion = mRenderer->getCurrentClientVersion();
     const gl::Buffer &sourceBuffer = *unpack.pixelBuffer.get();
 
     ASSERT(mRenderer->supportsFastCopyBufferToTexture(destinationFormat));
@@ -158,10 +157,10 @@
 
     // The SRV must be in the proper read format, which may be different from the destination format
     // EG: for half float data, we can load full precision floats with implicit conversion
-    GLenum unsizedFormat = gl::GetFormat(destinationFormat, clientVersion);
-    GLenum sourceFormat = gl::GetSizedInternalFormat(unsizedFormat, sourcePixelsType, clientVersion);
+    GLenum unsizedFormat = gl::GetFormat(destinationFormat);
+    GLenum sourceFormat = gl::GetSizedInternalFormat(unsizedFormat, sourcePixelsType);
 
-    DXGI_FORMAT srvFormat = gl_d3d11::GetSRVFormat(sourceFormat, clientVersion);
+    DXGI_FORMAT srvFormat = gl_d3d11::GetSRVFormat(sourceFormat);
     ASSERT(srvFormat != DXGI_FORMAT_UNKNOWN);
     BufferStorage11 *bufferStorage11 = BufferStorage11::makeBufferStorage11(sourceBuffer.getStorage());
     ID3D11ShaderResourceView *bufferSRV = bufferStorage11->getSRV(srvFormat);
@@ -237,8 +236,7 @@
 
 ID3D11PixelShader *PixelTransfer11::findBufferToTexturePS(GLenum internalFormat) const
 {
-    int clientVersion = mRenderer->getCurrentClientVersion();
-    GLenum componentType = gl::GetComponentType(internalFormat, clientVersion);
+    GLenum componentType = gl::GetComponentType(internalFormat);
 
     if (componentType == GL_SIGNED_NORMALIZED || componentType == GL_UNSIGNED_NORMALIZED)
     {
diff --git a/src/libGLESv2/renderer/d3d/d3d11/RenderStateCache.cpp b/src/libGLESv2/renderer/d3d/d3d11/RenderStateCache.cpp
index 7b6ad78..78a7357 100644
--- a/src/libGLESv2/renderer/d3d/d3d11/RenderStateCache.cpp
+++ b/src/libGLESv2/renderer/d3d/d3d11/RenderStateCache.cpp
@@ -38,7 +38,7 @@
 const unsigned int RenderStateCache::kMaxDepthStencilStates = 4096;
 const unsigned int RenderStateCache::kMaxSamplerStates = 4096;
 
-RenderStateCache::RenderStateCache() : mRenderer(NULL), mCounter(0),
+RenderStateCache::RenderStateCache() : mDevice(NULL), mCounter(0),
                                        mBlendStateCache(kMaxBlendStates, hashBlendState, compareBlendStates),
                                        mRasterizerStateCache(kMaxRasterizerStates, hashRasterizerState, compareRasterizerStates),
                                        mDepthStencilStateCache(kMaxDepthStencilStates, hashDepthStencilState, compareDepthStencilStates),
@@ -51,10 +51,10 @@
     clear();
 }
 
-void RenderStateCache::initialize(Renderer11 *renderer)
+void RenderStateCache::initialize(ID3D11Device *device)
 {
     clear();
-    mRenderer = renderer;
+    mDevice = device;
 }
 
 void RenderStateCache::clear()
@@ -81,7 +81,7 @@
 
 ID3D11BlendState *RenderStateCache::getBlendState(const gl::Framebuffer *framebuffer, const gl::BlendState &blendState)
 {
-    if (!mRenderer)
+    if (!mDevice)
     {
         ERR("RenderStateCache is not initialized.");
         return NULL;
@@ -89,8 +89,6 @@
 
     bool mrt = false;
 
-    int clientVersion = mRenderer->getCurrentClientVersion();
-
     BlendStateKey key = { 0 };
     key.blendState = blendState;
     for (unsigned int i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; i++)
@@ -103,10 +101,10 @@
                 mrt = true;
             }
 
-            key.rtChannels[i][0] = attachment->getRedSize(clientVersion)   > 0;
-            key.rtChannels[i][1] = attachment->getGreenSize(clientVersion) > 0;
-            key.rtChannels[i][2] = attachment->getBlueSize(clientVersion)  > 0;
-            key.rtChannels[i][3] = attachment->getAlphaSize(clientVersion) > 0;
+            key.rtChannels[i][0] = attachment->getRedSize()   > 0;
+            key.rtChannels[i][1] = attachment->getGreenSize() > 0;
+            key.rtChannels[i][2] = attachment->getBlueSize()  > 0;
+            key.rtChannels[i][3] = attachment->getAlphaSize() > 0;
         }
         else
         {
@@ -171,8 +169,7 @@
         }
 
         ID3D11BlendState *dx11BlendState = NULL;
-        ID3D11Device *device = mRenderer->getDevice();
-        HRESULT result = device->CreateBlendState(&blendDesc, &dx11BlendState);
+        HRESULT result = mDevice->CreateBlendState(&blendDesc, &dx11BlendState);
         if (FAILED(result) || !dx11BlendState)
         {
             ERR("Unable to create a ID3D11BlendState, HRESULT: 0x%X.", result);
@@ -201,7 +198,7 @@
 
 ID3D11RasterizerState *RenderStateCache::getRasterizerState(const gl::RasterizerState &rasterState, bool scissorEnabled)
 {
-    if (!mRenderer)
+    if (!mDevice)
     {
         ERR("RenderStateCache is not initialized.");
         return NULL;
@@ -267,8 +264,7 @@
         }
 
         ID3D11RasterizerState *dx11RasterizerState = NULL;
-        ID3D11Device *device = mRenderer->getDevice();
-        HRESULT result = device->CreateRasterizerState(&rasterDesc, &dx11RasterizerState);
+        HRESULT result = mDevice->CreateRasterizerState(&rasterDesc, &dx11RasterizerState);
         if (FAILED(result) || !dx11RasterizerState)
         {
             ERR("Unable to create a ID3D11RasterizerState, HRESULT: 0x%X.", result);
@@ -297,7 +293,7 @@
 
 ID3D11DepthStencilState *RenderStateCache::getDepthStencilState(const gl::DepthStencilState &dsState)
 {
-    if (!mRenderer)
+    if (!mDevice)
     {
         ERR("RenderStateCache is not initialized.");
         return NULL;
@@ -346,8 +342,7 @@
         dsDesc.BackFace.StencilFunc = gl_d3d11::ConvertComparison(dsState.stencilBackFunc);
 
         ID3D11DepthStencilState *dx11DepthStencilState = NULL;
-        ID3D11Device *device = mRenderer->getDevice();
-        HRESULT result = device->CreateDepthStencilState(&dsDesc, &dx11DepthStencilState);
+        HRESULT result = mDevice->CreateDepthStencilState(&dsDesc, &dx11DepthStencilState);
         if (FAILED(result) || !dx11DepthStencilState)
         {
             ERR("Unable to create a ID3D11DepthStencilState, HRESULT: 0x%X.", result);
@@ -376,7 +371,7 @@
 
 ID3D11SamplerState *RenderStateCache::getSamplerState(const gl::SamplerState &samplerState)
 {
-    if (!mRenderer)
+    if (!mDevice)
     {
         ERR("RenderStateCache is not initialized.");
         return NULL;
@@ -425,8 +420,7 @@
         samplerDesc.MaxLOD = samplerState.maxLod;
 
         ID3D11SamplerState *dx11SamplerState = NULL;
-        ID3D11Device *device = mRenderer->getDevice();
-        HRESULT result = device->CreateSamplerState(&samplerDesc, &dx11SamplerState);
+        HRESULT result = mDevice->CreateSamplerState(&samplerDesc, &dx11SamplerState);
         if (FAILED(result) || !dx11SamplerState)
         {
             ERR("Unable to create a ID3D11DepthStencilState, HRESULT: 0x%X.", result);
diff --git a/src/libGLESv2/renderer/d3d/d3d11/RenderStateCache.h b/src/libGLESv2/renderer/d3d/d3d11/RenderStateCache.h
index b96be8e..e6380fb 100644
--- a/src/libGLESv2/renderer/d3d/d3d11/RenderStateCache.h
+++ b/src/libGLESv2/renderer/d3d/d3d11/RenderStateCache.h
@@ -28,7 +28,7 @@
     RenderStateCache();
     virtual ~RenderStateCache();
 
-    void initialize(Renderer11 *renderer);
+    void initialize(ID3D11Device *device);
     void clear();
 
     ID3D11BlendState *getBlendState(const gl::Framebuffer *framebuffer, const gl::BlendState &blendState);
@@ -101,7 +101,7 @@
                                SamplerStateEqualityFunction> SamplerStateMap;
     SamplerStateMap mSamplerStateCache;
 
-    Renderer11 *mRenderer;
+    ID3D11Device *mDevice;
 };
 
 }
diff --git a/src/libGLESv2/renderer/d3d/d3d11/RenderTarget11.cpp b/src/libGLESv2/renderer/d3d/d3d11/RenderTarget11.cpp
index e349ac2..6aa75ae 100644
--- a/src/libGLESv2/renderer/d3d/d3d11/RenderTarget11.cpp
+++ b/src/libGLESv2/renderer/d3d/d3d11/RenderTarget11.cpp
@@ -219,8 +219,8 @@
         mDepth = depth;
         mSamples = samples;
 
-        mInternalFormat = d3d11_gl::GetInternalFormat(desc.Format, renderer->getCurrentClientVersion());
-        mActualFormat = d3d11_gl::GetInternalFormat(desc.Format, renderer->getCurrentClientVersion());
+        mInternalFormat = d3d11_gl::GetInternalFormat(desc.Format);
+        mActualFormat = d3d11_gl::GetInternalFormat(desc.Format);
     }
 }
 
@@ -265,8 +265,8 @@
         mDepth = depth;
         mSamples = samples;
 
-        mInternalFormat = d3d11_gl::GetInternalFormat(desc.Format, renderer->getCurrentClientVersion());
-        mActualFormat = d3d11_gl::GetInternalFormat(desc.Format, renderer->getCurrentClientVersion());
+        mInternalFormat = d3d11_gl::GetInternalFormat(desc.Format);
+        mActualFormat = d3d11_gl::GetInternalFormat(desc.Format);
     }
 }
 
@@ -278,12 +278,10 @@
     mDepthStencil = NULL;
     mShaderResource = NULL;
 
-    GLuint clientVersion = mRenderer->getCurrentClientVersion();
-
-    DXGI_FORMAT texFormat = gl_d3d11::GetTexFormat(internalFormat, clientVersion);
-    DXGI_FORMAT srvFormat = gl_d3d11::GetSRVFormat(internalFormat, clientVersion);
-    DXGI_FORMAT rtvFormat = gl_d3d11::GetRTVFormat(internalFormat, clientVersion);
-    DXGI_FORMAT dsvFormat = gl_d3d11::GetDSVFormat(internalFormat, clientVersion);
+    DXGI_FORMAT texFormat = gl_d3d11::GetTexFormat(internalFormat);
+    DXGI_FORMAT srvFormat = gl_d3d11::GetSRVFormat(internalFormat);
+    DXGI_FORMAT rtvFormat = gl_d3d11::GetRTVFormat(internalFormat);
+    DXGI_FORMAT dsvFormat = gl_d3d11::GetDSVFormat(internalFormat);
 
     DXGI_FORMAT multisampleFormat = (dsvFormat != DXGI_FORMAT_UNKNOWN ? dsvFormat : rtvFormat);
     int supportedSamples = mRenderer->getNearestSupportedSamples(multisampleFormat, samples);
@@ -408,7 +406,7 @@
     mDepth = 1;
     mInternalFormat = internalFormat;
     mSamples = supportedSamples;
-    mActualFormat = d3d11_gl::GetInternalFormat(texFormat, renderer->getCurrentClientVersion());
+    mActualFormat = d3d11_gl::GetInternalFormat(texFormat);
     mSubresourceIndex = D3D11CalcSubresource(0, 0, 1);
 }
 
diff --git a/src/libGLESv2/renderer/d3d/d3d11/Renderer11.cpp b/src/libGLESv2/renderer/d3d/d3d11/Renderer11.cpp
index b26a8ae..092a028 100644
--- a/src/libGLESv2/renderer/d3d/d3d11/Renderer11.cpp
+++ b/src/libGLESv2/renderer/d3d/d3d11/Renderer11.cpp
@@ -292,7 +292,7 @@
 // to reset the scene status and ensure the default states are reset.
 void Renderer11::initializeDevice()
 {
-    mStateCache.initialize(this);
+    mStateCache.initialize(mDevice);
     mInputLayoutCache.initialize(mDevice, mDeviceContext);
 
     ASSERT(!mVertexDataManager && !mIndexDataManager);
@@ -342,13 +342,9 @@
 
                 if (depthStencilFormatOK)
                 {
-                    // FIXME: parse types from context version
-                    ASSERT(d3d11_gl::GetInternalFormat(renderTargetFormat, 2) == d3d11_gl::GetInternalFormat(renderTargetFormat, 3));
-                    ASSERT(d3d11_gl::GetInternalFormat(depthStencilFormat, 2) == d3d11_gl::GetInternalFormat(depthStencilFormat, 3));
-
                     ConfigDesc newConfig;
-                    newConfig.renderTargetFormat = d3d11_gl::GetInternalFormat(renderTargetFormat, getCurrentClientVersion());
-                    newConfig.depthStencilFormat = d3d11_gl::GetInternalFormat(depthStencilFormat, getCurrentClientVersion());
+                    newConfig.renderTargetFormat = d3d11_gl::GetInternalFormat(renderTargetFormat);
+                    newConfig.depthStencilFormat = d3d11_gl::GetInternalFormat(depthStencilFormat);
                     newConfig.multiSample = 0;     // FIXME: enumerate multi-sampling
                     newConfig.fastConfig = true;   // Assume all DX11 format conversions to be fast
                     newConfig.es3Capable = true;
@@ -2147,7 +2143,7 @@
 
 GLsizei Renderer11::getMaxSupportedFormatSamples(GLenum internalFormat) const
 {
-    DXGI_FORMAT format = gl_d3d11::GetRenderableFormat(internalFormat, getCurrentClientVersion());
+    DXGI_FORMAT format = gl_d3d11::GetRenderableFormat(internalFormat);
     MultisampleSupportMap::const_iterator iter = mMultisampleSupportMap.find(format);
     return (iter != mMultisampleSupportMap.end()) ? iter->second.maxSupportedSamples : 0;
 }
@@ -2157,10 +2153,10 @@
     unsigned int numCounts = 0;
 
     // D3D11 supports multisampling for signed and unsigned format, but ES 3.0 does not
-    GLenum componentType = gl::GetComponentType(internalFormat, getCurrentClientVersion());
+    GLenum componentType = gl::GetComponentType(internalFormat);
     if (componentType != GL_INT && componentType != GL_UNSIGNED_INT)
     {
-        DXGI_FORMAT format = gl_d3d11::GetRenderableFormat(internalFormat, getCurrentClientVersion());
+        DXGI_FORMAT format = gl_d3d11::GetRenderableFormat(internalFormat);
         MultisampleSupportMap::const_iterator iter = mMultisampleSupportMap.find(format);
 
         if (iter != mMultisampleSupportMap.end())
@@ -2182,13 +2178,13 @@
 void Renderer11::getSampleCounts(GLenum internalFormat, GLsizei bufSize, GLint *params) const
 {
     // D3D11 supports multisampling for signed and unsigned format, but ES 3.0 does not
-    GLenum componentType = gl::GetComponentType(internalFormat, getCurrentClientVersion());
+    GLenum componentType = gl::GetComponentType(internalFormat);
     if (componentType == GL_INT || componentType == GL_UNSIGNED_INT)
     {
         return;
     }
 
-    DXGI_FORMAT format = gl_d3d11::GetRenderableFormat(internalFormat, getCurrentClientVersion());
+    DXGI_FORMAT format = gl_d3d11::GetRenderableFormat(internalFormat);
     MultisampleSupportMap::const_iterator iter = mMultisampleSupportMap.find(format);
 
     if (iter != mMultisampleSupportMap.end())
@@ -2806,10 +2802,8 @@
 {
     ASSERT(getCaps().extensions.pixelBufferObject);
 
-    GLuint clientVersion = getCurrentClientVersion();
-
     // sRGB formats do not work with D3D11 buffer SRVs
-    if (gl::GetColorEncoding(internalFormat, clientVersion) == GL_SRGB)
+    if (gl::GetColorEncoding(internalFormat) == GL_SRGB)
     {
         return false;
     }
@@ -2821,7 +2815,7 @@
     }
 
     // We skip all 3-channel formats since sometimes format support is missing
-    if (gl::GetComponentCount(internalFormat, clientVersion) == 3)
+    if (gl::GetComponentCount(internalFormat) == 3)
     {
         return false;
     }
@@ -2988,7 +2982,7 @@
 {
     Image11 *dest11 = Image11::makeImage11(dest);
     Image11 *src11 = Image11::makeImage11(src);
-    Image11::generateMipmap(getCurrentClientVersion(), dest11, src11);
+    Image11::generateMipmap(dest11, src11);
 }
 
 TextureStorage *Renderer11::createTextureStorage2D(SwapChain *swapChain)
@@ -3141,13 +3135,11 @@
         inputPitch = static_cast<int>(mapping.RowPitch);
     }
 
-    GLuint clientVersion = getCurrentClientVersion();
+    GLenum sourceInternalFormat = d3d11_gl::GetInternalFormat(textureDesc.Format);
+    GLenum sourceFormat = gl::GetFormat(sourceInternalFormat);
+    GLenum sourceType = gl::GetType(sourceInternalFormat);
 
-    GLenum sourceInternalFormat = d3d11_gl::GetInternalFormat(textureDesc.Format, clientVersion);
-    GLenum sourceFormat = gl::GetFormat(sourceInternalFormat, clientVersion);
-    GLenum sourceType = gl::GetType(sourceInternalFormat, clientVersion);
-
-    GLuint sourcePixelSize = gl::GetPixelBytes(sourceInternalFormat, clientVersion);
+    GLuint sourcePixelSize = gl::GetPixelBytes(sourceInternalFormat);
 
     if (sourceFormat == params.format && sourceType == params.type)
     {
@@ -3159,8 +3151,8 @@
     }
     else
     {
-        GLenum destInternalFormat = gl::GetSizedInternalFormat(params.format, params.type, clientVersion);
-        GLuint destPixelSize = gl::GetPixelBytes(destInternalFormat, clientVersion);
+        GLenum destInternalFormat = gl::GetSizedInternalFormat(params.format, params.type);
+        GLuint destPixelSize = gl::GetPixelBytes(destInternalFormat);
 
         ColorCopyFunction fastCopyFunc = d3d11::GetFastCopyFunction(textureDesc.Format, params.format, params.type);
         if (fastCopyFunc)
@@ -3180,7 +3172,7 @@
         else
         {
             ColorReadFunction readFunc = d3d11::GetColorReadFunction(textureDesc.Format);
-            ColorWriteFunction writeFunc = gl::GetColorWriteFunction(params.format, params.type, clientVersion);
+            ColorWriteFunction writeFunc = gl::GetColorWriteFunction(params.format, params.type);
 
             unsigned char temp[16]; // Maximum size of any Color<T> type used.
             META_ASSERT(sizeof(temp) >= sizeof(gl::ColorF)  &&
@@ -3296,8 +3288,8 @@
                        drawRect.x < 0 || drawRect.x + drawRect.width > drawSize.width ||
                        drawRect.y < 0 || drawRect.y + drawRect.height > drawSize.height;
 
-    bool hasDepth = gl::GetDepthBits(drawRenderTarget11->getActualFormat(), getCurrentClientVersion()) > 0;
-    bool hasStencil = gl::GetStencilBits(drawRenderTarget11->getActualFormat(), getCurrentClientVersion()) > 0;
+    bool hasDepth = gl::GetDepthBits(drawRenderTarget11->getActualFormat()) > 0;
+    bool hasStencil = gl::GetStencilBits(drawRenderTarget11->getActualFormat()) > 0;
     bool partialDSBlit = (hasDepth && depthBlit) != (hasStencil && stencilBlit);
 
     if (readRenderTarget11->getActualFormat() == drawRenderTarget->getActualFormat() &&
@@ -3372,7 +3364,7 @@
         }
         else
         {
-            GLenum format = gl::GetFormat(drawRenderTarget->getInternalFormat(), getCurrentClientVersion());
+            GLenum format = gl::GetFormat(drawRenderTarget->getInternalFormat());
             result = mBlit->copyTexture(readSRV, readArea, readSize, drawRTV, drawArea, drawSize,
                                         scissor, format, filter);
         }
@@ -3485,8 +3477,7 @@
 
 GLenum Renderer11::getNativeTextureFormat(GLenum internalFormat) const
 {
-    int clientVersion = getCurrentClientVersion();
-    return d3d11_gl::GetInternalFormat(gl_d3d11::GetTexFormat(internalFormat, clientVersion), clientVersion);
+    return d3d11_gl::GetInternalFormat(gl_d3d11::GetTexFormat(internalFormat));
 }
 
 rx::VertexConversionType Renderer11::getVertexConversionType(const gl::VertexFormat &vertexFormat) const
diff --git a/src/libGLESv2/renderer/d3d/d3d11/SwapChain11.cpp b/src/libGLESv2/renderer/d3d/d3d11/SwapChain11.cpp
index 3e8e832..ed0c4ae 100644
--- a/src/libGLESv2/renderer/d3d/d3d11/SwapChain11.cpp
+++ b/src/libGLESv2/renderer/d3d/d3d11/SwapChain11.cpp
@@ -132,7 +132,7 @@
 
         if (offscreenTextureDesc.Width != (UINT)backbufferWidth
             || offscreenTextureDesc.Height != (UINT)backbufferHeight
-            || offscreenTextureDesc.Format != gl_d3d11::GetTexFormat(mBackBufferFormat, mRenderer->getCurrentClientVersion())
+            || offscreenTextureDesc.Format != gl_d3d11::GetTexFormat(mBackBufferFormat)
             || offscreenTextureDesc.MipLevels != 1
             || offscreenTextureDesc.ArraySize != 1)
         {
@@ -148,7 +148,7 @@
         D3D11_TEXTURE2D_DESC offscreenTextureDesc = {0};
         offscreenTextureDesc.Width = backbufferWidth;
         offscreenTextureDesc.Height = backbufferHeight;
-        offscreenTextureDesc.Format = gl_d3d11::GetTexFormat(mBackBufferFormat, mRenderer->getCurrentClientVersion());
+        offscreenTextureDesc.Format = gl_d3d11::GetTexFormat(mBackBufferFormat);
         offscreenTextureDesc.MipLevels = 1;
         offscreenTextureDesc.ArraySize = 1;
         offscreenTextureDesc.SampleDesc.Count = 1;
@@ -204,7 +204,7 @@
 
 
     D3D11_RENDER_TARGET_VIEW_DESC offscreenRTVDesc;
-    offscreenRTVDesc.Format = gl_d3d11::GetRTVFormat(mBackBufferFormat, mRenderer->getCurrentClientVersion());
+    offscreenRTVDesc.Format = gl_d3d11::GetRTVFormat(mBackBufferFormat);
     offscreenRTVDesc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D;
     offscreenRTVDesc.Texture2D.MipSlice = 0;
 
@@ -213,7 +213,7 @@
     d3d11::SetDebugName(mOffscreenRTView, "Offscreen back buffer render target");
 
     D3D11_SHADER_RESOURCE_VIEW_DESC offscreenSRVDesc;
-    offscreenSRVDesc.Format = gl_d3d11::GetSRVFormat(mBackBufferFormat, mRenderer->getCurrentClientVersion());
+    offscreenSRVDesc.Format = gl_d3d11::GetSRVFormat(mBackBufferFormat);
     offscreenSRVDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
     offscreenSRVDesc.Texture2D.MostDetailedMip = 0;
     offscreenSRVDesc.Texture2D.MipLevels = -1;
@@ -227,7 +227,7 @@
         D3D11_TEXTURE2D_DESC depthStencilTextureDesc;
         depthStencilTextureDesc.Width = backbufferWidth;
         depthStencilTextureDesc.Height = backbufferHeight;
-        depthStencilTextureDesc.Format = gl_d3d11::GetTexFormat(mDepthBufferFormat, mRenderer->getCurrentClientVersion());
+        depthStencilTextureDesc.Format = gl_d3d11::GetTexFormat(mDepthBufferFormat);
         depthStencilTextureDesc.MipLevels = 1;
         depthStencilTextureDesc.ArraySize = 1;
         depthStencilTextureDesc.SampleDesc.Count = 1;
@@ -255,7 +255,7 @@
         d3d11::SetDebugName(mDepthStencilTexture, "Offscreen depth stencil texture");
 
         D3D11_DEPTH_STENCIL_VIEW_DESC depthStencilDesc;
-        depthStencilDesc.Format = gl_d3d11::GetDSVFormat(mDepthBufferFormat, mRenderer->getCurrentClientVersion());
+        depthStencilDesc.Format = gl_d3d11::GetDSVFormat(mDepthBufferFormat);
         depthStencilDesc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D;
         depthStencilDesc.Flags = 0;
         depthStencilDesc.Texture2D.MipSlice = 0;
@@ -265,7 +265,7 @@
         d3d11::SetDebugName(mDepthStencilDSView, "Offscreen depth stencil view");
 
         D3D11_SHADER_RESOURCE_VIEW_DESC depthStencilSRVDesc;
-        depthStencilSRVDesc.Format = gl_d3d11::GetSRVFormat(mDepthBufferFormat, mRenderer->getCurrentClientVersion());
+        depthStencilSRVDesc.Format = gl_d3d11::GetSRVFormat(mDepthBufferFormat);
         depthStencilSRVDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
         depthStencilSRVDesc.Texture2D.MostDetailedMip = 0;
         depthStencilSRVDesc.Texture2D.MipLevels = -1;
@@ -325,7 +325,7 @@
     SafeRelease(mBackBufferRTView);
 
     // Resize swap chain
-    DXGI_FORMAT backbufferDXGIFormat = gl_d3d11::GetTexFormat(mBackBufferFormat, mRenderer->getCurrentClientVersion());
+    DXGI_FORMAT backbufferDXGIFormat = gl_d3d11::GetTexFormat(mBackBufferFormat);
     HRESULT result = mSwapChain->ResizeBuffers(1, backbufferWidth, backbufferHeight, backbufferDXGIFormat, 0);
 
     if (FAILED(result))
@@ -398,7 +398,7 @@
         swapChainDesc.BufferDesc.Height = backbufferHeight;
         swapChainDesc.BufferDesc.RefreshRate.Numerator = 0;
         swapChainDesc.BufferDesc.RefreshRate.Denominator = 1;
-        swapChainDesc.BufferDesc.Format = gl_d3d11::GetTexFormat(mBackBufferFormat, mRenderer->getCurrentClientVersion());
+        swapChainDesc.BufferDesc.Format = gl_d3d11::GetTexFormat(mBackBufferFormat);
         swapChainDesc.BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED;
         swapChainDesc.BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED;
         swapChainDesc.SampleDesc.Count = 1;
diff --git a/src/libGLESv2/renderer/d3d/d3d11/TextureStorage11.cpp b/src/libGLESv2/renderer/d3d/d3d11/TextureStorage11.cpp
index 5d0da76..8f32468 100644
--- a/src/libGLESv2/renderer/d3d/d3d11/TextureStorage11.cpp
+++ b/src/libGLESv2/renderer/d3d/d3d11/TextureStorage11.cpp
@@ -121,19 +121,19 @@
     return static_cast<TextureStorage11*>(storage);
 }
 
-DWORD TextureStorage11::GetTextureBindFlags(GLenum internalFormat, GLuint clientVersion, bool renderTarget)
+DWORD TextureStorage11::GetTextureBindFlags(GLenum internalFormat, bool renderTarget)
 {
     UINT bindFlags = 0;
 
-    if (gl_d3d11::GetSRVFormat(internalFormat, clientVersion) != DXGI_FORMAT_UNKNOWN)
+    if (gl_d3d11::GetSRVFormat(internalFormat) != DXGI_FORMAT_UNKNOWN)
     {
         bindFlags |= D3D11_BIND_SHADER_RESOURCE;
     }
-    if (gl_d3d11::GetDSVFormat(internalFormat, clientVersion) != DXGI_FORMAT_UNKNOWN)
+    if (gl_d3d11::GetDSVFormat(internalFormat) != DXGI_FORMAT_UNKNOWN)
     {
         bindFlags |= D3D11_BIND_DEPTH_STENCIL;
     }
-    if (gl_d3d11::GetRTVFormat(internalFormat, clientVersion) != DXGI_FORMAT_UNKNOWN && renderTarget)
+    if (gl_d3d11::GetRTVFormat(internalFormat) != DXGI_FORMAT_UNKNOWN && renderTarget)
     {
         bindFlags |= D3D11_BIND_RENDER_TARGET;
     }
@@ -355,8 +355,7 @@
             Blit11 *blitter = mRenderer->getBlitter();
 
             blitter->copyTexture(sourceSRV, sourceArea, sourceSize, destRTV, destArea, destSize, NULL,
-                                 gl::GetFormat(source->getInternalFormat(), mRenderer->getCurrentClientVersion()),
-                                 GL_LINEAR);
+                                 gl::GetFormat(source->getInternalFormat()), GL_LINEAR);
         }
     }
 }
@@ -401,18 +400,16 @@
     offscreenRTV->GetDesc(&rtvDesc);
     mRenderTargetFormat = rtvDesc.Format;
 
-    GLint internalFormat = d3d11_gl::GetInternalFormat(mTextureFormat, renderer->getCurrentClientVersion());
-    const gl::TextureCaps &formatCaps = renderer->getCaps().textureCaps.get(internalFormat);
-
-    mSwizzleTextureFormat = gl_d3d11::GetSwizzleTexFormat(internalFormat, formatCaps.colorRendering, renderer->getCurrentClientVersion());
-    mSwizzleShaderResourceFormat = gl_d3d11::GetSwizzleSRVFormat(internalFormat, formatCaps.colorRendering, renderer->getCurrentClientVersion());
-    mSwizzleRenderTargetFormat = gl_d3d11::GetSwizzleRTVFormat(internalFormat, formatCaps.colorRendering, renderer->getCurrentClientVersion());
+    GLenum internalFormat = d3d11_gl::GetInternalFormat(mTextureFormat);
+    mSwizzleTextureFormat = gl_d3d11::GetSwizzleTexFormat(internalFormat);
+    mSwizzleShaderResourceFormat = gl_d3d11::GetSwizzleSRVFormat(internalFormat);
+    mSwizzleRenderTargetFormat = gl_d3d11::GetSwizzleRTVFormat(internalFormat);
 
     mDepthStencilFormat = DXGI_FORMAT_UNKNOWN;
 }
 
 TextureStorage11_2D::TextureStorage11_2D(Renderer *renderer, GLenum internalformat, bool renderTarget, GLsizei width, GLsizei height, int levels)
-    : TextureStorage11(renderer, GetTextureBindFlags(internalformat, renderer->getCurrentClientVersion(), renderTarget))
+    : TextureStorage11(renderer, GetTextureBindFlags(internalformat, renderTarget))
 {
     mTexture = NULL;
     mSwizzleTexture = NULL;
@@ -423,17 +420,13 @@
         mSwizzleRenderTargets[i] = NULL;
     }
 
-    GLuint clientVersion = mRenderer->getCurrentClientVersion();
-
-    mTextureFormat = gl_d3d11::GetTexFormat(internalformat, clientVersion);
-    mShaderResourceFormat = gl_d3d11::GetSRVFormat(internalformat, clientVersion);
-    mDepthStencilFormat = gl_d3d11::GetDSVFormat(internalformat, clientVersion);
-    mRenderTargetFormat = gl_d3d11::GetRTVFormat(internalformat, clientVersion);
-
-    const gl::TextureCaps &formatCaps = renderer->getCaps().textureCaps.get(internalformat);
-    mSwizzleTextureFormat = gl_d3d11::GetSwizzleTexFormat(internalformat, formatCaps.colorRendering, clientVersion);
-    mSwizzleShaderResourceFormat = gl_d3d11::GetSwizzleSRVFormat(internalformat, formatCaps.colorRendering, clientVersion);
-    mSwizzleRenderTargetFormat = gl_d3d11::GetSwizzleRTVFormat(internalformat, formatCaps.colorRendering, clientVersion);
+    mTextureFormat = gl_d3d11::GetTexFormat(internalformat);
+    mShaderResourceFormat = gl_d3d11::GetSRVFormat(internalformat);
+    mDepthStencilFormat = gl_d3d11::GetDSVFormat(internalformat);
+    mRenderTargetFormat = gl_d3d11::GetRTVFormat(internalformat);
+    mSwizzleTextureFormat = gl_d3d11::GetSwizzleTexFormat(internalformat);
+    mSwizzleShaderResourceFormat = gl_d3d11::GetSwizzleSRVFormat(internalformat);
+    mSwizzleRenderTargetFormat = gl_d3d11::GetSwizzleRTVFormat(internalformat);
 
     // if the width or height is not positive this should be treated as an incomplete texture
     // we handle that here by skipping the d3d texture creation
@@ -683,7 +676,7 @@
 }
 
 TextureStorage11_Cube::TextureStorage11_Cube(Renderer *renderer, GLenum internalformat, bool renderTarget, int size, int levels)
-    : TextureStorage11(renderer, GetTextureBindFlags(internalformat, renderer->getCurrentClientVersion(), renderTarget))
+    : TextureStorage11(renderer, GetTextureBindFlags(internalformat, renderTarget))
 {
     mTexture = NULL;
     mSwizzleTexture = NULL;
@@ -697,17 +690,13 @@
         }
     }
 
-    GLuint clientVersion = mRenderer->getCurrentClientVersion();
-
-    mTextureFormat = gl_d3d11::GetTexFormat(internalformat, clientVersion);
-    mShaderResourceFormat = gl_d3d11::GetSRVFormat(internalformat, clientVersion);
-    mDepthStencilFormat = gl_d3d11::GetDSVFormat(internalformat, clientVersion);
-    mRenderTargetFormat = gl_d3d11::GetRTVFormat(internalformat, clientVersion);
-
-    const gl::TextureCaps &formatCaps = renderer->getCaps().textureCaps.get(internalformat);
-    mSwizzleTextureFormat = gl_d3d11::GetSwizzleTexFormat(internalformat, formatCaps.colorRendering, clientVersion);
-    mSwizzleShaderResourceFormat = gl_d3d11::GetSwizzleSRVFormat(internalformat, formatCaps.colorRendering, clientVersion);
-    mSwizzleRenderTargetFormat = gl_d3d11::GetSwizzleRTVFormat(internalformat, formatCaps.colorRendering, clientVersion);
+    mTextureFormat = gl_d3d11::GetTexFormat(internalformat);
+    mShaderResourceFormat = gl_d3d11::GetSRVFormat(internalformat);
+    mDepthStencilFormat = gl_d3d11::GetDSVFormat(internalformat);
+    mRenderTargetFormat = gl_d3d11::GetRTVFormat(internalformat);
+    mSwizzleTextureFormat = gl_d3d11::GetSwizzleTexFormat(internalformat);
+    mSwizzleShaderResourceFormat = gl_d3d11::GetSwizzleSRVFormat(internalformat);
+    mSwizzleRenderTargetFormat = gl_d3d11::GetSwizzleRTVFormat(internalformat);
 
     // if the size is not positive this should be treated as an incomplete texture
     // we handle that here by skipping the d3d texture creation
@@ -993,7 +982,7 @@
 
 TextureStorage11_3D::TextureStorage11_3D(Renderer *renderer, GLenum internalformat, bool renderTarget,
                                          GLsizei width, GLsizei height, GLsizei depth, int levels)
-    : TextureStorage11(renderer, GetTextureBindFlags(internalformat, renderer->getCurrentClientVersion(), renderTarget))
+    : TextureStorage11(renderer, GetTextureBindFlags(internalformat, renderTarget))
 {
     mTexture = NULL;
     mSwizzleTexture = NULL;
@@ -1004,17 +993,13 @@
         mSwizzleRenderTargets[i] = NULL;
     }
 
-    GLuint clientVersion = mRenderer->getCurrentClientVersion();
-
-    mTextureFormat = gl_d3d11::GetTexFormat(internalformat, clientVersion);
-    mShaderResourceFormat = gl_d3d11::GetSRVFormat(internalformat, clientVersion);
-    mDepthStencilFormat = gl_d3d11::GetDSVFormat(internalformat, clientVersion);
-    mRenderTargetFormat = gl_d3d11::GetRTVFormat(internalformat, clientVersion);
-
-    const gl::TextureCaps &formatCaps = renderer->getCaps().textureCaps.get(internalformat);
-    mSwizzleTextureFormat = gl_d3d11::GetSwizzleTexFormat(internalformat, formatCaps.colorRendering, clientVersion);
-    mSwizzleShaderResourceFormat = gl_d3d11::GetSwizzleSRVFormat(internalformat, formatCaps.colorRendering, clientVersion);
-    mSwizzleRenderTargetFormat = gl_d3d11::GetSwizzleRTVFormat(internalformat, formatCaps.colorRendering, clientVersion);
+    mTextureFormat = gl_d3d11::GetTexFormat(internalformat);
+    mShaderResourceFormat = gl_d3d11::GetSRVFormat(internalformat);
+    mDepthStencilFormat = gl_d3d11::GetDSVFormat(internalformat);
+    mRenderTargetFormat = gl_d3d11::GetRTVFormat(internalformat);
+    mSwizzleTextureFormat = gl_d3d11::GetSwizzleTexFormat(internalformat);
+    mSwizzleShaderResourceFormat = gl_d3d11::GetSwizzleSRVFormat(internalformat);
+    mSwizzleRenderTargetFormat = gl_d3d11::GetSwizzleRTVFormat(internalformat);
 
     // If the width, height or depth are not positive this should be treated as an incomplete texture
     // we handle that here by skipping the d3d texture creation
@@ -1301,7 +1286,7 @@
 
 TextureStorage11_2DArray::TextureStorage11_2DArray(Renderer *renderer, GLenum internalformat, bool renderTarget,
                                                    GLsizei width, GLsizei height, GLsizei depth, int levels)
-    : TextureStorage11(renderer, GetTextureBindFlags(internalformat, renderer->getCurrentClientVersion(), renderTarget))
+    : TextureStorage11(renderer, GetTextureBindFlags(internalformat, renderTarget))
 {
     mTexture = NULL;
     mSwizzleTexture = NULL;
@@ -1311,17 +1296,13 @@
         mSwizzleRenderTargets[level] = NULL;
     }
 
-    GLuint clientVersion = mRenderer->getCurrentClientVersion();
-
-    mTextureFormat = gl_d3d11::GetTexFormat(internalformat, clientVersion);
-    mShaderResourceFormat = gl_d3d11::GetSRVFormat(internalformat, clientVersion);
-    mDepthStencilFormat = gl_d3d11::GetDSVFormat(internalformat, clientVersion);
-    mRenderTargetFormat = gl_d3d11::GetRTVFormat(internalformat, clientVersion);
-
-    const gl::TextureCaps &formatCaps = renderer->getCaps().textureCaps.get(internalformat);
-    mSwizzleTextureFormat = gl_d3d11::GetSwizzleTexFormat(internalformat, formatCaps.colorRendering, clientVersion);
-    mSwizzleShaderResourceFormat = gl_d3d11::GetSwizzleSRVFormat(internalformat, formatCaps.colorRendering, clientVersion);
-    mSwizzleRenderTargetFormat = gl_d3d11::GetSwizzleRTVFormat(internalformat, formatCaps.colorRendering, clientVersion);
+    mTextureFormat = gl_d3d11::GetTexFormat(internalformat);
+    mShaderResourceFormat = gl_d3d11::GetSRVFormat(internalformat);
+    mDepthStencilFormat = gl_d3d11::GetDSVFormat(internalformat);
+    mRenderTargetFormat = gl_d3d11::GetRTVFormat(internalformat);
+    mSwizzleTextureFormat = gl_d3d11::GetSwizzleTexFormat(internalformat);
+    mSwizzleShaderResourceFormat = gl_d3d11::GetSwizzleSRVFormat(internalformat);
+    mSwizzleRenderTargetFormat = gl_d3d11::GetSwizzleRTVFormat(internalformat);
 
     // if the width, height or depth is not positive this should be treated as an incomplete texture
     // we handle that here by skipping the d3d texture creation
diff --git a/src/libGLESv2/renderer/d3d/d3d11/TextureStorage11.h b/src/libGLESv2/renderer/d3d/d3d11/TextureStorage11.h
index 8a612bd..52977d2 100644
--- a/src/libGLESv2/renderer/d3d/d3d11/TextureStorage11.h
+++ b/src/libGLESv2/renderer/d3d/d3d11/TextureStorage11.h
@@ -28,7 +28,7 @@
 
     static TextureStorage11 *makeTextureStorage11(TextureStorage *storage);
 
-    static DWORD GetTextureBindFlags(GLenum internalFormat, GLuint clientVersion, bool renderTarget);
+    static DWORD GetTextureBindFlags(GLenum internalFormat, bool renderTarget);
 
     UINT getBindFlags() const;
 
diff --git a/src/libGLESv2/renderer/d3d/d3d11/formatutils11.cpp b/src/libGLESv2/renderer/d3d/d3d11/formatutils11.cpp
index 783de7c..e40ab09 100644
--- a/src/libGLESv2/renderer/d3d/d3d11/formatutils11.cpp
+++ b/src/libGLESv2/renderer/d3d/d3d11/formatutils11.cpp
@@ -18,18 +18,18 @@
 namespace rx
 {
 
-struct D3D11ES3FormatInfo
+struct D3D11FormatInfo
 {
     DXGI_FORMAT mTexFormat;
     DXGI_FORMAT mSRVFormat;
     DXGI_FORMAT mRTVFormat;
     DXGI_FORMAT mDSVFormat;
 
-    D3D11ES3FormatInfo()
+    D3D11FormatInfo()
         : mTexFormat(DXGI_FORMAT_UNKNOWN), mDSVFormat(DXGI_FORMAT_UNKNOWN), mRTVFormat(DXGI_FORMAT_UNKNOWN), mSRVFormat(DXGI_FORMAT_UNKNOWN)
     { }
 
-    D3D11ES3FormatInfo(DXGI_FORMAT texFormat, DXGI_FORMAT srvFormat, DXGI_FORMAT rtvFormat, DXGI_FORMAT dsvFormat)
+    D3D11FormatInfo(DXGI_FORMAT texFormat, DXGI_FORMAT srvFormat, DXGI_FORMAT rtvFormat, DXGI_FORMAT dsvFormat)
         : mTexFormat(texFormat), mDSVFormat(dsvFormat), mRTVFormat(rtvFormat), mSRVFormat(srvFormat)
     { }
 };
@@ -37,128 +37,129 @@
 // For sized GL internal formats, there is only one corresponding D3D11 format. This map type allows
 // querying for the DXGI texture formats to use for textures, SRVs, RTVs and DSVs given a GL internal
 // format.
-typedef std::pair<GLenum, D3D11ES3FormatInfo> D3D11ES3FormatPair;
-typedef std::map<GLenum, D3D11ES3FormatInfo> D3D11ES3FormatMap;
+typedef std::pair<GLenum, D3D11FormatInfo> D3D11ES3FormatPair;
+typedef std::map<GLenum, D3D11FormatInfo> D3D11ES3FormatMap;
 
-static D3D11ES3FormatMap BuildD3D11ES3FormatMap()
+static D3D11ES3FormatMap BuildD3D11FormatMap()
 {
     D3D11ES3FormatMap map;
 
-    //                           | GL internal format  |                  | D3D11 texture format            | D3D11 SRV format               | D3D11 RTV format               | D3D11 DSV format   |
-    map.insert(D3D11ES3FormatPair(GL_NONE,              D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN,              DXGI_FORMAT_UNKNOWN,             DXGI_FORMAT_UNKNOWN,             DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_R8,                D3D11ES3FormatInfo(DXGI_FORMAT_R8_UNORM,             DXGI_FORMAT_R8_UNORM,            DXGI_FORMAT_R8_UNORM,            DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_R8_SNORM,          D3D11ES3FormatInfo(DXGI_FORMAT_R8_SNORM,             DXGI_FORMAT_R8_SNORM,            DXGI_FORMAT_UNKNOWN,             DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RG8,               D3D11ES3FormatInfo(DXGI_FORMAT_R8G8_UNORM,           DXGI_FORMAT_R8G8_UNORM,          DXGI_FORMAT_R8G8_UNORM,          DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RG8_SNORM,         D3D11ES3FormatInfo(DXGI_FORMAT_R8G8_SNORM,           DXGI_FORMAT_R8G8_SNORM,          DXGI_FORMAT_UNKNOWN,             DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGB8,              D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,       DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGB8_SNORM,        D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_SNORM,       DXGI_FORMAT_R8G8B8A8_SNORM,      DXGI_FORMAT_UNKNOWN,             DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGB565,            D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,       DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGBA4,             D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,       DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGB5_A1,           D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,       DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGBA8,             D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,       DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGBA8_SNORM,       D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_SNORM,       DXGI_FORMAT_R8G8B8A8_SNORM,      DXGI_FORMAT_UNKNOWN,             DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGB10_A2,          D3D11ES3FormatInfo(DXGI_FORMAT_R10G10B10A2_UNORM,    DXGI_FORMAT_R10G10B10A2_UNORM,   DXGI_FORMAT_R10G10B10A2_UNORM,   DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGB10_A2UI,        D3D11ES3FormatInfo(DXGI_FORMAT_R10G10B10A2_UINT,     DXGI_FORMAT_R10G10B10A2_UINT,    DXGI_FORMAT_R10G10B10A2_UINT,    DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_SRGB8,             D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM_SRGB,  DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_UNKNOWN,             DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_SRGB8_ALPHA8,      D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM_SRGB,  DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_R16F,              D3D11ES3FormatInfo(DXGI_FORMAT_R16_FLOAT,            DXGI_FORMAT_R16_FLOAT,           DXGI_FORMAT_R16_FLOAT,           DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RG16F,             D3D11ES3FormatInfo(DXGI_FORMAT_R16G16_FLOAT,         DXGI_FORMAT_R16G16_FLOAT,        DXGI_FORMAT_R16G16_FLOAT,        DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGB16F,            D3D11ES3FormatInfo(DXGI_FORMAT_R16G16B16A16_FLOAT,   DXGI_FORMAT_R16G16B16A16_FLOAT,  DXGI_FORMAT_R16G16B16A16_FLOAT,  DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGBA16F,           D3D11ES3FormatInfo(DXGI_FORMAT_R16G16B16A16_FLOAT,   DXGI_FORMAT_R16G16B16A16_FLOAT,  DXGI_FORMAT_R16G16B16A16_FLOAT,  DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_R32F,              D3D11ES3FormatInfo(DXGI_FORMAT_R32_FLOAT,            DXGI_FORMAT_R32_FLOAT,           DXGI_FORMAT_R32_FLOAT,           DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RG32F,             D3D11ES3FormatInfo(DXGI_FORMAT_R32G32_FLOAT,         DXGI_FORMAT_R32G32_FLOAT,        DXGI_FORMAT_R32G32_FLOAT,        DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGB32F,            D3D11ES3FormatInfo(DXGI_FORMAT_R32G32B32A32_FLOAT,   DXGI_FORMAT_R32G32B32A32_FLOAT,  DXGI_FORMAT_R32G32B32A32_FLOAT,  DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGBA32F,           D3D11ES3FormatInfo(DXGI_FORMAT_R32G32B32A32_FLOAT,   DXGI_FORMAT_R32G32B32A32_FLOAT,  DXGI_FORMAT_R32G32B32A32_FLOAT,  DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_R11F_G11F_B10F,    D3D11ES3FormatInfo(DXGI_FORMAT_R11G11B10_FLOAT,      DXGI_FORMAT_R11G11B10_FLOAT,     DXGI_FORMAT_R11G11B10_FLOAT,     DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGB9_E5,           D3D11ES3FormatInfo(DXGI_FORMAT_R9G9B9E5_SHAREDEXP,   DXGI_FORMAT_R9G9B9E5_SHAREDEXP,  DXGI_FORMAT_UNKNOWN,             DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_R8I,               D3D11ES3FormatInfo(DXGI_FORMAT_R8_SINT,              DXGI_FORMAT_R8_SINT,             DXGI_FORMAT_R8_SINT,             DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_R8UI,              D3D11ES3FormatInfo(DXGI_FORMAT_R8_UINT,              DXGI_FORMAT_R8_UINT,             DXGI_FORMAT_R8_UINT,             DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_R16I,              D3D11ES3FormatInfo(DXGI_FORMAT_R16_SINT,             DXGI_FORMAT_R16_SINT,            DXGI_FORMAT_R16_SINT,            DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_R16UI,             D3D11ES3FormatInfo(DXGI_FORMAT_R16_UINT,             DXGI_FORMAT_R16_UINT,            DXGI_FORMAT_R16_UINT,            DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_R32I,              D3D11ES3FormatInfo(DXGI_FORMAT_R32_SINT,             DXGI_FORMAT_R32_SINT,            DXGI_FORMAT_R32_SINT,            DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_R32UI,             D3D11ES3FormatInfo(DXGI_FORMAT_R32_UINT,             DXGI_FORMAT_R32_UINT,            DXGI_FORMAT_R32_UINT,            DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RG8I,              D3D11ES3FormatInfo(DXGI_FORMAT_R8G8_SINT,            DXGI_FORMAT_R8G8_SINT,           DXGI_FORMAT_R8G8_SINT,           DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RG8UI,             D3D11ES3FormatInfo(DXGI_FORMAT_R8G8_UINT,            DXGI_FORMAT_R8G8_UINT,           DXGI_FORMAT_R8G8_UINT,           DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RG16I,             D3D11ES3FormatInfo(DXGI_FORMAT_R16G16_SINT,          DXGI_FORMAT_R16G16_SINT,         DXGI_FORMAT_R16G16_SINT,         DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RG16UI,            D3D11ES3FormatInfo(DXGI_FORMAT_R16G16_UINT,          DXGI_FORMAT_R16G16_UINT,         DXGI_FORMAT_R16G16_UINT,         DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RG32I,             D3D11ES3FormatInfo(DXGI_FORMAT_R32G32_SINT,          DXGI_FORMAT_R32G32_SINT,         DXGI_FORMAT_R32G32_SINT,         DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RG32UI,            D3D11ES3FormatInfo(DXGI_FORMAT_R32G32_UINT,          DXGI_FORMAT_R32G32_UINT,         DXGI_FORMAT_R32G32_UINT,         DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGB8I,             D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_SINT,        DXGI_FORMAT_R8G8B8A8_SINT,       DXGI_FORMAT_R8G8B8A8_SINT,       DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGB8UI,            D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_UINT,        DXGI_FORMAT_R8G8B8A8_UINT,       DXGI_FORMAT_R8G8B8A8_UINT,       DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGB16I,            D3D11ES3FormatInfo(DXGI_FORMAT_R16G16B16A16_SINT,    DXGI_FORMAT_R16G16B16A16_SINT,   DXGI_FORMAT_R16G16B16A16_SINT,   DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGB16UI,           D3D11ES3FormatInfo(DXGI_FORMAT_R16G16B16A16_UINT,    DXGI_FORMAT_R16G16B16A16_UINT,   DXGI_FORMAT_R16G16B16A16_UINT,   DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGB32I,            D3D11ES3FormatInfo(DXGI_FORMAT_R32G32B32A32_SINT,    DXGI_FORMAT_R32G32B32A32_SINT,   DXGI_FORMAT_R32G32B32A32_SINT,   DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGB32UI,           D3D11ES3FormatInfo(DXGI_FORMAT_R32G32B32A32_UINT,    DXGI_FORMAT_R32G32B32A32_UINT,   DXGI_FORMAT_R32G32B32A32_UINT,   DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGBA8I,            D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_SINT,        DXGI_FORMAT_R8G8B8A8_SINT,       DXGI_FORMAT_R8G8B8A8_SINT,       DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGBA8UI,           D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_UINT,        DXGI_FORMAT_R8G8B8A8_UINT,       DXGI_FORMAT_R8G8B8A8_UINT,       DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGBA16I,           D3D11ES3FormatInfo(DXGI_FORMAT_R16G16B16A16_SINT,    DXGI_FORMAT_R16G16B16A16_SINT,   DXGI_FORMAT_R16G16B16A16_SINT,   DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGBA16UI,          D3D11ES3FormatInfo(DXGI_FORMAT_R16G16B16A16_UINT,    DXGI_FORMAT_R16G16B16A16_UINT,   DXGI_FORMAT_R16G16B16A16_UINT,   DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGBA32I,           D3D11ES3FormatInfo(DXGI_FORMAT_R32G32B32A32_SINT,    DXGI_FORMAT_R32G32B32A32_SINT,   DXGI_FORMAT_R32G32B32A32_SINT,   DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGBA32UI,          D3D11ES3FormatInfo(DXGI_FORMAT_R32G32B32A32_UINT,    DXGI_FORMAT_R32G32B32A32_UINT,   DXGI_FORMAT_R32G32B32A32_UINT,   DXGI_FORMAT_UNKNOWN)));
+    //                           | GL internal format  |               | D3D11 texture format            | D3D11 SRV format               | D3D11 RTV format               | D3D11 DSV format   |
+    map.insert(D3D11ES3FormatPair(GL_NONE,              D3D11FormatInfo(DXGI_FORMAT_UNKNOWN,              DXGI_FORMAT_UNKNOWN,             DXGI_FORMAT_UNKNOWN,             DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_R8,                D3D11FormatInfo(DXGI_FORMAT_R8_UNORM,             DXGI_FORMAT_R8_UNORM,            DXGI_FORMAT_R8_UNORM,            DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_R8_SNORM,          D3D11FormatInfo(DXGI_FORMAT_R8_SNORM,             DXGI_FORMAT_R8_SNORM,            DXGI_FORMAT_UNKNOWN,             DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RG8,               D3D11FormatInfo(DXGI_FORMAT_R8G8_UNORM,           DXGI_FORMAT_R8G8_UNORM,          DXGI_FORMAT_R8G8_UNORM,          DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RG8_SNORM,         D3D11FormatInfo(DXGI_FORMAT_R8G8_SNORM,           DXGI_FORMAT_R8G8_SNORM,          DXGI_FORMAT_UNKNOWN,             DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGB8,              D3D11FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,       DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGB8_SNORM,        D3D11FormatInfo(DXGI_FORMAT_R8G8B8A8_SNORM,       DXGI_FORMAT_R8G8B8A8_SNORM,      DXGI_FORMAT_UNKNOWN,             DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGB565,            D3D11FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,       DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGBA4,             D3D11FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,       DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGB5_A1,           D3D11FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,       DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGBA8,             D3D11FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,       DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGBA8_SNORM,       D3D11FormatInfo(DXGI_FORMAT_R8G8B8A8_SNORM,       DXGI_FORMAT_R8G8B8A8_SNORM,      DXGI_FORMAT_UNKNOWN,             DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGB10_A2,          D3D11FormatInfo(DXGI_FORMAT_R10G10B10A2_UNORM,    DXGI_FORMAT_R10G10B10A2_UNORM,   DXGI_FORMAT_R10G10B10A2_UNORM,   DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGB10_A2UI,        D3D11FormatInfo(DXGI_FORMAT_R10G10B10A2_UINT,     DXGI_FORMAT_R10G10B10A2_UINT,    DXGI_FORMAT_R10G10B10A2_UINT,    DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_SRGB8,             D3D11FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM_SRGB,  DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_UNKNOWN,             DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_SRGB8_ALPHA8,      D3D11FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM_SRGB,  DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_R16F,              D3D11FormatInfo(DXGI_FORMAT_R16_FLOAT,            DXGI_FORMAT_R16_FLOAT,           DXGI_FORMAT_R16_FLOAT,           DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RG16F,             D3D11FormatInfo(DXGI_FORMAT_R16G16_FLOAT,         DXGI_FORMAT_R16G16_FLOAT,        DXGI_FORMAT_R16G16_FLOAT,        DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGB16F,            D3D11FormatInfo(DXGI_FORMAT_R16G16B16A16_FLOAT,   DXGI_FORMAT_R16G16B16A16_FLOAT,  DXGI_FORMAT_R16G16B16A16_FLOAT,  DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGBA16F,           D3D11FormatInfo(DXGI_FORMAT_R16G16B16A16_FLOAT,   DXGI_FORMAT_R16G16B16A16_FLOAT,  DXGI_FORMAT_R16G16B16A16_FLOAT,  DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_R32F,              D3D11FormatInfo(DXGI_FORMAT_R32_FLOAT,            DXGI_FORMAT_R32_FLOAT,           DXGI_FORMAT_R32_FLOAT,           DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RG32F,             D3D11FormatInfo(DXGI_FORMAT_R32G32_FLOAT,         DXGI_FORMAT_R32G32_FLOAT,        DXGI_FORMAT_R32G32_FLOAT,        DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGB32F,            D3D11FormatInfo(DXGI_FORMAT_R32G32B32A32_FLOAT,   DXGI_FORMAT_R32G32B32A32_FLOAT,  DXGI_FORMAT_R32G32B32A32_FLOAT,  DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGBA32F,           D3D11FormatInfo(DXGI_FORMAT_R32G32B32A32_FLOAT,   DXGI_FORMAT_R32G32B32A32_FLOAT,  DXGI_FORMAT_R32G32B32A32_FLOAT,  DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_R11F_G11F_B10F,    D3D11FormatInfo(DXGI_FORMAT_R11G11B10_FLOAT,      DXGI_FORMAT_R11G11B10_FLOAT,     DXGI_FORMAT_R11G11B10_FLOAT,     DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGB9_E5,           D3D11FormatInfo(DXGI_FORMAT_R9G9B9E5_SHAREDEXP,   DXGI_FORMAT_R9G9B9E5_SHAREDEXP,  DXGI_FORMAT_UNKNOWN,             DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_R8I,               D3D11FormatInfo(DXGI_FORMAT_R8_SINT,              DXGI_FORMAT_R8_SINT,             DXGI_FORMAT_R8_SINT,             DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_R8UI,              D3D11FormatInfo(DXGI_FORMAT_R8_UINT,              DXGI_FORMAT_R8_UINT,             DXGI_FORMAT_R8_UINT,             DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_R16I,              D3D11FormatInfo(DXGI_FORMAT_R16_SINT,             DXGI_FORMAT_R16_SINT,            DXGI_FORMAT_R16_SINT,            DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_R16UI,             D3D11FormatInfo(DXGI_FORMAT_R16_UINT,             DXGI_FORMAT_R16_UINT,            DXGI_FORMAT_R16_UINT,            DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_R32I,              D3D11FormatInfo(DXGI_FORMAT_R32_SINT,             DXGI_FORMAT_R32_SINT,            DXGI_FORMAT_R32_SINT,            DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_R32UI,             D3D11FormatInfo(DXGI_FORMAT_R32_UINT,             DXGI_FORMAT_R32_UINT,            DXGI_FORMAT_R32_UINT,            DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RG8I,              D3D11FormatInfo(DXGI_FORMAT_R8G8_SINT,            DXGI_FORMAT_R8G8_SINT,           DXGI_FORMAT_R8G8_SINT,           DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RG8UI,             D3D11FormatInfo(DXGI_FORMAT_R8G8_UINT,            DXGI_FORMAT_R8G8_UINT,           DXGI_FORMAT_R8G8_UINT,           DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RG16I,             D3D11FormatInfo(DXGI_FORMAT_R16G16_SINT,          DXGI_FORMAT_R16G16_SINT,         DXGI_FORMAT_R16G16_SINT,         DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RG16UI,            D3D11FormatInfo(DXGI_FORMAT_R16G16_UINT,          DXGI_FORMAT_R16G16_UINT,         DXGI_FORMAT_R16G16_UINT,         DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RG32I,             D3D11FormatInfo(DXGI_FORMAT_R32G32_SINT,          DXGI_FORMAT_R32G32_SINT,         DXGI_FORMAT_R32G32_SINT,         DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RG32UI,            D3D11FormatInfo(DXGI_FORMAT_R32G32_UINT,          DXGI_FORMAT_R32G32_UINT,         DXGI_FORMAT_R32G32_UINT,         DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGB8I,             D3D11FormatInfo(DXGI_FORMAT_R8G8B8A8_SINT,        DXGI_FORMAT_R8G8B8A8_SINT,       DXGI_FORMAT_R8G8B8A8_SINT,       DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGB8UI,            D3D11FormatInfo(DXGI_FORMAT_R8G8B8A8_UINT,        DXGI_FORMAT_R8G8B8A8_UINT,       DXGI_FORMAT_R8G8B8A8_UINT,       DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGB16I,            D3D11FormatInfo(DXGI_FORMAT_R16G16B16A16_SINT,    DXGI_FORMAT_R16G16B16A16_SINT,   DXGI_FORMAT_R16G16B16A16_SINT,   DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGB16UI,           D3D11FormatInfo(DXGI_FORMAT_R16G16B16A16_UINT,    DXGI_FORMAT_R16G16B16A16_UINT,   DXGI_FORMAT_R16G16B16A16_UINT,   DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGB32I,            D3D11FormatInfo(DXGI_FORMAT_R32G32B32A32_SINT,    DXGI_FORMAT_R32G32B32A32_SINT,   DXGI_FORMAT_R32G32B32A32_SINT,   DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGB32UI,           D3D11FormatInfo(DXGI_FORMAT_R32G32B32A32_UINT,    DXGI_FORMAT_R32G32B32A32_UINT,   DXGI_FORMAT_R32G32B32A32_UINT,   DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGBA8I,            D3D11FormatInfo(DXGI_FORMAT_R8G8B8A8_SINT,        DXGI_FORMAT_R8G8B8A8_SINT,       DXGI_FORMAT_R8G8B8A8_SINT,       DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGBA8UI,           D3D11FormatInfo(DXGI_FORMAT_R8G8B8A8_UINT,        DXGI_FORMAT_R8G8B8A8_UINT,       DXGI_FORMAT_R8G8B8A8_UINT,       DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGBA16I,           D3D11FormatInfo(DXGI_FORMAT_R16G16B16A16_SINT,    DXGI_FORMAT_R16G16B16A16_SINT,   DXGI_FORMAT_R16G16B16A16_SINT,   DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGBA16UI,          D3D11FormatInfo(DXGI_FORMAT_R16G16B16A16_UINT,    DXGI_FORMAT_R16G16B16A16_UINT,   DXGI_FORMAT_R16G16B16A16_UINT,   DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGBA32I,           D3D11FormatInfo(DXGI_FORMAT_R32G32B32A32_SINT,    DXGI_FORMAT_R32G32B32A32_SINT,   DXGI_FORMAT_R32G32B32A32_SINT,   DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGBA32UI,          D3D11FormatInfo(DXGI_FORMAT_R32G32B32A32_UINT,    DXGI_FORMAT_R32G32B32A32_UINT,   DXGI_FORMAT_R32G32B32A32_UINT,   DXGI_FORMAT_UNKNOWN)));
 
     // Unsized formats, TODO: Are types of float and half float allowed for the unsized types? Would it change the DXGI format?
-    map.insert(D3D11ES3FormatPair(GL_ALPHA,             D3D11ES3FormatInfo(DXGI_FORMAT_A8_UNORM,             DXGI_FORMAT_A8_UNORM,            DXGI_FORMAT_A8_UNORM,            DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_LUMINANCE,         D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,       DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_LUMINANCE_ALPHA,   D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,       DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGB,               D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,       DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_RGBA,              D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,       DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_BGRA_EXT,          D3D11ES3FormatInfo(DXGI_FORMAT_B8G8R8A8_UNORM,       DXGI_FORMAT_B8G8R8A8_UNORM,      DXGI_FORMAT_B8G8R8A8_UNORM,      DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_ALPHA,             D3D11FormatInfo(DXGI_FORMAT_A8_UNORM,             DXGI_FORMAT_A8_UNORM,            DXGI_FORMAT_A8_UNORM,            DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_LUMINANCE,         D3D11FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,       DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_LUMINANCE_ALPHA,   D3D11FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,       DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGB,               D3D11FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,       DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_RGBA,              D3D11FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,       DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_BGRA_EXT,          D3D11FormatInfo(DXGI_FORMAT_B8G8R8A8_UNORM,       DXGI_FORMAT_B8G8R8A8_UNORM,      DXGI_FORMAT_B8G8R8A8_UNORM,      DXGI_FORMAT_UNKNOWN)));
 
     // From GL_EXT_texture_storage
-    //                           | GL internal format       |                  | D3D11 texture format          | D3D11 SRV format                    | D3D11 RTV format              | D3D11 DSV format               |
-    map.insert(D3D11ES3FormatPair(GL_ALPHA8_EXT,             D3D11ES3FormatInfo(DXGI_FORMAT_A8_UNORM,           DXGI_FORMAT_A8_UNORM,                 DXGI_FORMAT_A8_UNORM,           DXGI_FORMAT_UNKNOWN             )));
-    map.insert(D3D11ES3FormatPair(GL_LUMINANCE8_EXT,         D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,     DXGI_FORMAT_R8G8B8A8_UNORM,           DXGI_FORMAT_R8G8B8A8_UNORM,     DXGI_FORMAT_UNKNOWN             )));
-    map.insert(D3D11ES3FormatPair(GL_ALPHA32F_EXT,           D3D11ES3FormatInfo(DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT,       DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_UNKNOWN             )));
-    map.insert(D3D11ES3FormatPair(GL_LUMINANCE32F_EXT,       D3D11ES3FormatInfo(DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT,       DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_UNKNOWN             )));
-    map.insert(D3D11ES3FormatPair(GL_ALPHA16F_EXT,           D3D11ES3FormatInfo(DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT,       DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_UNKNOWN             )));
-    map.insert(D3D11ES3FormatPair(GL_LUMINANCE16F_EXT,       D3D11ES3FormatInfo(DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT,       DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_UNKNOWN             )));
-    map.insert(D3D11ES3FormatPair(GL_LUMINANCE8_ALPHA8_EXT,  D3D11ES3FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,     DXGI_FORMAT_R8G8B8A8_UNORM,           DXGI_FORMAT_R8G8B8A8_UNORM,     DXGI_FORMAT_UNKNOWN             )));
-    map.insert(D3D11ES3FormatPair(GL_LUMINANCE_ALPHA32F_EXT, D3D11ES3FormatInfo(DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT,       DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_UNKNOWN             )));
-    map.insert(D3D11ES3FormatPair(GL_LUMINANCE_ALPHA16F_EXT, D3D11ES3FormatInfo(DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT,       DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_UNKNOWN             )));
-    map.insert(D3D11ES3FormatPair(GL_BGRA8_EXT,              D3D11ES3FormatInfo(DXGI_FORMAT_B8G8R8A8_UNORM,     DXGI_FORMAT_B8G8R8A8_UNORM,           DXGI_FORMAT_B8G8R8A8_UNORM,     DXGI_FORMAT_UNKNOWN             )));
-    map.insert(D3D11ES3FormatPair(GL_BGRA4_ANGLEX,           D3D11ES3FormatInfo(DXGI_FORMAT_B8G8R8A8_UNORM,     DXGI_FORMAT_B8G8R8A8_UNORM,           DXGI_FORMAT_B8G8R8A8_UNORM,     DXGI_FORMAT_UNKNOWN             )));
-    map.insert(D3D11ES3FormatPair(GL_BGR5_A1_ANGLEX,         D3D11ES3FormatInfo(DXGI_FORMAT_B8G8R8A8_UNORM,     DXGI_FORMAT_B8G8R8A8_UNORM,           DXGI_FORMAT_B8G8R8A8_UNORM,     DXGI_FORMAT_UNKNOWN             )));
+    //                           | GL internal format       |               | D3D11 texture format          | D3D11 SRV format                    | D3D11 RTV format              | D3D11 DSV format               |
+    map.insert(D3D11ES3FormatPair(GL_ALPHA8_EXT,             D3D11FormatInfo(DXGI_FORMAT_A8_UNORM,           DXGI_FORMAT_A8_UNORM,                 DXGI_FORMAT_A8_UNORM,           DXGI_FORMAT_UNKNOWN             )));
+    map.insert(D3D11ES3FormatPair(GL_LUMINANCE8_EXT,         D3D11FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,     DXGI_FORMAT_R8G8B8A8_UNORM,           DXGI_FORMAT_R8G8B8A8_UNORM,     DXGI_FORMAT_UNKNOWN             )));
+    map.insert(D3D11ES3FormatPair(GL_ALPHA32F_EXT,           D3D11FormatInfo(DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT,       DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_UNKNOWN             )));
+    map.insert(D3D11ES3FormatPair(GL_LUMINANCE32F_EXT,       D3D11FormatInfo(DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT,       DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_UNKNOWN             )));
+    map.insert(D3D11ES3FormatPair(GL_ALPHA16F_EXT,           D3D11FormatInfo(DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT,       DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_UNKNOWN             )));
+    map.insert(D3D11ES3FormatPair(GL_LUMINANCE16F_EXT,       D3D11FormatInfo(DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT,       DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_UNKNOWN             )));
+    map.insert(D3D11ES3FormatPair(GL_LUMINANCE8_ALPHA8_EXT,  D3D11FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,     DXGI_FORMAT_R8G8B8A8_UNORM,           DXGI_FORMAT_R8G8B8A8_UNORM,     DXGI_FORMAT_UNKNOWN             )));
+    map.insert(D3D11ES3FormatPair(GL_LUMINANCE_ALPHA32F_EXT, D3D11FormatInfo(DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT,       DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_UNKNOWN             )));
+    map.insert(D3D11ES3FormatPair(GL_LUMINANCE_ALPHA16F_EXT, D3D11FormatInfo(DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT,       DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_UNKNOWN             )));
+    map.insert(D3D11ES3FormatPair(GL_BGRA8_EXT,              D3D11FormatInfo(DXGI_FORMAT_B8G8R8A8_UNORM,     DXGI_FORMAT_B8G8R8A8_UNORM,           DXGI_FORMAT_B8G8R8A8_UNORM,     DXGI_FORMAT_UNKNOWN             )));
+    map.insert(D3D11ES3FormatPair(GL_BGRA4_ANGLEX,           D3D11FormatInfo(DXGI_FORMAT_B8G8R8A8_UNORM,     DXGI_FORMAT_B8G8R8A8_UNORM,           DXGI_FORMAT_B8G8R8A8_UNORM,     DXGI_FORMAT_UNKNOWN             )));
+    map.insert(D3D11ES3FormatPair(GL_BGR5_A1_ANGLEX,         D3D11FormatInfo(DXGI_FORMAT_B8G8R8A8_UNORM,     DXGI_FORMAT_B8G8R8A8_UNORM,           DXGI_FORMAT_B8G8R8A8_UNORM,     DXGI_FORMAT_UNKNOWN             )));
 
     // Depth stencil formats
-    map.insert(D3D11ES3FormatPair(GL_DEPTH_COMPONENT16,     D3D11ES3FormatInfo(DXGI_FORMAT_R16_TYPELESS,        DXGI_FORMAT_R16_UNORM,                DXGI_FORMAT_UNKNOWN,            DXGI_FORMAT_D16_UNORM           )));
-    map.insert(D3D11ES3FormatPair(GL_DEPTH_COMPONENT24,     D3D11ES3FormatInfo(DXGI_FORMAT_R24G8_TYPELESS,      DXGI_FORMAT_R24_UNORM_X8_TYPELESS,    DXGI_FORMAT_UNKNOWN,            DXGI_FORMAT_D24_UNORM_S8_UINT   )));
-    map.insert(D3D11ES3FormatPair(GL_DEPTH_COMPONENT32F,    D3D11ES3FormatInfo(DXGI_FORMAT_R32_TYPELESS,        DXGI_FORMAT_R32_FLOAT,                DXGI_FORMAT_UNKNOWN,            DXGI_FORMAT_D32_FLOAT           )));
-    map.insert(D3D11ES3FormatPair(GL_DEPTH24_STENCIL8,      D3D11ES3FormatInfo(DXGI_FORMAT_R24G8_TYPELESS,      DXGI_FORMAT_R24_UNORM_X8_TYPELESS,    DXGI_FORMAT_UNKNOWN,            DXGI_FORMAT_D24_UNORM_S8_UINT   )));
-    map.insert(D3D11ES3FormatPair(GL_DEPTH32F_STENCIL8,     D3D11ES3FormatInfo(DXGI_FORMAT_R32G8X24_TYPELESS,   DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS, DXGI_FORMAT_UNKNOWN,            DXGI_FORMAT_D32_FLOAT_S8X24_UINT)));
-    map.insert(D3D11ES3FormatPair(GL_STENCIL_INDEX8,        D3D11ES3FormatInfo(DXGI_FORMAT_R24G8_TYPELESS,      DXGI_FORMAT_X24_TYPELESS_G8_UINT,     DXGI_FORMAT_UNKNOWN,            DXGI_FORMAT_D24_UNORM_S8_UINT   )));
+    map.insert(D3D11ES3FormatPair(GL_DEPTH_COMPONENT16,     D3D11FormatInfo(DXGI_FORMAT_R16_TYPELESS,        DXGI_FORMAT_R16_UNORM,                DXGI_FORMAT_UNKNOWN,            DXGI_FORMAT_D16_UNORM           )));
+    map.insert(D3D11ES3FormatPair(GL_DEPTH_COMPONENT24,     D3D11FormatInfo(DXGI_FORMAT_R24G8_TYPELESS,      DXGI_FORMAT_R24_UNORM_X8_TYPELESS,    DXGI_FORMAT_UNKNOWN,            DXGI_FORMAT_D24_UNORM_S8_UINT   )));
+    map.insert(D3D11ES3FormatPair(GL_DEPTH_COMPONENT32F,    D3D11FormatInfo(DXGI_FORMAT_R32_TYPELESS,        DXGI_FORMAT_R32_FLOAT,                DXGI_FORMAT_UNKNOWN,            DXGI_FORMAT_D32_FLOAT           )));
+    map.insert(D3D11ES3FormatPair(GL_DEPTH24_STENCIL8,      D3D11FormatInfo(DXGI_FORMAT_R24G8_TYPELESS,      DXGI_FORMAT_R24_UNORM_X8_TYPELESS,    DXGI_FORMAT_UNKNOWN,            DXGI_FORMAT_D24_UNORM_S8_UINT   )));
+    map.insert(D3D11ES3FormatPair(GL_DEPTH32F_STENCIL8,     D3D11FormatInfo(DXGI_FORMAT_R32G8X24_TYPELESS,   DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS, DXGI_FORMAT_UNKNOWN,            DXGI_FORMAT_D32_FLOAT_S8X24_UINT)));
+    map.insert(D3D11ES3FormatPair(GL_STENCIL_INDEX8,        D3D11FormatInfo(DXGI_FORMAT_R24G8_TYPELESS,      DXGI_FORMAT_X24_TYPELESS_G8_UINT,     DXGI_FORMAT_UNKNOWN,            DXGI_FORMAT_D24_UNORM_S8_UINT   )));
 
     // From GL_ANGLE_depth_texture
-    map.insert(D3D11ES3FormatPair(GL_DEPTH_COMPONENT32_OES, D3D11ES3FormatInfo(DXGI_FORMAT_R24G8_TYPELESS,      DXGI_FORMAT_R24_UNORM_X8_TYPELESS,    DXGI_FORMAT_UNKNOWN,             DXGI_FORMAT_D24_UNORM_S8_UINT  )));
+    // Since D3D11 doesn't have a D32_UNORM format, use D24S8 which has comparable precision and matches the ES3 format.
+    map.insert(D3D11ES3FormatPair(GL_DEPTH_COMPONENT32_OES, D3D11FormatInfo(DXGI_FORMAT_R24G8_TYPELESS,      DXGI_FORMAT_R24_UNORM_X8_TYPELESS,    DXGI_FORMAT_UNKNOWN,             DXGI_FORMAT_D24_UNORM_S8_UINT  )));
 
     // Compressed formats, From ES 3.0.1 spec, table 3.16
-    //                           | GL internal format                          |                  | D3D11 texture format | D3D11 SRV format     | D3D11 RTV format   | D3D11 DSV format  |
-    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_R11_EAC,                        D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_SIGNED_R11_EAC,                 D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_RG11_EAC,                       D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_SIGNED_RG11_EAC,                D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_RGB8_ETC2,                      D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_SRGB8_ETC2,                     D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,  D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_RGBA8_ETC2_EAC,                 D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,          D3D11ES3FormatInfo(DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
+    //                           | GL internal format                          |               | D3D11 texture format | D3D11 SRV format     | D3D11 RTV format   | D3D11 DSV format  |
+    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_R11_EAC,                        D3D11FormatInfo(DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_SIGNED_R11_EAC,                 D3D11FormatInfo(DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_RG11_EAC,                       D3D11FormatInfo(DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_SIGNED_RG11_EAC,                D3D11FormatInfo(DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_RGB8_ETC2,                      D3D11FormatInfo(DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_SRGB8_ETC2,                     D3D11FormatInfo(DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,  D3D11FormatInfo(DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, D3D11FormatInfo(DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_RGBA8_ETC2_EAC,                 D3D11FormatInfo(DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,          D3D11FormatInfo(DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN,   DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
 
     // From GL_EXT_texture_compression_dxt1
-    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_RGB_S3TC_DXT1_EXT,              D3D11ES3FormatInfo(DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
-    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,             D3D11ES3FormatInfo(DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_RGB_S3TC_DXT1_EXT,              D3D11FormatInfo(DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,             D3D11FormatInfo(DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
 
     // From GL_ANGLE_texture_compression_dxt3
-    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE,           D3D11ES3FormatInfo(DXGI_FORMAT_BC2_UNORM, DXGI_FORMAT_BC2_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE,           D3D11FormatInfo(DXGI_FORMAT_BC2_UNORM, DXGI_FORMAT_BC2_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
 
     // From GL_ANGLE_texture_compression_dxt5
-    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE,           D3D11ES3FormatInfo(DXGI_FORMAT_BC3_UNORM, DXGI_FORMAT_BC3_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
+    map.insert(D3D11ES3FormatPair(GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE,           D3D11FormatInfo(DXGI_FORMAT_BC3_UNORM, DXGI_FORMAT_BC3_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN)));
 
     return map;
 }
 
-static bool GetD3D11ES3FormatInfo(GLenum internalFormat, GLuint clientVersion, D3D11ES3FormatInfo *outFormatInfo)
+static bool GetD3D11FormatInfo(GLenum internalFormat, D3D11FormatInfo *outFormatInfo)
 {
-    static const D3D11ES3FormatMap formatMap = BuildD3D11ES3FormatMap();
+    static const D3D11ES3FormatMap formatMap = BuildD3D11FormatMap();
     D3D11ES3FormatMap::const_iterator iter = formatMap.find(internalFormat);
     if (iter != formatMap.end())
     {
@@ -218,6 +219,7 @@
     insertLoadFunction(&map, GL_RGB5_A1,            GL_UNSIGNED_SHORT_5_5_5_1,         loadRGBA5551DataToRGBA               );
     insertLoadFunction(&map, GL_RGB5_A1,            GL_UNSIGNED_INT_2_10_10_10_REV,    loadRGBA2101010ToRGBA                );
     insertLoadFunction(&map, GL_RGBA16F,            GL_HALF_FLOAT,                     loadToNative<GLhalf, 4>              );
+    insertLoadFunction(&map, GL_RGBA16F,            GL_HALF_FLOAT_OES,                 loadToNative<GLhalf, 4>              );
     insertLoadFunction(&map, GL_RGBA32F,            GL_FLOAT,                          loadToNative<GLfloat, 4>             );
     insertLoadFunction(&map, GL_RGBA16F,            GL_FLOAT,                          loadFloatDataToHalfFloat<4>          );
     insertLoadFunction(&map, GL_RGBA8UI,            GL_UNSIGNED_BYTE,                  loadToNative<GLubyte, 4>             );
@@ -235,8 +237,11 @@
     insertLoadFunction(&map, GL_R11F_G11F_B10F,     GL_UNSIGNED_INT_10F_11F_11F_REV,   loadToNative<GLuint, 1>              );
     insertLoadFunction(&map, GL_RGB9_E5,            GL_UNSIGNED_INT_5_9_9_9_REV,       loadToNative<GLuint, 1>              );
     insertLoadFunction(&map, GL_RGB16F,             GL_HALF_FLOAT,                     loadToNative3To4<GLhalf, gl::Float16One>);
+    insertLoadFunction(&map, GL_RGB16F,             GL_HALF_FLOAT_OES,                 loadToNative3To4<GLhalf, gl::Float16One>);
     insertLoadFunction(&map, GL_R11F_G11F_B10F,     GL_HALF_FLOAT,                     loadRGBHalfFloatDataTo111110Float    );
+    insertLoadFunction(&map, GL_R11F_G11F_B10F,     GL_HALF_FLOAT_OES,                 loadRGBHalfFloatDataTo111110Float    );
     insertLoadFunction(&map, GL_RGB9_E5,            GL_HALF_FLOAT,                     loadRGBHalfFloatDataTo999E5          );
+    insertLoadFunction(&map, GL_RGB9_E5,            GL_HALF_FLOAT_OES,                 loadRGBHalfFloatDataTo999E5          );
     insertLoadFunction(&map, GL_RGB32F,             GL_FLOAT,                          loadToNative3To4<GLfloat, gl::Float32One>);
     insertLoadFunction(&map, GL_RGB16F,             GL_FLOAT,                          loadFloatRGBDataToHalfFloatRGBA      );
     insertLoadFunction(&map, GL_R11F_G11F_B10F,     GL_FLOAT,                          loadRGBFloatDataTo111110Float        );
@@ -250,6 +255,7 @@
     insertLoadFunction(&map, GL_RG8,                GL_UNSIGNED_BYTE,                  loadToNative<GLubyte, 2>             );
     insertLoadFunction(&map, GL_RG8_SNORM,          GL_BYTE,                           loadToNative<GLbyte, 2>              );
     insertLoadFunction(&map, GL_RG16F,              GL_HALF_FLOAT,                     loadToNative<GLhalf, 2>              );
+    insertLoadFunction(&map, GL_RG16F,              GL_HALF_FLOAT_OES,                 loadToNative<GLhalf, 2>              );
     insertLoadFunction(&map, GL_RG32F,              GL_FLOAT,                          loadToNative<GLfloat, 2>             );
     insertLoadFunction(&map, GL_RG16F,              GL_FLOAT,                          loadFloatDataToHalfFloat<2>          );
     insertLoadFunction(&map, GL_RG8UI,              GL_UNSIGNED_BYTE,                  loadToNative<GLubyte, 2>             );
@@ -261,6 +267,7 @@
     insertLoadFunction(&map, GL_R8,                 GL_UNSIGNED_BYTE,                  loadToNative<GLubyte, 1>             );
     insertLoadFunction(&map, GL_R8_SNORM,           GL_BYTE,                           loadToNative<GLbyte, 1>              );
     insertLoadFunction(&map, GL_R16F,               GL_HALF_FLOAT,                     loadToNative<GLhalf, 1>              );
+    insertLoadFunction(&map, GL_R16F,               GL_HALF_FLOAT_OES,                 loadToNative<GLhalf, 1>              );
     insertLoadFunction(&map, GL_R32F,               GL_FLOAT,                          loadToNative<GLfloat, 1>             );
     insertLoadFunction(&map, GL_R16F,               GL_FLOAT,                          loadFloatDataToHalfFloat<1>          );
     insertLoadFunction(&map, GL_R8UI,               GL_UNSIGNED_BYTE,                  loadToNative<GLubyte, 1>             );
@@ -290,25 +297,35 @@
 
     // From GL_OES_texture_float
     insertLoadFunction(&map, GL_LUMINANCE_ALPHA,    GL_FLOAT,                          loadLuminanceAlphaFloatDataToRGBA    );
-    insertLoadFunction(&map, GL_LUMINANCE,          GL_FLOAT,                          loadLuminanceFloatDataToRGB          );
+    insertLoadFunction(&map, GL_LUMINANCE,          GL_FLOAT,                          loadLuminanceFloatDataToRGBA         );
     insertLoadFunction(&map, GL_ALPHA,              GL_FLOAT,                          loadAlphaFloatDataToRGBA             );
 
     // From GL_OES_texture_half_float
     insertLoadFunction(&map, GL_LUMINANCE_ALPHA,    GL_HALF_FLOAT,                     loadLuminanceAlphaHalfFloatDataToRGBA);
+    insertLoadFunction(&map, GL_LUMINANCE_ALPHA,    GL_HALF_FLOAT_OES,                 loadLuminanceAlphaHalfFloatDataToRGBA);
     insertLoadFunction(&map, GL_LUMINANCE,          GL_HALF_FLOAT,                     loadLuminanceHalfFloatDataToRGBA     );
+    insertLoadFunction(&map, GL_LUMINANCE,          GL_HALF_FLOAT_OES,                 loadLuminanceHalfFloatDataToRGBA     );
     insertLoadFunction(&map, GL_ALPHA,              GL_HALF_FLOAT,                     loadAlphaHalfFloatDataToRGBA         );
+    insertLoadFunction(&map, GL_ALPHA,              GL_HALF_FLOAT_OES,                 loadAlphaHalfFloatDataToRGBA         );
 
     // From GL_EXT_texture_storage
     insertLoadFunction(&map, GL_ALPHA8_EXT,             GL_UNSIGNED_BYTE,              loadToNative<GLubyte, 1>             );
     insertLoadFunction(&map, GL_LUMINANCE8_EXT,         GL_UNSIGNED_BYTE,              loadLuminanceDataToBGRA              );
     insertLoadFunction(&map, GL_LUMINANCE8_ALPHA8_EXT,  GL_UNSIGNED_BYTE,              loadLuminanceAlphaDataToBGRA         );
     insertLoadFunction(&map, GL_ALPHA32F_EXT,           GL_FLOAT,                      loadAlphaFloatDataToRGBA             );
-    insertLoadFunction(&map, GL_LUMINANCE32F_EXT,       GL_FLOAT,                      loadLuminanceFloatDataToRGB          );
+    insertLoadFunction(&map, GL_LUMINANCE32F_EXT,       GL_FLOAT,                      loadLuminanceFloatDataToRGBA         );
     insertLoadFunction(&map, GL_LUMINANCE_ALPHA32F_EXT, GL_FLOAT,                      loadLuminanceAlphaFloatDataToRGBA    );
     insertLoadFunction(&map, GL_ALPHA16F_EXT,           GL_HALF_FLOAT,                 loadAlphaHalfFloatDataToRGBA         );
+    insertLoadFunction(&map, GL_ALPHA16F_EXT,           GL_HALF_FLOAT_OES,             loadAlphaHalfFloatDataToRGBA         );
     insertLoadFunction(&map, GL_LUMINANCE16F_EXT,       GL_HALF_FLOAT,                 loadLuminanceHalfFloatDataToRGBA     );
+    insertLoadFunction(&map, GL_LUMINANCE16F_EXT,       GL_HALF_FLOAT_OES,             loadLuminanceHalfFloatDataToRGBA     );
     insertLoadFunction(&map, GL_LUMINANCE_ALPHA16F_EXT, GL_HALF_FLOAT,                 loadLuminanceAlphaHalfFloatDataToRGBA);
+    insertLoadFunction(&map, GL_LUMINANCE_ALPHA16F_EXT, GL_HALF_FLOAT_OES,             loadLuminanceAlphaHalfFloatDataToRGBA);
 
+    // From GL_ANGLE_depth_texture
+    insertLoadFunction(&map, GL_DEPTH_COMPONENT32_OES,  GL_UNSIGNED_INT,               loadUintDataToUint24X8               );
+
+    // From GL_EXT_texture_format_BGRA8888
     insertLoadFunction(&map, GL_BGRA8_EXT,              GL_UNSIGNED_BYTE,                  loadToNative<GLubyte, 4>         );
     insertLoadFunction(&map, GL_BGRA4_ANGLEX,           GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT, loadRGBA4444DataToRGBA           );
     insertLoadFunction(&map, GL_BGRA4_ANGLEX,           GL_UNSIGNED_BYTE,                  loadToNative<GLubyte, 4>         );
@@ -343,107 +360,6 @@
     return map;
 }
 
-struct D3D11ES2FormatInfo
-{
-    DXGI_FORMAT mTexFormat;
-    DXGI_FORMAT mSRVFormat;
-    DXGI_FORMAT mRTVFormat;
-    DXGI_FORMAT mDSVFormat;
-
-    LoadImageFunction mLoadImageFunction;
-
-    D3D11ES2FormatInfo()
-        : mTexFormat(DXGI_FORMAT_UNKNOWN), mDSVFormat(DXGI_FORMAT_UNKNOWN), mRTVFormat(DXGI_FORMAT_UNKNOWN),
-        mSRVFormat(DXGI_FORMAT_UNKNOWN), mLoadImageFunction(NULL)
-    { }
-
-    D3D11ES2FormatInfo(DXGI_FORMAT texFormat, DXGI_FORMAT srvFormat, DXGI_FORMAT rtvFormat, DXGI_FORMAT dsvFormat,
-        LoadImageFunction loadFunc)
-        : mTexFormat(texFormat), mDSVFormat(dsvFormat), mRTVFormat(rtvFormat), mSRVFormat(srvFormat),
-        mLoadImageFunction(loadFunc)
-    { }
-};
-
-// ES2 internal formats can map to DXGI formats and loading functions
-typedef std::pair<GLenum, D3D11ES2FormatInfo> D3D11ES2FormatPair;
-typedef std::map<GLenum, D3D11ES2FormatInfo> D3D11ES2FormatMap;
-
-static D3D11ES2FormatMap BuildD3D11ES2FormatMap()
-{
-    D3D11ES2FormatMap map;
-
-    //                           | Internal format                   |                  | Texture format                | SRV format                       | RTV format                    | DSV format                   | Load function                           |
-    map.insert(D3D11ES2FormatPair(GL_NONE,                            D3D11ES2FormatInfo(DXGI_FORMAT_UNKNOWN,            DXGI_FORMAT_UNKNOWN,               DXGI_FORMAT_UNKNOWN,            DXGI_FORMAT_UNKNOWN,           UnreachableLoadFunction                  )));
-    map.insert(D3D11ES2FormatPair(GL_DEPTH_COMPONENT16,               D3D11ES2FormatInfo(DXGI_FORMAT_R16_TYPELESS,       DXGI_FORMAT_R16_UNORM,             DXGI_FORMAT_UNKNOWN,            DXGI_FORMAT_D16_UNORM,         UnreachableLoadFunction                  )));
-    map.insert(D3D11ES2FormatPair(GL_DEPTH24_STENCIL8_OES,            D3D11ES2FormatInfo(DXGI_FORMAT_R24G8_TYPELESS,     DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_UNKNOWN,            DXGI_FORMAT_D24_UNORM_S8_UINT, UnreachableLoadFunction                  )));
-    map.insert(D3D11ES2FormatPair(GL_STENCIL_INDEX8,                  D3D11ES2FormatInfo(DXGI_FORMAT_R24G8_TYPELESS,     DXGI_FORMAT_X24_TYPELESS_G8_UINT,  DXGI_FORMAT_UNKNOWN,            DXGI_FORMAT_D24_UNORM_S8_UINT, UnreachableLoadFunction                  )));
-
-    // Since D3D11 doesn't have a D32_UNORM format, use D24S8 which has comparable precision and matches the ES3 format.
-    map.insert(D3D11ES2FormatPair(GL_DEPTH_COMPONENT32_OES,           D3D11ES2FormatInfo(DXGI_FORMAT_R24G8_TYPELESS,     DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_UNKNOWN,            DXGI_FORMAT_D24_UNORM_S8_UINT, UnreachableLoadFunction                  )));
-
-    map.insert(D3D11ES2FormatPair(GL_RGBA32F_EXT,                     D3D11ES2FormatInfo(DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT,    DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_UNKNOWN,           loadRGBAFloatDataToRGBA                  )));
-    map.insert(D3D11ES2FormatPair(GL_RGB32F_EXT,                      D3D11ES2FormatInfo(DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT,    DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_UNKNOWN,           loadRGBFloatDataToRGBA                   )));
-    map.insert(D3D11ES2FormatPair(GL_ALPHA32F_EXT,                    D3D11ES2FormatInfo(DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT,    DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_UNKNOWN,           loadAlphaFloatDataToRGBA                 )));
-    map.insert(D3D11ES2FormatPair(GL_LUMINANCE32F_EXT,                D3D11ES2FormatInfo(DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT,    DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_UNKNOWN,           loadLuminanceFloatDataToRGBA             )));
-    map.insert(D3D11ES2FormatPair(GL_LUMINANCE_ALPHA32F_EXT,          D3D11ES2FormatInfo(DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT,    DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_UNKNOWN,           loadLuminanceAlphaFloatDataToRGBA        )));
-
-    map.insert(D3D11ES2FormatPair(GL_RGBA16F_EXT,                     D3D11ES2FormatInfo(DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT,    DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_UNKNOWN,           loadRGBAHalfFloatDataToRGBA              )));
-    map.insert(D3D11ES2FormatPair(GL_RGB16F_EXT,                      D3D11ES2FormatInfo(DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT,    DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_UNKNOWN,           loadRGBHalfFloatDataToRGBA               )));
-    map.insert(D3D11ES2FormatPair(GL_ALPHA16F_EXT,                    D3D11ES2FormatInfo(DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT,    DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_UNKNOWN,           loadAlphaHalfFloatDataToRGBA             )));
-    map.insert(D3D11ES2FormatPair(GL_LUMINANCE16F_EXT,                D3D11ES2FormatInfo(DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT,    DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_UNKNOWN,           loadLuminanceHalfFloatDataToRGBA         )));
-    map.insert(D3D11ES2FormatPair(GL_LUMINANCE_ALPHA16F_EXT,          D3D11ES2FormatInfo(DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT,    DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_UNKNOWN,           loadLuminanceAlphaHalfFloatDataToRGBA    )));
-
-    map.insert(D3D11ES2FormatPair(GL_ALPHA8_EXT,                      D3D11ES2FormatInfo(DXGI_FORMAT_A8_UNORM,           DXGI_FORMAT_A8_UNORM,              DXGI_FORMAT_A8_UNORM,           DXGI_FORMAT_UNKNOWN,           loadAlphaDataToNative                    )));
-    map.insert(D3D11ES2FormatPair(GL_LUMINANCE8_EXT,                  D3D11ES2FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,     DXGI_FORMAT_R8G8B8A8_UNORM,        DXGI_FORMAT_R8G8B8A8_UNORM,     DXGI_FORMAT_UNKNOWN,           loadLuminanceDataToBGRA                  )));
-    map.insert(D3D11ES2FormatPair(GL_LUMINANCE8_ALPHA8_EXT,           D3D11ES2FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,     DXGI_FORMAT_R8G8B8A8_UNORM,        DXGI_FORMAT_R8G8B8A8_UNORM,     DXGI_FORMAT_UNKNOWN,           loadLuminanceAlphaDataToBGRA             )));
-
-    map.insert(D3D11ES2FormatPair(GL_RGB8_OES,                        D3D11ES2FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,     DXGI_FORMAT_R8G8B8A8_UNORM,        DXGI_FORMAT_R8G8B8A8_UNORM,     DXGI_FORMAT_UNKNOWN,           loadRGBUByteDataToRGBA                   )));
-    map.insert(D3D11ES2FormatPair(GL_RGB565,                          D3D11ES2FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,     DXGI_FORMAT_R8G8B8A8_UNORM,        DXGI_FORMAT_R8G8B8A8_UNORM,     DXGI_FORMAT_UNKNOWN,           loadRGB565DataToRGBA                     )));
-    map.insert(D3D11ES2FormatPair(GL_RGBA8_OES,                       D3D11ES2FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,     DXGI_FORMAT_R8G8B8A8_UNORM,        DXGI_FORMAT_R8G8B8A8_UNORM,     DXGI_FORMAT_UNKNOWN,           loadRGBAUByteDataToNative                )));
-    map.insert(D3D11ES2FormatPair(GL_RGBA4,                           D3D11ES2FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,     DXGI_FORMAT_R8G8B8A8_UNORM,        DXGI_FORMAT_R8G8B8A8_UNORM,     DXGI_FORMAT_UNKNOWN,           loadRGBA4444DataToRGBA                   )));
-    map.insert(D3D11ES2FormatPair(GL_RGB5_A1,                         D3D11ES2FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM,     DXGI_FORMAT_R8G8B8A8_UNORM,        DXGI_FORMAT_R8G8B8A8_UNORM,     DXGI_FORMAT_UNKNOWN,           loadRGBA5551DataToRGBA                   )));
-    map.insert(D3D11ES2FormatPair(GL_BGRA8_EXT,                       D3D11ES2FormatInfo(DXGI_FORMAT_B8G8R8A8_UNORM,     DXGI_FORMAT_B8G8R8A8_UNORM,        DXGI_FORMAT_B8G8R8A8_UNORM,     DXGI_FORMAT_UNKNOWN,           loadBGRADataToBGRA                       )));
-    map.insert(D3D11ES2FormatPair(GL_BGRA4_ANGLEX,                    D3D11ES2FormatInfo(DXGI_FORMAT_B8G8R8A8_UNORM,     DXGI_FORMAT_B8G8R8A8_UNORM,        DXGI_FORMAT_B8G8R8A8_UNORM,     DXGI_FORMAT_UNKNOWN,           loadRGBA4444DataToRGBA                   )));
-    map.insert(D3D11ES2FormatPair(GL_BGR5_A1_ANGLEX,                  D3D11ES2FormatInfo(DXGI_FORMAT_B8G8R8A8_UNORM,     DXGI_FORMAT_B8G8R8A8_UNORM,        DXGI_FORMAT_B8G8R8A8_UNORM,     DXGI_FORMAT_UNKNOWN,           loadRGBA5551DataToRGBA                   )));
-
-    // From GL_EXT_sRGB
-    map.insert(D3D11ES2FormatPair(GL_SRGB8,                           D3D11ES2FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_UNKNOWN,             DXGI_FORMAT_UNKNOWN,           loadToNative3To4<GLubyte, 0xFF>          )));
-    map.insert(D3D11ES2FormatPair(GL_SRGB8_ALPHA8,                    D3D11ES2FormatInfo(DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_UNKNOWN,           loadToNative<GLubyte, 4>                 )));
-
-    // From GL_EXT_texture_rg
-    map.insert(D3D11ES2FormatPair(GL_R8_EXT,                          D3D11ES2FormatInfo(DXGI_FORMAT_R8_UNORM,           DXGI_FORMAT_R8_UNORM,              DXGI_FORMAT_R8_UNORM,           DXGI_FORMAT_UNKNOWN,           loadToNative<GLubyte, 1>                 )));
-    map.insert(D3D11ES2FormatPair(GL_R32F_EXT,                        D3D11ES2FormatInfo(DXGI_FORMAT_R32_FLOAT,          DXGI_FORMAT_R32_FLOAT,             DXGI_FORMAT_R32_FLOAT,          DXGI_FORMAT_UNKNOWN,           loadToNative<GLfloat, 1>                 )));
-    map.insert(D3D11ES2FormatPair(GL_R16F_EXT,                        D3D11ES2FormatInfo(DXGI_FORMAT_R16_FLOAT,          DXGI_FORMAT_R16_FLOAT,             DXGI_FORMAT_R16_FLOAT,          DXGI_FORMAT_UNKNOWN,           loadToNative<GLhalf, 1>                  )));
-    map.insert(D3D11ES2FormatPair(GL_RG8_EXT,                         D3D11ES2FormatInfo(DXGI_FORMAT_R8G8_UNORM,         DXGI_FORMAT_R8G8_UNORM,            DXGI_FORMAT_R8G8_UNORM,         DXGI_FORMAT_UNKNOWN,           loadToNative<GLubyte, 2>                 )));
-    map.insert(D3D11ES2FormatPair(GL_RG32F_EXT,                       D3D11ES2FormatInfo(DXGI_FORMAT_R32G32_FLOAT,       DXGI_FORMAT_R32G32_FLOAT,          DXGI_FORMAT_R32G32_FLOAT,       DXGI_FORMAT_UNKNOWN,           loadToNative<GLfloat, 2>                 )));
-    map.insert(D3D11ES2FormatPair(GL_RG16F_EXT,                       D3D11ES2FormatInfo(DXGI_FORMAT_R16G16_FLOAT,       DXGI_FORMAT_R16G16_FLOAT,          DXGI_FORMAT_R16G16_FLOAT,       DXGI_FORMAT_UNKNOWN,           loadToNative<GLhalf, 2>                  )));
-
-    map.insert(D3D11ES2FormatPair(GL_COMPRESSED_RGB_S3TC_DXT1_EXT,    D3D11ES2FormatInfo(DXGI_FORMAT_BC1_UNORM,          DXGI_FORMAT_BC1_UNORM,             DXGI_FORMAT_UNKNOWN,            DXGI_FORMAT_UNKNOWN,           loadCompressedBlockDataToNative<4, 4,  8>)));
-    map.insert(D3D11ES2FormatPair(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT,   D3D11ES2FormatInfo(DXGI_FORMAT_BC1_UNORM,          DXGI_FORMAT_BC1_UNORM,             DXGI_FORMAT_UNKNOWN,            DXGI_FORMAT_UNKNOWN,           loadCompressedBlockDataToNative<4, 4,  8>)));
-    map.insert(D3D11ES2FormatPair(GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, D3D11ES2FormatInfo(DXGI_FORMAT_BC2_UNORM,          DXGI_FORMAT_BC2_UNORM,             DXGI_FORMAT_UNKNOWN,            DXGI_FORMAT_UNKNOWN,           loadCompressedBlockDataToNative<4, 4, 16>)));
-    map.insert(D3D11ES2FormatPair(GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, D3D11ES2FormatInfo(DXGI_FORMAT_BC3_UNORM,          DXGI_FORMAT_BC3_UNORM,             DXGI_FORMAT_UNKNOWN,            DXGI_FORMAT_UNKNOWN,           loadCompressedBlockDataToNative<4, 4, 16>)));
-
-    return map;
-}
-
-static bool GetD3D11ES2FormatInfo(GLenum internalFormat, GLuint clientVersion, D3D11ES2FormatInfo *outFormatInfo)
-{
-    static const D3D11ES2FormatMap formatMap = BuildD3D11ES2FormatMap();
-    D3D11ES2FormatMap::const_iterator iter = formatMap.find(internalFormat);
-    if (iter != formatMap.end())
-    {
-        if (outFormatInfo)
-        {
-            *outFormatInfo = iter->second;
-        }
-        return true;
-    }
-    else
-    {
-        return false;
-    }
-}
-
 // A map to determine the pixel size and mipmap generation function of a given DXGI format
 struct DXGIFormatInfo
 {
@@ -637,6 +553,12 @@
     return map;
 }
 
+static const DXGIToESFormatMap &GetDXGIToESFormatMap()
+{
+    static const DXGIToESFormatMap map = BuildDXGIToESFormatMap();
+    return map;
+}
+
 static const DXGIFormatInfoMap &GetDXGIFormatInfoMap()
 {
     static const DXGIFormatInfoMap infoMap = BuildDXGIFormatInfoMap();
@@ -858,31 +780,31 @@
     return map;
 }
 
-static const SwizzleFormatInfo GetSwizzleFormatInfo(GLint internalFormat, GLuint clientVersion)
+static const SwizzleFormatInfo GetSwizzleFormatInfo(GLenum internalFormat)
 {
     // Get the maximum sized component
     unsigned int maxBits = 1;
 
-    if (gl::IsFormatCompressed(internalFormat, clientVersion))
+    if (gl::IsFormatCompressed(internalFormat))
     {
-        unsigned int compressedBitsPerBlock = gl::GetPixelBytes(internalFormat, clientVersion) * 8;
-        unsigned int blockSize = gl::GetCompressedBlockWidth(internalFormat, clientVersion) *
-                                 gl::GetCompressedBlockHeight(internalFormat, clientVersion);
+        unsigned int compressedBitsPerBlock = gl::GetPixelBytes(internalFormat) * 8;
+        unsigned int blockSize = gl::GetCompressedBlockWidth(internalFormat) *
+                                 gl::GetCompressedBlockHeight(internalFormat);
         maxBits = std::max(compressedBitsPerBlock / blockSize, maxBits);
     }
     else
     {
-        maxBits = std::max(maxBits, gl::GetAlphaBits(    internalFormat, clientVersion));
-        maxBits = std::max(maxBits, gl::GetRedBits(      internalFormat, clientVersion));
-        maxBits = std::max(maxBits, gl::GetGreenBits(    internalFormat, clientVersion));
-        maxBits = std::max(maxBits, gl::GetBlueBits(     internalFormat, clientVersion));
-        maxBits = std::max(maxBits, gl::GetLuminanceBits(internalFormat, clientVersion));
-        maxBits = std::max(maxBits, gl::GetDepthBits(    internalFormat, clientVersion));
+        maxBits = std::max(maxBits, gl::GetAlphaBits(    internalFormat));
+        maxBits = std::max(maxBits, gl::GetRedBits(      internalFormat));
+        maxBits = std::max(maxBits, gl::GetGreenBits(    internalFormat));
+        maxBits = std::max(maxBits, gl::GetBlueBits(     internalFormat));
+        maxBits = std::max(maxBits, gl::GetLuminanceBits(internalFormat));
+        maxBits = std::max(maxBits, gl::GetDepthBits(    internalFormat));
     }
 
     maxBits = roundUp(maxBits, 8U);
 
-    GLenum componentType = gl::GetComponentType(internalFormat, clientVersion);
+    GLenum componentType = gl::GetComponentType(internalFormat);
 
     const SwizzleInfoMap &map = GetSwizzleInfoMap();
     SwizzleInfoMap::const_iterator iter = map.find(SwizzleSizeType(maxBits, componentType));
@@ -922,34 +844,13 @@
     }
 }
 
-LoadImageFunction GetImageLoadFunction(GLenum internalFormat, GLenum type, GLuint clientVersion)
+LoadImageFunction GetImageLoadFunction(GLenum internalFormat, GLenum type)
 {
-    if (clientVersion == 2)
+    static const D3D11LoadFunctionMap loadImageMap = buildD3D11LoadFunctionMap();
+    D3D11LoadFunctionMap::const_iterator iter = loadImageMap.find(InternalFormatTypePair(internalFormat, type));
+    if (iter != loadImageMap.end())
     {
-        D3D11ES2FormatInfo d3d11FormatInfo;
-        if (GetD3D11ES2FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo))
-        {
-            return d3d11FormatInfo.mLoadImageFunction;
-        }
-        else
-        {
-            UNREACHABLE();
-            return NULL;
-        }
-    }
-    else if (clientVersion == 3)
-    {
-        static const D3D11LoadFunctionMap loadImageMap = buildD3D11LoadFunctionMap();
-        D3D11LoadFunctionMap::const_iterator iter = loadImageMap.find(InternalFormatTypePair(internalFormat, type));
-        if (iter != loadImageMap.end())
-        {
-            return iter->second;
-        }
-        else
-        {
-            UNREACHABLE();
-            return NULL;
-        }
+        return iter->second;
     }
     else
     {
@@ -1134,33 +1035,12 @@
 namespace gl_d3d11
 {
 
-DXGI_FORMAT GetTexFormat(GLenum internalFormat, GLuint clientVersion)
+DXGI_FORMAT GetTexFormat(GLenum internalFormat)
 {
-    if (clientVersion == 2)
+    D3D11FormatInfo d3d11FormatInfo;
+    if (GetD3D11FormatInfo(internalFormat, &d3d11FormatInfo))
     {
-        D3D11ES2FormatInfo d3d11FormatInfo;
-        if (GetD3D11ES2FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo))
-        {
-            return d3d11FormatInfo.mTexFormat;
-        }
-        else
-        {
-            UNREACHABLE();
-            return DXGI_FORMAT_UNKNOWN;
-        }
-    }
-    else if (clientVersion == 3)
-    {
-        D3D11ES3FormatInfo d3d11FormatInfo;
-        if (GetD3D11ES3FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo))
-        {
-            return d3d11FormatInfo.mTexFormat;
-        }
-        else
-        {
-            UNREACHABLE();
-            return DXGI_FORMAT_UNKNOWN;
-        }
+        return d3d11FormatInfo.mTexFormat;
     }
     else
     {
@@ -1169,33 +1049,12 @@
     }
 }
 
-DXGI_FORMAT GetSRVFormat(GLenum internalFormat, GLuint clientVersion)
+DXGI_FORMAT GetSRVFormat(GLenum internalFormat)
 {
-    if (clientVersion == 2)
+    D3D11FormatInfo d3d11FormatInfo;
+    if (GetD3D11FormatInfo(internalFormat, &d3d11FormatInfo))
     {
-        D3D11ES2FormatInfo d3d11FormatInfo;
-        if (GetD3D11ES2FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo))
-        {
-            return d3d11FormatInfo.mSRVFormat;
-        }
-        else
-        {
-            UNREACHABLE();
-            return DXGI_FORMAT_UNKNOWN;
-        }
-    }
-    else if (clientVersion == 3)
-    {
-        D3D11ES3FormatInfo d3d11FormatInfo;
-        if (GetD3D11ES3FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo))
-        {
-            return d3d11FormatInfo.mSRVFormat;
-        }
-        else
-        {
-            UNREACHABLE();
-            return DXGI_FORMAT_UNKNOWN;
-        }
+        return d3d11FormatInfo.mSRVFormat;
     }
     else
     {
@@ -1204,33 +1063,12 @@
     }
 }
 
-DXGI_FORMAT GetRTVFormat(GLenum internalFormat, GLuint clientVersion)
+DXGI_FORMAT GetRTVFormat(GLenum internalFormat)
 {
-    if (clientVersion == 2)
+    D3D11FormatInfo d3d11FormatInfo;
+    if (GetD3D11FormatInfo(internalFormat, &d3d11FormatInfo))
     {
-        D3D11ES2FormatInfo d3d11FormatInfo;
-        if (GetD3D11ES2FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo))
-        {
-            return d3d11FormatInfo.mRTVFormat;
-        }
-        else
-        {
-            UNREACHABLE();
-            return DXGI_FORMAT_UNKNOWN;
-        }
-    }
-    else if (clientVersion == 3)
-    {
-        D3D11ES3FormatInfo d3d11FormatInfo;
-        if (GetD3D11ES3FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo))
-        {
-            return d3d11FormatInfo.mRTVFormat;
-        }
-        else
-        {
-            UNREACHABLE();
-            return DXGI_FORMAT_UNKNOWN;
-        }
+        return d3d11FormatInfo.mRTVFormat;
     }
     else
     {
@@ -1239,88 +1077,68 @@
     }
 }
 
-DXGI_FORMAT GetDSVFormat(GLenum internalFormat, GLuint clientVersion)
+DXGI_FORMAT GetDSVFormat(GLenum internalFormat)
 {
-    if (clientVersion == 2)
+    D3D11FormatInfo d3d11FormatInfo;
+    if (GetD3D11FormatInfo(internalFormat, &d3d11FormatInfo))
     {
-        D3D11ES2FormatInfo d3d11FormatInfo;
-        if (GetD3D11ES2FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo))
-        {
-            return d3d11FormatInfo.mDSVFormat;
-        }
-        else
-        {
-            return DXGI_FORMAT_UNKNOWN;
-        }
-    }
-    else if (clientVersion == 3)
-    {
-        D3D11ES3FormatInfo d3d11FormatInfo;
-        if (GetD3D11ES3FormatInfo(internalFormat, clientVersion, &d3d11FormatInfo))
-        {
-            return d3d11FormatInfo.mDSVFormat;
-        }
-        else
-        {
-            return DXGI_FORMAT_UNKNOWN;
-        }
+        return d3d11FormatInfo.mDSVFormat;
     }
     else
     {
-        UNREACHABLE();
         return DXGI_FORMAT_UNKNOWN;
     }
 }
 
 // Given a GL internal format, this function returns the DSV format if it is depth- or stencil-renderable,
 // the RTV format if it is color-renderable, and the (nonrenderable) texture format otherwise.
-DXGI_FORMAT GetRenderableFormat(GLenum internalFormat, GLuint clientVersion)
+DXGI_FORMAT GetRenderableFormat(GLenum internalFormat)
 {
-    DXGI_FORMAT targetFormat = GetDSVFormat(internalFormat, clientVersion);
+    DXGI_FORMAT targetFormat = GetDSVFormat(internalFormat);
     if (targetFormat == DXGI_FORMAT_UNKNOWN)
-        targetFormat = GetRTVFormat(internalFormat, clientVersion);
+        targetFormat = GetRTVFormat(internalFormat);
     if (targetFormat == DXGI_FORMAT_UNKNOWN)
-        targetFormat = GetTexFormat(internalFormat, clientVersion);
+        targetFormat = GetTexFormat(internalFormat);
 
     return targetFormat;
 }
 
-DXGI_FORMAT GetSwizzleTexFormat(GLint internalFormat, bool renderableFormat, GLuint clientVersion)
+DXGI_FORMAT GetSwizzleTexFormat(GLint internalFormat)
 {
-    if (!renderableFormat || gl::GetComponentCount(internalFormat, clientVersion) != 4)
+    if (GetRTVFormat(internalFormat) == DXGI_FORMAT_UNKNOWN || gl::GetComponentCount(internalFormat) != 4)
     {
-        const SwizzleFormatInfo &swizzleInfo = GetSwizzleFormatInfo(internalFormat, clientVersion);
+        const SwizzleFormatInfo &swizzleInfo = GetSwizzleFormatInfo(internalFormat);
         return swizzleInfo.mTexFormat;
     }
     else
     {
-        return GetTexFormat(internalFormat, clientVersion);
+        return GetTexFormat(internalFormat);
     }
 }
 
-DXGI_FORMAT GetSwizzleSRVFormat(GLint internalFormat, bool renderableFormat, GLuint clientVersion)
+DXGI_FORMAT GetSwizzleSRVFormat(GLint internalFormat)
 {
-    if (!renderableFormat || gl::GetComponentCount(internalFormat, clientVersion) != 4)
+    if (GetRTVFormat(internalFormat) == DXGI_FORMAT_UNKNOWN || gl::GetComponentCount(internalFormat) != 4)
     {
-        const SwizzleFormatInfo &swizzleInfo = GetSwizzleFormatInfo(internalFormat, clientVersion);
+        const SwizzleFormatInfo &swizzleInfo = GetSwizzleFormatInfo(internalFormat);
         return swizzleInfo.mSRVFormat;
     }
     else
     {
-        return GetTexFormat(internalFormat, clientVersion);
+        return GetSRVFormat(internalFormat);
     }
 }
 
-DXGI_FORMAT GetSwizzleRTVFormat(GLint internalFormat, bool renderableFormat, GLuint clientVersion)
+DXGI_FORMAT GetSwizzleRTVFormat(GLint internalFormat)
 {
-    if (!renderableFormat || gl::GetComponentCount(internalFormat, clientVersion) != 4)
+    if (GetRTVFormat(internalFormat) == DXGI_FORMAT_UNKNOWN || gl::GetComponentCount(internalFormat) != 4)
     {
-        const SwizzleFormatInfo &swizzleInfo = GetSwizzleFormatInfo(internalFormat, clientVersion);
+        const SwizzleFormatInfo &swizzleInfo = GetSwizzleFormatInfo(internalFormat);
         return swizzleInfo.mRTVFormat;
     }
     else
     {
-        return GetTexFormat(internalFormat, clientVersion);
+        return GetRTVFormat(internalFormat);
     }
 }
 
@@ -1620,13 +1438,13 @@
 namespace d3d11_gl
 {
 
-GLenum GetInternalFormat(DXGI_FORMAT format, GLuint clientVersion)
+GLenum GetInternalFormat(DXGI_FORMAT format)
 {
-    static const DXGIToESFormatMap formatMap = BuildDXGIToESFormatMap();
-    auto formatIt = formatMap.find(format);
-    if (formatIt != formatMap.end())
+    const DXGIToESFormatMap &formatMap = GetDXGIToESFormatMap();
+    DXGIToESFormatMap::const_iterator iter = formatMap.find(format);
+    if (iter != formatMap.end())
     {
-        return formatIt->second;
+        return iter->second;
     }
     else
     {
diff --git a/src/libGLESv2/renderer/d3d/d3d11/formatutils11.h b/src/libGLESv2/renderer/d3d/d3d11/formatutils11.h
index fdbad3a..d77fccf 100644
--- a/src/libGLESv2/renderer/d3d/d3d11/formatutils11.h
+++ b/src/libGLESv2/renderer/d3d/d3d11/formatutils11.h
@@ -23,7 +23,7 @@
 typedef std::set<DXGI_FORMAT> DXGIFormatSet;
 
 MipGenerationFunction GetMipGenerationFunction(DXGI_FORMAT format);
-LoadImageFunction GetImageLoadFunction(GLenum internalFormat, GLenum type, GLuint clientVersion);
+LoadImageFunction GetImageLoadFunction(GLenum internalFormat, GLenum type);
 
 GLuint GetFormatPixelBytes(DXGI_FORMAT format);
 GLuint GetBlockWidth(DXGI_FORMAT format);
@@ -47,15 +47,15 @@
 namespace gl_d3d11
 {
 
-DXGI_FORMAT GetTexFormat(GLenum internalFormat, GLuint clientVersion);
-DXGI_FORMAT GetSRVFormat(GLenum internalFormat, GLuint clientVersion);
-DXGI_FORMAT GetRTVFormat(GLenum internalFormat, GLuint clientVersion);
-DXGI_FORMAT GetDSVFormat(GLenum internalFormat, GLuint clientVersion);
-DXGI_FORMAT GetRenderableFormat(GLenum internalFormat, GLuint clientVersion);
+DXGI_FORMAT GetTexFormat(GLenum internalFormat);
+DXGI_FORMAT GetSRVFormat(GLenum internalFormat);
+DXGI_FORMAT GetRTVFormat(GLenum internalFormat);
+DXGI_FORMAT GetDSVFormat(GLenum internalFormat);
+DXGI_FORMAT GetRenderableFormat(GLenum internalFormat);
 
-DXGI_FORMAT GetSwizzleTexFormat(GLint internalFormat, bool renderableFormat, GLuint clientVersion);
-DXGI_FORMAT GetSwizzleSRVFormat(GLint internalFormat, bool renderableFormat, GLuint clientVersion);
-DXGI_FORMAT GetSwizzleRTVFormat(GLint internalFormat, bool renderableFormat, GLuint clientVersion);
+DXGI_FORMAT GetSwizzleTexFormat(GLint internalFormat);
+DXGI_FORMAT GetSwizzleSRVFormat(GLint internalFormat);
+DXGI_FORMAT GetSwizzleRTVFormat(GLint internalFormat);
 
 bool RequiresTextureDataInitialization(GLint internalFormat);
 InitializeTextureDataFunction GetTextureDataInitializationFunction(GLint internalFormat);
@@ -70,7 +70,7 @@
 namespace d3d11_gl
 {
 
-GLenum GetInternalFormat(DXGI_FORMAT format, GLuint clientVersion);
+GLenum GetInternalFormat(DXGI_FORMAT format);
 
 }
 
diff --git a/src/libGLESv2/renderer/d3d/d3d11/renderer11_utils.cpp b/src/libGLESv2/renderer/d3d/d3d11/renderer11_utils.cpp
index d1883a6..fe1ac39 100644
--- a/src/libGLESv2/renderer/d3d/d3d11/renderer11_utils.cpp
+++ b/src/libGLESv2/renderer/d3d/d3d11/renderer11_utils.cpp
@@ -220,15 +220,15 @@
 namespace d3d11_gl
 {
 
-static gl::TextureCaps GenerateTextureFormatCaps(GLenum internalFormat, GLuint clientVersion, ID3D11Device *device)
+static gl::TextureCaps GenerateTextureFormatCaps(GLenum internalFormat, ID3D11Device *device)
 {
     gl::TextureCaps textureCaps;
 
-    DXGI_FORMAT textureFormat = gl_d3d11::GetTexFormat(internalFormat, clientVersion);
-    DXGI_FORMAT srvFormat = gl_d3d11::GetSRVFormat(internalFormat, clientVersion);
-    DXGI_FORMAT rtvFormat = gl_d3d11::GetRTVFormat(internalFormat, clientVersion);
-    DXGI_FORMAT dsvFormat = gl_d3d11::GetDSVFormat(internalFormat, clientVersion);
-    DXGI_FORMAT renderFormat = gl_d3d11::GetRenderableFormat(internalFormat, clientVersion);
+    DXGI_FORMAT textureFormat = gl_d3d11::GetTexFormat(internalFormat);
+    DXGI_FORMAT srvFormat = gl_d3d11::GetSRVFormat(internalFormat);
+    DXGI_FORMAT rtvFormat = gl_d3d11::GetRTVFormat(internalFormat);
+    DXGI_FORMAT dsvFormat = gl_d3d11::GetDSVFormat(internalFormat);
+    DXGI_FORMAT renderFormat = gl_d3d11::GetRenderableFormat(internalFormat);
 
     UINT formatSupport;
     if (SUCCEEDED(device->CheckFormatSupport(textureFormat, &formatSupport)))
@@ -265,9 +265,9 @@
 
     if (SUCCEEDED(device->CheckFormatSupport(dsvFormat, &formatSupport)))
     {
-        textureCaps.depthRendering = gl::GetDepthBits(internalFormat, clientVersion) > 0 &&
+        textureCaps.depthRendering = gl::GetDepthBits(internalFormat) > 0 &&
                                      (formatSupport & D3D11_FORMAT_SUPPORT_DEPTH_STENCIL) != 0;
-        textureCaps.stencilRendering = gl::GetStencilBits(internalFormat, clientVersion) > 0 &&
+        textureCaps.stencilRendering = gl::GetStencilBits(internalFormat) > 0 &&
                                        (formatSupport & D3D11_FORMAT_SUPPORT_DEPTH_STENCIL) != 0;
     }
 
@@ -278,11 +278,10 @@
 {
     gl::Caps caps;
 
-    const GLuint maxClientVersion = 3;
-    const gl::FormatSet &allFormats = gl::GetAllSizedInternalFormats(maxClientVersion);
+    const gl::FormatSet &allFormats = gl::GetAllSizedInternalFormats();
     for (gl::FormatSet::const_iterator internalFormat = allFormats.begin(); internalFormat != allFormats.end(); ++internalFormat)
     {
-        caps.textureCaps.insert(*internalFormat, GenerateTextureFormatCaps(*internalFormat, maxClientVersion, device));
+        caps.textureCaps.insert(*internalFormat, GenerateTextureFormatCaps(*internalFormat, device));
     }
 
     D3D_FEATURE_LEVEL featureLevel = device->GetFeatureLevel();
@@ -324,12 +323,12 @@
 namespace d3d11
 {
 
-void GenerateInitialTextureData(GLint internalFormat, GLuint clientVersion, GLuint width, GLuint height, GLuint depth,
+void GenerateInitialTextureData(GLint internalFormat, GLuint width, GLuint height, GLuint depth,
                                 GLuint mipLevels, std::vector<D3D11_SUBRESOURCE_DATA> *outSubresourceData,
                                 std::vector< std::vector<BYTE> > *outData)
 {
     InitializeTextureDataFunction initializeFunc = gl_d3d11::GetTextureDataInitializationFunction(internalFormat);
-    DXGI_FORMAT dxgiFormat = gl_d3d11::GetTexFormat(internalFormat, clientVersion);
+    DXGI_FORMAT dxgiFormat = gl_d3d11::GetTexFormat(internalFormat);
 
     outSubresourceData->resize(mipLevels);
     outData->resize(mipLevels);
diff --git a/src/libGLESv2/renderer/d3d/d3d11/renderer11_utils.h b/src/libGLESv2/renderer/d3d/d3d11/renderer11_utils.h
index f042466..81efefa 100644
--- a/src/libGLESv2/renderer/d3d/d3d11/renderer11_utils.h
+++ b/src/libGLESv2/renderer/d3d/d3d11/renderer11_utils.h
@@ -47,7 +47,7 @@
 namespace d3d11
 {
 
-void GenerateInitialTextureData(GLint internalFormat, GLuint clientVersion, GLuint width, GLuint height, GLuint depth,
+void GenerateInitialTextureData(GLint internalFormat, GLuint width, GLuint height, GLuint depth,
                                 GLuint mipLevels, std::vector<D3D11_SUBRESOURCE_DATA> *outSubresourceData,
                                 std::vector< std::vector<BYTE> > *outData);
 
diff --git a/src/libGLESv2/renderer/d3d/d3d9/Blit9.cpp b/src/libGLESv2/renderer/d3d/d3d9/Blit9.cpp
index b723fed..2d72729 100644
--- a/src/libGLESv2/renderer/d3d/d3d9/Blit9.cpp
+++ b/src/libGLESv2/renderer/d3d/d3d9/Blit9.cpp
@@ -296,7 +296,7 @@
     dest->GetDesc(&destDesc);
 
     if (sourceDesc.Format == destDesc.Format && destDesc.Usage & D3DUSAGE_RENDERTARGET &&
-        d3d9_gl::IsFormatChannelEquivalent(destDesc.Format, destFormat, mRenderer->getCurrentClientVersion()))   // Can use StretchRect
+        d3d9_gl::IsFormatChannelEquivalent(destDesc.Format, destFormat))   // Can use StretchRect
     {
         RECT destRect = {xoffset, yoffset, xoffset + (sourceRect.right - sourceRect.left), yoffset + (sourceRect.bottom - sourceRect.top)};
         HRESULT result = device->StretchRect(source, &sourceRect, dest, &destRect, D3DTEXF_POINT);
diff --git a/src/libGLESv2/renderer/d3d/d3d9/Image9.cpp b/src/libGLESv2/renderer/d3d/d3d9/Image9.cpp
index d241c92..29b5ef5 100644
--- a/src/libGLESv2/renderer/d3d/d3d9/Image9.cpp
+++ b/src/libGLESv2/renderer/d3d/d3d9/Image9.cpp
@@ -387,8 +387,7 @@
     // 3D textures are not supported by the D3D9 backend.
     ASSERT(zoffset == 0 && depth == 1);
 
-    GLuint clientVersion = mRenderer->getCurrentClientVersion();
-    GLsizei inputRowPitch = gl::GetRowPitch(mInternalFormat, type, clientVersion, width, unpackAlignment);
+    GLsizei inputRowPitch = gl::GetRowPitch(mInternalFormat, type, width, unpackAlignment);
 
     LoadImageFunction loadFunction = d3d9::GetImageLoadFunction(mInternalFormat);
     ASSERT(loadFunction != NULL);
@@ -417,9 +416,8 @@
     // 3D textures are not supported by the D3D9 backend.
     ASSERT(zoffset == 0 && depth == 1);
 
-    GLuint clientVersion = mRenderer->getCurrentClientVersion();
-    GLsizei inputRowPitch = gl::GetRowPitch(mInternalFormat, GL_UNSIGNED_BYTE, clientVersion, width, 1);
-    GLsizei inputDepthPitch = gl::GetDepthPitch(mInternalFormat, GL_UNSIGNED_BYTE, clientVersion, width, height, 1);
+    GLsizei inputRowPitch = gl::GetRowPitch(mInternalFormat, GL_UNSIGNED_BYTE, width, 1);
+    GLsizei inputDepthPitch = gl::GetDepthPitch(mInternalFormat, GL_UNSIGNED_BYTE, width, height, 1);
 
     ASSERT(xoffset % d3d9::GetBlockWidth(mD3DFormat) == 0);
     ASSERT(yoffset % d3d9::GetBlockHeight(mD3DFormat) == 0);
diff --git a/src/libGLESv2/renderer/d3d/d3d9/RenderTarget9.cpp b/src/libGLESv2/renderer/d3d/d3d9/RenderTarget9.cpp
index 4574566..49bd9b4 100644
--- a/src/libGLESv2/renderer/d3d/d3d9/RenderTarget9.cpp
+++ b/src/libGLESv2/renderer/d3d/d3d9/RenderTarget9.cpp
@@ -56,16 +56,14 @@
 
     HRESULT result = D3DERR_INVALIDCALL;
 
-    GLuint clientVersion = mRenderer->getCurrentClientVersion();
-
     if (width > 0 && height > 0)
     {
         IDirect3DDevice9 *device = mRenderer->getDevice();
 
         bool requiresInitialization = false;
 
-        if (gl::GetDepthBits(internalFormat, clientVersion) > 0 ||
-            gl::GetStencilBits(internalFormat, clientVersion) > 0)
+        if (gl::GetDepthBits(internalFormat) > 0 ||
+            gl::GetStencilBits(internalFormat) > 0)
         {
             result = device->CreateDepthStencilSurface(width, height, renderFormat,
                                                        gl_d3d9::GetMultisampleType(supportedSamples),
diff --git a/src/libGLESv2/renderer/d3d/d3d9/Renderer9.cpp b/src/libGLESv2/renderer/d3d/d3d9/Renderer9.cpp
index 0f64e58..49f5b3b 100644
--- a/src/libGLESv2/renderer/d3d/d3d9/Renderer9.cpp
+++ b/src/libGLESv2/renderer/d3d/d3d9/Renderer9.cpp
@@ -812,7 +812,6 @@
 
         gl::FramebufferAttachment *attachment = framebuffer->getFirstColorbuffer();
         GLenum internalFormat = attachment ? attachment->getInternalFormat() : GL_NONE;
-        GLuint clientVersion = getCurrentClientVersion();
 
         // Set the color mask
         bool zeroColorMaskAllowed = getAdapterVendor() != VENDOR_ID_AMD;
@@ -822,10 +821,10 @@
         // drawing is done.
         // http://code.google.com/p/angleproject/issues/detail?id=169
 
-        DWORD colorMask = gl_d3d9::ConvertColorMask(gl::GetRedBits(internalFormat, clientVersion) > 0 && blendState.colorMaskRed,
-                                                    gl::GetGreenBits(internalFormat, clientVersion) > 0 && blendState.colorMaskGreen,
-                                                    gl::GetBlueBits(internalFormat, clientVersion) > 0 && blendState.colorMaskBlue,
-                                                    gl::GetAlphaBits(internalFormat, clientVersion) > 0 && blendState.colorMaskAlpha);
+        DWORD colorMask = gl_d3d9::ConvertColorMask(gl::GetRedBits(internalFormat)   > 0 && blendState.colorMaskRed,
+                                                    gl::GetGreenBits(internalFormat) > 0 && blendState.colorMaskGreen,
+                                                    gl::GetBlueBits(internalFormat)  > 0 && blendState.colorMaskBlue,
+                                                    gl::GetAlphaBits(internalFormat) > 0 && blendState.colorMaskAlpha);
         if (colorMask == 0 && !zeroColorMaskAllowed)
         {
             // Enable green channel, but set blending so nothing will be drawn.
@@ -1126,7 +1125,7 @@
         }
     }
 
-    gl::Renderbuffer *nullRenderbuffer = new gl::Renderbuffer(this, 0, new gl::Colorbuffer(this, width, height, GL_NONE, 0));
+    gl::Renderbuffer *nullRenderbuffer = new gl::Renderbuffer(0, new gl::Colorbuffer(this, width, height, GL_NONE, 0));
     gl::RenderbufferAttachment *nullbuffer = new gl::RenderbufferAttachment(nullRenderbuffer);
 
     // add nullbuffer to the cache
@@ -1246,8 +1245,8 @@
             mDevice->SetDepthStencilSurface(depthStencilSurface);
             SafeRelease(depthStencilSurface);
 
-            depthSize = depthStencil->getDepthSize(getCurrentClientVersion());
-            stencilSize = depthStencil->getStencilSize(getCurrentClientVersion());
+            depthSize = depthStencil->getDepthSize();
+            stencilSize = depthStencil->getStencilSize();
         }
         else
         {
@@ -1770,8 +1769,7 @@
     unsigned int stencilUnmasked = 0x0;
     if (clearParams.clearStencil && frameBuffer->hasStencil())
     {
-        unsigned int stencilSize = gl::GetStencilBits(frameBuffer->getStencilbuffer()->getActualFormat(),
-                                                      getCurrentClientVersion());
+        unsigned int stencilSize = gl::GetStencilBits(frameBuffer->getStencilbuffer()->getActualFormat());
         stencilUnmasked = (0x1 << stencilSize) - 1;
     }
 
@@ -1786,16 +1784,15 @@
         GLenum internalFormat = attachment->getInternalFormat();
         GLenum actualFormat = attachment->getActualFormat();
 
-        GLuint clientVersion = getCurrentClientVersion();
-        GLuint internalRedBits = gl::GetRedBits(internalFormat, clientVersion);
-        GLuint internalGreenBits = gl::GetGreenBits(internalFormat, clientVersion);
-        GLuint internalBlueBits = gl::GetBlueBits(internalFormat, clientVersion);
-        GLuint internalAlphaBits = gl::GetAlphaBits(internalFormat, clientVersion);
+        GLuint internalRedBits = gl::GetRedBits(internalFormat);
+        GLuint internalGreenBits = gl::GetGreenBits(internalFormat);
+        GLuint internalBlueBits = gl::GetBlueBits(internalFormat);
+        GLuint internalAlphaBits = gl::GetAlphaBits(internalFormat);
 
-        GLuint actualRedBits = gl::GetRedBits(actualFormat, clientVersion);
-        GLuint actualGreenBits = gl::GetGreenBits(actualFormat, clientVersion);
-        GLuint actualBlueBits = gl::GetBlueBits(actualFormat, clientVersion);
-        GLuint actualAlphaBits = gl::GetAlphaBits(actualFormat, clientVersion);
+        GLuint actualRedBits = gl::GetRedBits(actualFormat);
+        GLuint actualGreenBits = gl::GetGreenBits(actualFormat);
+        GLuint actualBlueBits = gl::GetBlueBits(actualFormat);
+        GLuint actualAlphaBits = gl::GetAlphaBits(actualFormat);
 
         color = D3DCOLOR_ARGB(gl::unorm<8>((internalAlphaBits == 0 && actualAlphaBits > 0) ? 1.0f : clearParams.colorFClearValue.alpha),
                               gl::unorm<8>((internalRedBits   == 0 && actualRedBits   > 0) ? 0.0f : clearParams.colorFClearValue.red),
@@ -2944,13 +2941,11 @@
         inputPitch = lock.Pitch;
     }
 
-    GLuint clientVersion = getCurrentClientVersion();
-
     GLenum sourceInternalFormat = d3d9_gl::GetInternalFormat(desc.Format);
-    GLenum sourceFormat = gl::GetFormat(sourceInternalFormat, clientVersion);
-    GLenum sourceType = gl::GetType(sourceInternalFormat, clientVersion);
+    GLenum sourceFormat = gl::GetFormat(sourceInternalFormat);
+    GLenum sourceType = gl::GetType(sourceInternalFormat);
 
-    GLuint sourcePixelSize = gl::GetPixelBytes(sourceInternalFormat, clientVersion);
+    GLuint sourcePixelSize = gl::GetPixelBytes(sourceInternalFormat);
 
     if (sourceFormat == format && sourceType == type)
     {
@@ -2963,11 +2958,11 @@
     }
     else
     {
-        GLenum destInternalFormat = gl::GetSizedInternalFormat(format, type, clientVersion);
-        GLuint destPixelSize = gl::GetPixelBytes(destInternalFormat, clientVersion);
-        GLuint sourcePixelSize = gl::GetPixelBytes(sourceInternalFormat, clientVersion);
+        GLenum destInternalFormat = gl::GetSizedInternalFormat(format, type);
+        GLuint destPixelSize = gl::GetPixelBytes(destInternalFormat);
+        GLuint sourcePixelSize = gl::GetPixelBytes(sourceInternalFormat);
 
-        ColorCopyFunction fastCopyFunc = d3d9::GetFastCopyFunction(desc.Format, format, type, getCurrentClientVersion());
+        ColorCopyFunction fastCopyFunc = d3d9::GetFastCopyFunction(desc.Format, format, type);
         if (fastCopyFunc)
         {
             // Fast copy is possible through some special function
@@ -2985,7 +2980,7 @@
         else
         {
             ColorReadFunction readFunc = d3d9::GetColorReadFunction(desc.Format);
-            ColorWriteFunction writeFunc = gl::GetColorWriteFunction(format, type, clientVersion);
+            ColorWriteFunction writeFunc = gl::GetColorWriteFunction(format, type);
 
             gl::ColorF temp;
 
diff --git a/src/libGLESv2/renderer/d3d/d3d9/TextureStorage9.cpp b/src/libGLESv2/renderer/d3d/d3d9/TextureStorage9.cpp
index 60b42c1..0a44d76 100644
--- a/src/libGLESv2/renderer/d3d/d3d9/TextureStorage9.cpp
+++ b/src/libGLESv2/renderer/d3d/d3d9/TextureStorage9.cpp
@@ -38,14 +38,12 @@
     return static_cast<TextureStorage9*>(storage);
 }
 
-DWORD TextureStorage9::GetTextureUsage(GLenum internalformat, Renderer9 *renderer, bool renderTarget)
+DWORD TextureStorage9::GetTextureUsage(GLenum internalformat, bool renderTarget)
 {
-    GLuint clientVersion = renderer->getCurrentClientVersion();
-
     DWORD d3dusage = 0;
 
-    if (gl::GetDepthBits(internalformat, clientVersion) > 0 ||
-        gl::GetStencilBits(internalformat, clientVersion) > 0)
+    if (gl::GetDepthBits(internalformat) > 0 ||
+        gl::GetStencilBits(internalformat) > 0)
     {
         d3dusage |= D3DUSAGE_DEPTHSTENCIL;
     }
@@ -99,7 +97,7 @@
 }
 
 TextureStorage9_2D::TextureStorage9_2D(Renderer *renderer, GLenum internalformat, bool renderTarget, GLsizei width, GLsizei height, int levels)
-    : TextureStorage9(renderer, GetTextureUsage(internalformat, Renderer9::makeRenderer9(renderer), renderTarget))
+    : TextureStorage9(renderer, GetTextureUsage(internalformat, renderTarget))
 {
     mTexture = NULL;
     mRenderTarget = NULL;
@@ -195,7 +193,7 @@
 }
 
 TextureStorage9_Cube::TextureStorage9_Cube(Renderer *renderer, GLenum internalformat, bool renderTarget, int size, int levels)
-    : TextureStorage9(renderer, GetTextureUsage(internalformat, Renderer9::makeRenderer9(renderer), renderTarget))
+    : TextureStorage9(renderer, GetTextureUsage(internalformat, renderTarget))
 {
     mTexture = NULL;
     for (int i = 0; i < 6; ++i)
diff --git a/src/libGLESv2/renderer/d3d/d3d9/TextureStorage9.h b/src/libGLESv2/renderer/d3d/d3d9/TextureStorage9.h
index 1f4975f..5a09f89 100644
--- a/src/libGLESv2/renderer/d3d/d3d9/TextureStorage9.h
+++ b/src/libGLESv2/renderer/d3d/d3d9/TextureStorage9.h
@@ -28,7 +28,7 @@
 
     static TextureStorage9 *makeTextureStorage9(TextureStorage *storage);
 
-    static DWORD GetTextureUsage(GLenum internalformat, Renderer9 *renderer, bool renderTarget);
+    static DWORD GetTextureUsage(GLenum internalformat, bool renderTarget);
 
     D3DPOOL getPool() const;
     DWORD getUsage() const;
diff --git a/src/libGLESv2/renderer/d3d/d3d9/formatutils9.cpp b/src/libGLESv2/renderer/d3d/d3d9/formatutils9.cpp
index d497c4d..24c75d7 100644
--- a/src/libGLESv2/renderer/d3d/d3d9/formatutils9.cpp
+++ b/src/libGLESv2/renderer/d3d/d3d9/formatutils9.cpp
@@ -421,7 +421,7 @@
     }
 }
 
-ColorCopyFunction GetFastCopyFunction(D3DFORMAT sourceFormat, GLenum destFormat, GLenum destType, GLuint clientVersion)
+ColorCopyFunction GetFastCopyFunction(D3DFORMAT sourceFormat, GLenum destFormat, GLenum destType)
 {
     static const D3D9FastCopyMap fastCopyMap = BuildFastCopyMap();
     D3D9FastCopyMap::const_iterator iter = fastCopyMap.find(D3D9FastCopyFormat(sourceFormat, destFormat, destType));
@@ -808,10 +808,10 @@
     return (type != D3DMULTISAMPLE_NONMASKABLE) ? type : 0;
 }
 
-bool IsFormatChannelEquivalent(D3DFORMAT d3dformat, GLenum format, GLuint clientVersion)
+bool IsFormatChannelEquivalent(D3DFORMAT d3dformat, GLenum format)
 {
     GLenum internalFormat = d3d9_gl::GetInternalFormat(d3dformat);
-    GLenum convertedFormat = gl::GetFormat(internalFormat, clientVersion);
+    GLenum convertedFormat = gl::GetFormat(internalFormat);
     return convertedFormat == format;
 }
 
diff --git a/src/libGLESv2/renderer/d3d/d3d9/formatutils9.h b/src/libGLESv2/renderer/d3d/d3d9/formatutils9.h
index 7600658..2638879 100644
--- a/src/libGLESv2/renderer/d3d/d3d9/formatutils9.h
+++ b/src/libGLESv2/renderer/d3d/d3d9/formatutils9.h
@@ -35,7 +35,7 @@
 const D3DFormatSet &GetAllUsedD3DFormats();
 
 ColorReadFunction GetColorReadFunction(D3DFORMAT format);
-ColorCopyFunction GetFastCopyFunction(D3DFORMAT sourceFormat, GLenum destFormat, GLenum destType, GLuint clientVersion);
+ColorCopyFunction GetFastCopyFunction(D3DFORMAT sourceFormat, GLenum destFormat, GLenum destType);
 
 VertexCopyFunction GetVertexCopyFunction(const gl::VertexFormat &vertexFormat);
 size_t GetVertexElementSize(const gl::VertexFormat &vertexFormat);
@@ -68,7 +68,7 @@
 
 GLenum GetInternalFormat(D3DFORMAT format);
 GLsizei GetSamplesCount(D3DMULTISAMPLE_TYPE type);
-bool IsFormatChannelEquivalent(D3DFORMAT d3dformat, GLenum format, GLuint clientVersion);
+bool IsFormatChannelEquivalent(D3DFORMAT d3dformat, GLenum format);
 
 }
 
diff --git a/src/libGLESv2/renderer/d3d/d3d9/renderer9_utils.cpp b/src/libGLESv2/renderer/d3d/d3d9/renderer9_utils.cpp
index 4a1dc86..8c3a333 100644
--- a/src/libGLESv2/renderer/d3d/d3d9/renderer9_utils.cpp
+++ b/src/libGLESv2/renderer/d3d/d3d9/renderer9_utils.cpp
@@ -251,7 +251,7 @@
 namespace d3d9_gl
 {
 
-static gl::TextureCaps GenerateTextureFormatCaps(GLenum internalFormat, GLuint clientVersion, IDirect3D9 *d3d9, D3DDEVTYPE deviceType,
+static gl::TextureCaps GenerateTextureFormatCaps(GLenum internalFormat, IDirect3D9 *d3d9, D3DDEVTYPE deviceType,
                                                  UINT adapter, D3DFORMAT adapterFormat)
 {
     gl::TextureCaps textureCaps;
@@ -281,13 +281,13 @@
                                  SUCCEEDED(d3d9->CheckDeviceFormat(adapter, deviceType, adapterFormat,
                                                                    D3DUSAGE_RENDERTARGET, D3DRTYPE_TEXTURE, renderFormat));
 
-    textureCaps.depthRendering = gl::GetDepthBits(internalFormat, clientVersion) > 0 &&
+    textureCaps.depthRendering = gl::GetDepthBits(internalFormat) > 0 &&
                                  (SUCCEEDED(d3d9->CheckDeviceFormat(adapter, deviceType, adapterFormat,
                                                                     D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_TEXTURE, textureFormat)) ||
                                   SUCCEEDED(d3d9->CheckDeviceFormat(adapter, deviceType, adapterFormat,
                                                                     D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_TEXTURE, renderFormat)));
 
-    textureCaps.stencilRendering = gl::GetStencilBits(internalFormat, clientVersion) > 0 &&
+    textureCaps.stencilRendering = gl::GetStencilBits(internalFormat) > 0 &&
                                    (SUCCEEDED(d3d9->CheckDeviceFormat(adapter, deviceType, adapterFormat,
                                                                       D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_TEXTURE, textureFormat)) ||
                                     SUCCEEDED(d3d9->CheckDeviceFormat(adapter, deviceType, adapterFormat,
@@ -322,12 +322,11 @@
     D3DDISPLAYMODE currentDisplayMode;
     d3d9->GetAdapterDisplayMode(adapter, &currentDisplayMode);
 
-    const GLuint maxClientVersion = 2;
-    const gl::FormatSet &allFormats = gl::GetAllSizedInternalFormats(maxClientVersion);
+    const gl::FormatSet &allFormats = gl::GetAllSizedInternalFormats();
     for (gl::FormatSet::const_iterator internalFormat = allFormats.begin(); internalFormat != allFormats.end(); ++internalFormat)
     {
-        caps.textureCaps.insert(*internalFormat, GenerateTextureFormatCaps(*internalFormat, maxClientVersion, d3d9,
-                                                                           deviceType, adapter, currentDisplayMode.Format));
+        caps.textureCaps.insert(*internalFormat, GenerateTextureFormatCaps(*internalFormat, d3d9, deviceType, adapter,
+                                                                           currentDisplayMode.Format));
     }
 
     caps.extensions.setTextureExtensionSupport(caps.textureCaps);
diff --git a/src/libGLESv2/renderer/loadimage.cpp b/src/libGLESv2/renderer/loadimage.cpp
index 6e2d246..62870c5 100644
--- a/src/libGLESv2/renderer/loadimage.cpp
+++ b/src/libGLESv2/renderer/loadimage.cpp
@@ -948,4 +948,26 @@
     }
 }
 
+void loadUintDataToUint24X8(int width, int height, int depth,
+                            const void *input, unsigned int inputRowPitch, unsigned int inputDepthPitch,
+                            void *output, unsigned int outputRowPitch, unsigned int outputDepthPitch)
+{
+    const unsigned int *source = NULL;
+    unsigned int *dest = NULL;
+
+    for (int z = 0; z < depth; z++)
+    {
+        for (int y = 0; y < height; y++)
+        {
+            source = offsetDataPointer<const unsigned int>(input, y, z, inputRowPitch, inputDepthPitch);
+            dest = offsetDataPointer<unsigned int>(output, y, z, outputRowPitch, outputDepthPitch);
+
+            for (int x = 0; x < width; x++)
+            {
+                dest[x] = source[x] >> 8;
+            }
+        }
+    }
+}
+
 }
diff --git a/src/libGLESv2/renderer/loadimage.h b/src/libGLESv2/renderer/loadimage.h
index 537a5e4..8b1066a 100644
--- a/src/libGLESv2/renderer/loadimage.h
+++ b/src/libGLESv2/renderer/loadimage.h
@@ -338,6 +338,10 @@
     }
 }
 
+void loadUintDataToUint24X8(int width, int height, int depth,
+                            const void *input, unsigned int inputRowPitch, unsigned int inputDepthPitch,
+                            void *output, unsigned int outputRowPitch, unsigned int outputDepthPitch);
+
 }
 
 #endif // LIBGLESV2_RENDERER_LOADIMAGE_H_
diff --git a/src/libGLESv2/validationES.cpp b/src/libGLESv2/validationES.cpp
index 2ab82cd..93dd000 100644
--- a/src/libGLESv2/validationES.cpp
+++ b/src/libGLESv2/validationES.cpp
@@ -192,14 +192,13 @@
 
 bool ValidCompressedImageSize(const gl::Context *context, GLenum internalFormat, GLsizei width, GLsizei height)
 {
-    GLuint clientVersion = context->getClientVersion();
-    if (!IsFormatCompressed(internalFormat, clientVersion))
+    if (!IsFormatCompressed(internalFormat))
     {
         return false;
     }
 
-    GLint blockWidth = GetCompressedBlockWidth(internalFormat, clientVersion);
-    GLint blockHeight = GetCompressedBlockHeight(internalFormat, clientVersion);
+    GLint blockWidth = GetCompressedBlockWidth(internalFormat);
+    GLint blockHeight = GetCompressedBlockHeight(internalFormat);
     if (width  < 0 || (width  > blockWidth  && width  % blockWidth  != 0) ||
         height < 0 || (height > blockHeight && height % blockHeight != 0))
     {
@@ -275,12 +274,12 @@
     // sized but it does state that the format must be in the ES2.0 spec table 4.5 which contains
     // only sized internal formats. The ES3 spec (section 4.4.2) does, however, state that the
     // internal format must be sized and not an integer format if samples is greater than zero.
-    if (!gl::IsSizedInternalFormat(internalformat, context->getClientVersion()))
+    if (!gl::IsSizedInternalFormat(internalformat))
     {
         return gl::error(GL_INVALID_ENUM, false);
     }
 
-    GLenum componentType = gl::GetComponentType(internalformat, context->getClientVersion());
+    GLenum componentType = gl::GetComponentType(internalformat);
     if ((componentType == GL_UNSIGNED_INT || componentType == GL_INT) && samples > 0)
     {
         return gl::error(GL_INVALID_OPERATION, false);
@@ -472,8 +471,6 @@
 
     bool sameBounds = srcX0 == dstX0 && srcY0 == dstY0 && srcX1 == dstX1 && srcY1 == dstY1;
 
-    GLuint clientVersion = context->getClientVersion();
-
     if (mask & GL_COLOR_BUFFER_BIT)
     {
         gl::FramebufferAttachment *readColorBuffer = readFramebuffer->getReadColorbuffer();
@@ -482,14 +479,14 @@
         if (readColorBuffer && drawColorBuffer)
         {
             GLenum readInternalFormat = readColorBuffer->getActualFormat();
-            GLenum readComponentType = gl::GetComponentType(readInternalFormat, clientVersion);
+            GLenum readComponentType = gl::GetComponentType(readInternalFormat);
 
             for (unsigned int i = 0; i < gl::IMPLEMENTATION_MAX_DRAW_BUFFERS; i++)
             {
                 if (drawFramebuffer->isEnabledColorAttachment(i))
                 {
                     GLenum drawInternalFormat = drawFramebuffer->getColorbuffer(i)->getActualFormat();
-                    GLenum drawComponentType = gl::GetComponentType(drawInternalFormat, clientVersion);
+                    GLenum drawComponentType = gl::GetComponentType(drawInternalFormat);
 
                     // The GL ES 3.0.2 spec (pg 193) states that:
                     // 1) If the read buffer is fixed point format, the draw buffer must be as well
@@ -852,7 +849,7 @@
     }
 
     GLenum currentInternalFormat, currentFormat, currentType;
-    int clientVersion = context->getClientVersion();
+    GLuint clientVersion = context->getClientVersion();
 
     context->getCurrentReadFormatType(&currentInternalFormat, &currentFormat, &currentType);
 
@@ -864,10 +861,10 @@
         return gl::error(GL_INVALID_OPERATION, false);
     }
 
-    GLenum sizedInternalFormat = IsSizedInternalFormat(format, clientVersion) ? format :
-                                 GetSizedInternalFormat(format, type, clientVersion);
+    GLenum sizedInternalFormat = IsSizedInternalFormat(format) ? format
+                                                               : GetSizedInternalFormat(format, type);
 
-    GLsizei outputPitch = GetRowPitch(sizedInternalFormat, type, clientVersion, width, context->getPackAlignment());
+    GLsizei outputPitch = GetRowPitch(sizedInternalFormat, type, width, context->getPackAlignment());
     // sized query sanity check
     if (bufSize)
     {
@@ -1249,9 +1246,8 @@
 
     if (textureCompressed)
     {
-        int clientVersion = context->getClientVersion();
-        GLint blockWidth = GetCompressedBlockWidth(textureInternalFormat, clientVersion);
-        GLint blockHeight = GetCompressedBlockHeight(textureInternalFormat, clientVersion);
+        GLint blockWidth = GetCompressedBlockWidth(textureInternalFormat);
+        GLint blockHeight = GetCompressedBlockHeight(textureInternalFormat);
 
         if (((width % blockWidth) != 0 && width != textureLevelWidth) ||
             ((height % blockHeight) != 0 && height != textureLevelHeight))
diff --git a/src/libGLESv2/validationES2.cpp b/src/libGLESv2/validationES2.cpp
index 5136575..0d07f0f 100644
--- a/src/libGLESv2/validationES2.cpp
+++ b/src/libGLESv2/validationES2.cpp
@@ -39,7 +39,7 @@
 
     if (format != GL_NONE)
     {
-        GLenum internalformat = gl::GetSizedInternalFormat(format, type, 2);
+        GLenum internalformat = gl::GetSizedInternalFormat(format, type);
         if (internalformat != texture->getInternalFormat(level))
         {
             return gl::error(GL_INVALID_OPERATION, false);
@@ -80,7 +80,7 @@
 
     if (format != GL_NONE)
     {
-        GLenum internalformat = gl::GetSizedInternalFormat(format, type, 2);
+        GLenum internalformat = gl::GetSizedInternalFormat(format, type);
         if (internalformat != texture->getInternalFormat(target, level))
         {
             return gl::error(GL_INVALID_OPERATION, false);
@@ -473,7 +473,7 @@
 
     gl::Framebuffer *framebuffer = context->getReadFramebuffer();
     GLenum colorbufferFormat = framebuffer->getReadColorbuffer()->getInternalFormat();
-    GLenum textureFormat = gl::GetFormat(textureInternalFormat, context->getClientVersion());
+    GLenum textureFormat = gl::GetFormat(textureInternalFormat);
 
     // [OpenGL ES 2.0.24] table 3.9
     if (isSubImage)
@@ -704,8 +704,8 @@
         return gl::error(GL_INVALID_OPERATION, false);
     }
 
-    GLenum format = gl::GetFormat(internalformat, context->getClientVersion());
-    GLenum type = gl::GetType(internalformat, context->getClientVersion());
+    GLenum format = gl::GetFormat(internalformat);
+    GLenum type = gl::GetType(internalformat);
 
     if (format == GL_NONE || type == GL_NONE)
     {
diff --git a/src/libGLESv2/validationES3.cpp b/src/libGLESv2/validationES3.cpp
index e865fba..27c226d 100644
--- a/src/libGLESv2/validationES3.cpp
+++ b/src/libGLESv2/validationES3.cpp
@@ -170,7 +170,6 @@
 
     // Validate texture formats
     GLenum actualInternalFormat = isSubImage ? textureInternalFormat : internalformat;
-    int clientVersion = context->getClientVersion();
     if (isCompressed)
     {
         if (!ValidCompressedImageSize(context, actualInternalFormat, width, height))
@@ -178,7 +177,7 @@
             return gl::error(GL_INVALID_OPERATION, false);
         }
 
-        if (!gl::IsFormatCompressed(actualInternalFormat, clientVersion))
+        if (!gl::IsFormatCompressed(actualInternalFormat))
         {
             return gl::error(GL_INVALID_ENUM, false);
         }
@@ -193,13 +192,13 @@
         // Note: dEQP 2013.4 expects an INVALID_VALUE error for TexImage3D with an invalid
         // internal format. (dEQP-GLES3.functional.negative_api.texture.teximage3d)
         if (!gl::IsValidInternalFormat(actualInternalFormat, context->getCaps().extensions, context->getClientVersion()) ||
-            !gl::IsValidFormat(format, context->getClientVersion()) ||
-            !gl::IsValidType(type, context->getClientVersion()))
+            !gl::IsValidFormat(format, context->getCaps().extensions, context->getClientVersion()) ||
+            !gl::IsValidType(type, context->getCaps().extensions, context->getClientVersion()))
         {
             return gl::error(GL_INVALID_ENUM, false);
         }
 
-        if (!gl::IsValidFormatCombination(actualInternalFormat, format, type, clientVersion))
+        if (!gl::IsValidFormatCombination(actualInternalFormat, format, type, context->getCaps().extensions, context->getClientVersion()))
         {
             return gl::error(GL_INVALID_OPERATION, false);
         }
@@ -261,11 +260,10 @@
         size_t widthSize = static_cast<size_t>(width);
         size_t heightSize = static_cast<size_t>(height);
         size_t depthSize = static_cast<size_t>(depth);
-        GLenum sizedFormat = gl::IsSizedInternalFormat(actualInternalFormat, clientVersion) ?
-                             actualInternalFormat :
-                             gl::GetSizedInternalFormat(actualInternalFormat, type, clientVersion);
+        GLenum sizedFormat = gl::IsSizedInternalFormat(actualInternalFormat) ? actualInternalFormat
+                                                                             : gl::GetSizedInternalFormat(actualInternalFormat, type);
 
-        size_t pixelBytes = static_cast<size_t>(gl::GetPixelBytes(sizedFormat, clientVersion));
+        size_t pixelBytes = static_cast<size_t>(gl::GetPixelBytes(sizedFormat));
 
         if (!rx::IsUnsignedMultiplicationSafe(widthSize, heightSize) ||
             !rx::IsUnsignedMultiplicationSafe(widthSize * heightSize, depthSize) ||
@@ -443,7 +441,7 @@
         return gl::error(GL_INVALID_ENUM, false);
     }
 
-    if (!gl::IsSizedInternalFormat(internalformat, context->getClientVersion()))
+    if (!gl::IsSizedInternalFormat(internalformat))
     {
         return gl::error(GL_INVALID_ENUM, false);
     }
@@ -638,7 +636,7 @@
             }
             break;
           case GL_FLOAT:
-            if (gl::GetComponentType(internalFormat, 3) != GL_FLOAT)
+            if (gl::GetComponentType(internalFormat) != GL_FLOAT)
             {
                 return false;
             }
@@ -651,13 +649,13 @@
         switch (type)
         {
           case GL_INT:
-            if (gl::GetComponentType(internalFormat, 3) != GL_INT)
+            if (gl::GetComponentType(internalFormat) != GL_INT)
             {
                 return false;
             }
             break;
           case GL_UNSIGNED_INT:
-            if (gl::GetComponentType(internalFormat, 3) != GL_UNSIGNED_INT)
+            if (gl::GetComponentType(internalFormat) != GL_UNSIGNED_INT)
             {
                 return false;
             }