Mostly eliminates usage of getD3DFormat in Texture.
TRAC #21906
Signed-off-by: Daniel Koch
Author: Shannon Woods
git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1367 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/renderer/Image.cpp b/src/libGLESv2/renderer/Image.cpp
index a0ebd32..0e78248 100644
--- a/src/libGLESv2/renderer/Image.cpp
+++ b/src/libGLESv2/renderer/Image.cpp
@@ -30,6 +30,7 @@
mD3DPool = D3DPOOL_SYSTEMMEM;
mD3DFormat = D3DFMT_UNKNOWN;
+ mActualFormat = GL_NONE;
}
Image::~Image()
@@ -80,6 +81,7 @@
mInternalFormat = internalformat;
// compute the d3d format that will be used
mD3DFormat = Texture::ConvertTextureInternalFormat(internalformat);
+ mActualFormat = dx2es::GetEquivalentFormat(mD3DFormat);
if (mSurface)
{
@@ -165,6 +167,11 @@
return Texture::IsTextureFormatRenderable(getD3DFormat());
}
+GLenum Image::getActualFormat() const
+{
+ return mActualFormat;
+}
+
D3DFORMAT Image::getD3DFormat() const
{
// this should only happen if the image hasn't been redefined first