Commit 6bc4a146 by jbauman@chromium.org

Ensure texture level count accounts for lod offset.

The lower texture levels (below the lod offset) aren't used and can't be seen, so don't count them in levelCount. BUG= Review URL: https://codereview.appspot.com/6492084 git-svn-id: https://angleproject.googlecode.com/svn/trunk@1275 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 1e8228df
...@@ -39,6 +39,7 @@ Google Inc. ...@@ -39,6 +39,7 @@ Google Inc.
Adobe Systems Inc. Adobe Systems Inc.
Alexandru Chiculita Alexandru Chiculita
Steve Minns
Max Vujovic Max Vujovic
Autodesk, Inc. Autodesk, Inc.
......
#define MAJOR_VERSION 1 #define MAJOR_VERSION 1
#define MINOR_VERSION 0 #define MINOR_VERSION 0
#define BUILD_VERSION 0 #define BUILD_VERSION 0
#define BUILD_REVISION 1274 #define BUILD_REVISION 1275
#define STRINGIFY(x) #x #define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x) #define MACRO_STRINGIFY(x) STRINGIFY(x)
......
...@@ -1357,9 +1357,9 @@ GLint Texture::creationLevels(GLsizei size) const ...@@ -1357,9 +1357,9 @@ GLint Texture::creationLevels(GLsizei size) const
return creationLevels(size, size); return creationLevels(size, size);
} }
int Texture::levelCount() const int Texture::levelCount()
{ {
return getBaseTexture() ? getBaseTexture()->GetLevelCount() : 0; return getBaseTexture() ? getBaseTexture()->GetLevelCount() - getLodOffset() : 0;
} }
Blit *Texture::getBlitter() Blit *Texture::getBlitter()
......
...@@ -227,7 +227,7 @@ class Texture : public RefCountObject ...@@ -227,7 +227,7 @@ class Texture : public RefCountObject
virtual void convertToRenderTarget() = 0; virtual void convertToRenderTarget() = 0;
virtual IDirect3DSurface9 *getRenderTarget(GLenum target) = 0; virtual IDirect3DSurface9 *getRenderTarget(GLenum target) = 0;
int levelCount() const; int levelCount();
static Blit *getBlitter(); static Blit *getBlitter();
static bool copyToRenderTarget(IDirect3DSurface9 *dest, IDirect3DSurface9 *source, bool fromManaged); static bool copyToRenderTarget(IDirect3DSurface9 *dest, IDirect3DSurface9 *source, bool fromManaged);
......
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