diff --git a/indra/newview/daeexport.cpp b/indra/newview/daeexport.cpp index bb2562b1ff..c9de9a8c32 100644 --- a/indra/newview/daeexport.cpp +++ b/indra/newview/daeexport.cpp @@ -505,7 +505,15 @@ void ColladaExportFloater::CacheReadResponder::saveTexturesWorker(void* data) std::string name = gDirUtilp->getDirName(me->mFilename); name += gDirUtilp->getDirDelimiter() + me->mTexturesToSave[id]; CacheReadResponder* responder = new CacheReadResponder(id, img, name, img_type); - LLAppViewer::getTextureCache()->readFromCache(id, 0, 999999, responder); + // [FIRE-35292] Fix for textures getting downscaled and compressed + //LLAppViewer::getTextureCache()->readFromCache(id, 0, 999999, responder); + // The above line hard coded the size of data to read from the cached version of the texture as 999999, + // where now we will calcuate the correct value based upon the texture's full width, height and # of components (3=RGB, 4=RGBA) and + // the discard level (0)). There is a choice to change the rate, but we seem to use the value of 1/8 compression level + S32 texture_size = LLImageJ2C::calcDataSizeJ2C(imagep->getFullWidth(), imagep->getFullHeight(), imagep->getComponents(), 0);// , F32 rate) rate = const F32 DEFAULT_COMPRESSION_RATE = 1.f/8.f; + // Use calculated texture_size (from LLTextureFetch::createRequest see "else if (w*h*c > 0)" statement for more info) + LLAppViewer::getTextureCache()->readFromCache(id, 0, texture_size, responder); + // [FIRE-35292] me->mTexturesToSave.erase(id); me->updateTitleProgress(); me->mTimer.reset();