Add a client version parameter to several D3D11-specific texture format queries.

TRAC #23483

Signed-off-by: Geoff Lang
Signed-off-by: Shannon Woods
Authored-by: Jamie Madill
diff --git a/src/libGLESv2/renderer/Renderer11.cpp b/src/libGLESv2/renderer/Renderer11.cpp
index c56aa1f..57a84f6 100644
--- a/src/libGLESv2/renderer/Renderer11.cpp
+++ b/src/libGLESv2/renderer/Renderer11.cpp
@@ -434,9 +434,13 @@
 
                 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);
-                    newConfig.depthStencilFormat = d3d11_gl::GetInternalFormat(depthStencilFormat);
+                    newConfig.renderTargetFormat = d3d11_gl::GetInternalFormat(renderTargetFormat, getCurrentClientVersion());
+                    newConfig.depthStencilFormat = d3d11_gl::GetInternalFormat(depthStencilFormat, getCurrentClientVersion());
                     newConfig.multiSample = 0;     // FIXME: enumerate multi-sampling
                     newConfig.fastConfig = true;   // Assume all DX11 format conversions to be fast
                     newConfig.es3Capable = true;
@@ -3167,7 +3171,7 @@
 {
     Image11 *dest11 = Image11::makeImage11(dest);
     Image11 *src11 = Image11::makeImage11(src);
-    Image11::generateMipmap(dest11, src11);
+    Image11::generateMipmap(getCurrentClientVersion(), dest11, src11);
 }
 
 TextureStorage *Renderer11::createTextureStorage2D(SwapChain *swapChain)
@@ -3288,7 +3292,7 @@
 
     GLuint clientVersion = getCurrentClientVersion();
 
-    GLint sourceInternalFormat = d3d11_gl::GetInternalFormat(textureDesc.Format);
+    GLint sourceInternalFormat = d3d11_gl::GetInternalFormat(textureDesc.Format, clientVersion);
     GLenum sourceFormat = gl::GetFormat(sourceInternalFormat, clientVersion);
     GLenum sourceType = gl::GetType(sourceInternalFormat, clientVersion);
 
@@ -3325,7 +3329,7 @@
         }
         else
         {
-            ColorReadFunction readFunc = d3d11::GetColorReadFunction(textureDesc.Format);
+            ColorReadFunction readFunc = d3d11::GetColorReadFunction(textureDesc.Format, clientVersion);
             ColorWriteFunction writeFunc = gl::GetColorWriteFunction(format, type, clientVersion);
 
             unsigned char temp[16]; // Maximum size of any Color<T> type used.