Fix the conversion of textures to rendertargets to use the right number of mip…

Fix the conversion of textures to rendertargets to use the right number of mip levels if we already initialized storage. When a texture was initialized with glStorage2DEXT or similar, the conversion to RT could change the number of mips. TRAC #22560 Signed-off-by: Geoff Lang Signed-off-by: Nicolas Capens Author: Jamie Madill git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1894 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 28e7ba01
......@@ -730,7 +730,7 @@ void Texture2D::convertToRenderTarget()
{
GLsizei width = mImageArray[0]->getWidth();
GLsizei height = mImageArray[0]->getHeight();
GLint levels = creationLevels(width, height);
GLint levels = mTexStorage != NULL ? mTexStorage->levelCount() : creationLevels(width, height);
GLenum internalformat = mImageArray[0]->getInternalFormat();
newTexStorage = new rx::TextureStorageInterface2D(mRenderer, levels, internalformat, GL_FRAMEBUFFER_ATTACHMENT_ANGLE, true, width, height);
......@@ -1189,7 +1189,7 @@ void TextureCubeMap::convertToRenderTarget()
if (mImageArray[0][0]->getWidth() != 0)
{
GLsizei size = mImageArray[0][0]->getWidth();
GLint levels = creationLevels(size);
GLint levels = mTexStorage != NULL ? mTexStorage->levelCount() : creationLevels(size);
GLenum internalformat = mImageArray[0][0]->getInternalFormat();
newTexStorage = new rx::TextureStorageInterfaceCube(mRenderer, levels, internalformat, GL_FRAMEBUFFER_ATTACHMENT_ANGLE, true, size);
......
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