mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 07:04:36 +00:00
a) grab the source mipmap levels not the dest ones for copy. b) lets rely less on trusting sizeof*4 when we've gor a size per pixel lookup already there
This commit is contained in:
parent
24e6d8c73c
commit
ce2b05e0e2
2 changed files with 2 additions and 2 deletions
|
|
@ -475,7 +475,7 @@ void GFXGLDevice::copyResource(GFXTextureObject* pDst, GFXCubemap* pSrc, const U
|
||||||
|
|
||||||
const bool isCompressed = ImageUtil::isCompressedFormat(format);
|
const bool isCompressed = ImageUtil::isCompressedFormat(format);
|
||||||
|
|
||||||
U32 mipLevels = gGLDst->getMipLevels();
|
U32 mipLevels = pGLSrc->getMipMapLevels();
|
||||||
for (U32 mip = 0; mip < mipLevels; mip++)
|
for (U32 mip = 0; mip < mipLevels; mip++)
|
||||||
{
|
{
|
||||||
const U32 mipSize = getMax(U32(1), pGLSrc->getSize() >> mip);
|
const U32 mipSize = getMax(U32(1), pGLSrc->getSize() >> mip);
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,7 @@ bool GFXGLTextureObject::copyToBmp(GBitmap * bmp)
|
||||||
PROFILE_START(GFXGLTextureObject_copyToBmp_pixCopy);
|
PROFILE_START(GFXGLTextureObject_copyToBmp_pixCopy);
|
||||||
if (mFormat == GFXFormatR16G16B16A16F)
|
if (mFormat == GFXFormatR16G16B16A16F)
|
||||||
{
|
{
|
||||||
dMemcpy(dest, orig, srcPixelCount * sizeof(U16) * 4);
|
dMemcpy(dest, orig, srcPixelCount * srcBytesPerPixel);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue