maxLevels is always 0.

TRAC #18714 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@842 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 4163405e
...@@ -1480,11 +1480,11 @@ unsigned int Texture::getSerial() const ...@@ -1480,11 +1480,11 @@ unsigned int Texture::getSerial() const
return mSerial; return mSerial;
} }
GLint Texture::creationLevels(GLsizei width, GLsizei height, GLint maxlevel) const GLint Texture::creationLevels(GLsizei width, GLsizei height) const
{ {
if ((isPow2(width) && isPow2(height)) || getContext()->supportsNonPower2Texture()) if ((isPow2(width) && isPow2(height)) || getContext()->supportsNonPower2Texture())
{ {
return maxlevel; return 0; // Maximum number of levels
} }
else else
{ {
...@@ -1493,9 +1493,9 @@ GLint Texture::creationLevels(GLsizei width, GLsizei height, GLint maxlevel) con ...@@ -1493,9 +1493,9 @@ GLint Texture::creationLevels(GLsizei width, GLsizei height, GLint maxlevel) con
} }
} }
GLint Texture::creationLevels(GLsizei size, GLint maxlevel) const GLint Texture::creationLevels(GLsizei size) const
{ {
return creationLevels(size, size, maxlevel); return creationLevels(size, size);
} }
int Texture::levelCount() const int Texture::levelCount() const
...@@ -1887,7 +1887,7 @@ void Texture2D::createTexture() ...@@ -1887,7 +1887,7 @@ void Texture2D::createTexture()
{ {
IDirect3DDevice9 *device = getDevice(); IDirect3DDevice9 *device = getDevice();
D3DFORMAT format = mImageArray[0].getD3DFormat(); D3DFORMAT format = mImageArray[0].getD3DFormat();
GLint levels = creationLevels(mImageArray[0].getWidth(), mImageArray[0].getHeight(), 0); GLint levels = creationLevels(mImageArray[0].getWidth(), mImageArray[0].getHeight());
IDirect3DTexture9 *texture = NULL; IDirect3DTexture9 *texture = NULL;
HRESULT result = device->CreateTexture(mImageArray[0].getWidth(), mImageArray[0].getHeight(), levels, 0, format, D3DPOOL_DEFAULT, &texture, NULL); HRESULT result = device->CreateTexture(mImageArray[0].getWidth(), mImageArray[0].getHeight(), levels, 0, format, D3DPOOL_DEFAULT, &texture, NULL);
...@@ -1934,7 +1934,7 @@ void Texture2D::convertToRenderTarget() ...@@ -1934,7 +1934,7 @@ void Texture2D::convertToRenderTarget()
egl::Display *display = getDisplay(); egl::Display *display = getDisplay();
IDirect3DDevice9 *device = getDevice(); IDirect3DDevice9 *device = getDevice();
D3DFORMAT format = mImageArray[0].getD3DFormat(); D3DFORMAT format = mImageArray[0].getD3DFormat();
GLint levels = creationLevels(mImageArray[0].getWidth(), mImageArray[0].getHeight(), 0); GLint levels = creationLevels(mImageArray[0].getWidth(), mImageArray[0].getHeight());
HRESULT result = device->CreateTexture(mImageArray[0].getWidth(), mImageArray[0].getHeight(), levels, D3DUSAGE_RENDERTARGET, format, D3DPOOL_DEFAULT, &texture, NULL); HRESULT result = device->CreateTexture(mImageArray[0].getWidth(), mImageArray[0].getHeight(), levels, D3DUSAGE_RENDERTARGET, format, D3DPOOL_DEFAULT, &texture, NULL);
......
...@@ -184,8 +184,8 @@ class Texture : public RefCountObject ...@@ -184,8 +184,8 @@ class Texture : public RefCountObject
void setCompressedImage(GLsizei imageSize, const void *pixels, Image *image); void setCompressedImage(GLsizei imageSize, const void *pixels, Image *image);
bool subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *image); bool subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *image);
GLint creationLevels(GLsizei width, GLsizei height, GLint maxlevel) const; GLint creationLevels(GLsizei width, GLsizei height) const;
GLint creationLevels(GLsizei size, GLint maxlevel) const; GLint creationLevels(GLsizei size) const;
virtual IDirect3DBaseTexture9 *getBaseTexture() const = 0; virtual IDirect3DBaseTexture9 *getBaseTexture() const = 0;
virtual void createTexture() = 0; virtual void createTexture() = 0;
......
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