Remove redundant dirtyImageData() check.

TRAC #15703 Issue=86 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@582 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 0bd22bc9
...@@ -26,7 +26,7 @@ namespace gl ...@@ -26,7 +26,7 @@ namespace gl
{ {
Texture::Image::Image() Texture::Image::Image()
: width(0), height(0), dirty(false), surface(NULL), format(GL_NONE) : width(0), height(0), dirty(false), surface(NULL), format(GL_NONE), type(GL_UNSIGNED_BYTE)
{ {
} }
...@@ -1162,13 +1162,8 @@ IDirect3DBaseTexture9 *Texture::getTexture() ...@@ -1162,13 +1162,8 @@ IDirect3DBaseTexture9 *Texture::getTexture()
{ {
createTexture(); createTexture();
} }
if (dirtyImageData())
{
updateTexture();
}
ASSERT(!dirtyImageData()); updateTexture();
return getBaseTexture(); return getBaseTexture();
} }
...@@ -1186,10 +1181,7 @@ void Texture::needRenderTarget() ...@@ -1186,10 +1181,7 @@ void Texture::needRenderTarget()
convertToRenderTarget(); convertToRenderTarget();
} }
if (dirtyImageData()) updateTexture();
{
updateTexture();
}
} }
GLint Texture::creationLevels(GLsizei width, GLsizei height, GLint maxlevel) const GLint Texture::creationLevels(GLsizei width, GLsizei height, GLint maxlevel) const
...@@ -1675,18 +1667,6 @@ void Texture2D::convertToRenderTarget() ...@@ -1675,18 +1667,6 @@ void Texture2D::convertToRenderTarget()
mIsRenderable = true; mIsRenderable = true;
} }
bool Texture2D::dirtyImageData() const
{
int q = log2(std::max(mWidth, mHeight));
for (int i = 0; i <= q; i++)
{
if (mImageArray[i].dirty) return true;
}
return false;
}
void Texture2D::generateMipmaps() void Texture2D::generateMipmaps()
{ {
if (!isPow2(mImageArray[0].width) || !isPow2(mImageArray[0].height)) if (!isPow2(mImageArray[0].width) || !isPow2(mImageArray[0].height))
...@@ -2140,21 +2120,6 @@ unsigned int TextureCubeMap::faceIndex(GLenum face) ...@@ -2140,21 +2120,6 @@ unsigned int TextureCubeMap::faceIndex(GLenum face)
return face - GL_TEXTURE_CUBE_MAP_POSITIVE_X; return face - GL_TEXTURE_CUBE_MAP_POSITIVE_X;
} }
bool TextureCubeMap::dirtyImageData() const
{
int q = log2(mWidth);
for (int f = 0; f < 6; f++)
{
for (int i = 0; i <= q; i++)
{
if (mImageArray[f][i].dirty) return true;
}
}
return false;
}
// While OpenGL doesn't check texture consistency until draw-time, D3D9 requires a complete texture // While OpenGL doesn't check texture consistency until draw-time, D3D9 requires a complete texture
// for render-to-texture (such as CopyTexImage). We have no way of keeping individual inconsistent levels & faces. // for render-to-texture (such as CopyTexImage). We have no way of keeping individual inconsistent levels & faces.
// Call this when a particular level of the texture must be defined with a specific format, width and height. // Call this when a particular level of the texture must be defined with a specific format, width and height.
......
...@@ -115,8 +115,6 @@ class Texture : public RefCountObject ...@@ -115,8 +115,6 @@ class Texture : public RefCountObject
virtual void convertToRenderTarget() = 0; virtual void convertToRenderTarget() = 0;
virtual IDirect3DSurface9 *getRenderTarget(GLenum target) = 0; virtual IDirect3DSurface9 *getRenderTarget(GLenum target) = 0;
virtual bool dirtyImageData() const = 0;
void createSurface(GLsizei width, GLsizei height, GLenum format, GLenum type, Image *img); void createSurface(GLsizei width, GLsizei height, GLenum format, GLenum type, Image *img);
Blit *getBlitter(); Blit *getBlitter();
...@@ -216,8 +214,6 @@ class Texture2D : public Texture ...@@ -216,8 +214,6 @@ class Texture2D : public Texture
virtual void convertToRenderTarget(); virtual void convertToRenderTarget();
virtual IDirect3DSurface9 *getRenderTarget(GLenum target); virtual IDirect3DSurface9 *getRenderTarget(GLenum target);
virtual bool dirtyImageData() const;
bool redefineTexture(GLint level, GLenum format, GLsizei width, GLsizei height, GLenum type); bool redefineTexture(GLint level, GLenum format, GLsizei width, GLsizei height, GLenum type);
void commitRect(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height); void commitRect(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height);
...@@ -268,8 +264,6 @@ class TextureCubeMap : public Texture ...@@ -268,8 +264,6 @@ class TextureCubeMap : public Texture
virtual void convertToRenderTarget(); virtual void convertToRenderTarget();
virtual IDirect3DSurface9 *getRenderTarget(GLenum target); virtual IDirect3DSurface9 *getRenderTarget(GLenum target);
virtual bool dirtyImageData() const;
// face is one of the GL_TEXTURE_CUBE_MAP_* enumerants. // face is one of the GL_TEXTURE_CUBE_MAP_* enumerants.
// Returns NULL if the call underlying Direct3D call fails. // Returns NULL if the call underlying Direct3D call fails.
IDirect3DSurface9 *getCubeMapSurface(GLenum face, unsigned int level); IDirect3DSurface9 *getCubeMapSurface(GLenum face, unsigned int level);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment