Commit bea739b4 authored by D-AIRY's avatar D-AIRY

Disabled mip generation for BlockCompressed textures

parent df0c9106
......@@ -36,11 +36,18 @@ void XMETHODCALLTYPE CResourceTexture2D::init(UINT uWidth, UINT uHeight, GXFORMA
if(uMipmapCount == IXRESOURCE_TEXTURE_AUTO_MIPS)
{
UINT uSize = min(uWidth, uHeight);
uMipmapCount = 1;
while((uSize >>= 1) >= 4)
if(isBlockCompressed(format))
{
++uMipmapCount;
uMipmapCount = 1;
}
else
{
UINT uSize = min(uWidth, uHeight);
uMipmapCount = 1;
while((uSize >>= 1) >= 4)
{
++uMipmapCount;
}
}
}
......@@ -117,11 +124,18 @@ void XMETHODCALLTYPE CResourceTextureCube::init(UINT uSize, GXFORMAT format, UIN
if(uMipmapCount == IXRESOURCE_TEXTURE_AUTO_MIPS)
{
UINT uTmpSize = uSize;
uMipmapCount = 1;
while((uTmpSize >>= 1) >= 4)
if(isBlockCompressed(format))
{
uMipmapCount = 1;
}
else
{
++uMipmapCount;
UINT uTmpSize = uSize;
uMipmapCount = 1;
while((uTmpSize >>= 1) >= 4)
{
++uMipmapCount;
}
}
}
......
......@@ -136,20 +136,10 @@ public:
switch(format)
{
case GXFMT_DXT1:
bc = true;
case GXFMT_ATI1N:
bcnumBytesPerBlock = 8;
break;
case GXFMT_DXT3:
bc = true;
break;
case GXFMT_DXT5:
bc = true;
break;
case GXFMT_ATI1N:
bc = true;
bcnumBytesPerBlock = 8;
break;
case GXFMT_ATI2N:
bc = true;
break;
......@@ -172,6 +162,21 @@ public:
}
}
bool isBlockCompressed(GXFORMAT format)
{
switch(format)
{
case GXFMT_DXT1:
case GXFMT_ATI1N:
case GXFMT_DXT3:
case GXFMT_DXT5:
case GXFMT_ATI2N:
return(true);
}
return(false);
}
protected:
GXTEXTURE_TYPE m_type = GXTEXTURE_TYPE_UNKNOWN;
GXFORMAT m_format = GXFMT_UNKNOWN;
......
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