summaryrefslogtreecommitdiff
path: root/indra/newview/llmeshrepository.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llmeshrepository.cpp')
-rw-r--r--indra/newview/llmeshrepository.cpp54
1 files changed, 26 insertions, 28 deletions
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index c5ced425f6..55c64508d2 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -294,8 +294,6 @@
// * Header parse failures come without much explanation. Elaborate.
// * Work queue for uploads? Any need for this or is the current scheme good
// enough?
-// * Various temp buffers used in VFS I/O might be allocated once or even
-// statically. Look for some wins here.
// * Move data structures holding mesh data used by main thread into main-
// thread-only access so that no locking is needed. May require duplication
// of some data so that worker thread has a minimal data set to guide
@@ -1336,8 +1334,8 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id)
if (version <= MAX_MESH_VERSION && offset >= 0 && size > 0)
{
- //check VFS for mesh skin info
- LLVFile file(gVFS, mesh_id, LLAssetType::AT_MESH);
+ //check cache for mesh skin info
+ LLVFile file(mesh_id, LLAssetType::AT_MESH);
if (file.getSize() >= offset+size)
{
U8* buffer = new(std::nothrow) U8[size];
@@ -1370,7 +1368,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id)
delete[] buffer;
}
- //reading from VFS failed for whatever reason, fetch from sim
+ //reading from cache failed for whatever reason, fetch from sim
std::string http_url;
constructUrl(mesh_id, &http_url);
@@ -1432,8 +1430,8 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id)
if (version <= MAX_MESH_VERSION && offset >= 0 && size > 0)
{
- //check VFS for mesh skin info
- LLVFile file(gVFS, mesh_id, LLAssetType::AT_MESH);
+ //check cache for mesh skin info
+ LLVFile file(mesh_id, LLAssetType::AT_MESH);
if (file.getSize() >= offset+size)
{
U8* buffer = new(std::nothrow) U8[size];
@@ -1467,7 +1465,7 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id)
delete[] buffer;
}
- //reading from VFS failed for whatever reason, fetch from sim
+ //reading from cache failed for whatever reason, fetch from sim
std::string http_url;
constructUrl(mesh_id, &http_url);
@@ -1529,8 +1527,8 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id)
if (version <= MAX_MESH_VERSION && offset >= 0 && size > 0)
{
- //check VFS for mesh physics shape info
- LLVFile file(gVFS, mesh_id, LLAssetType::AT_MESH);
+ //check cache for mesh physics shape info
+ LLVFile file(mesh_id, LLAssetType::AT_MESH);
if (file.getSize() >= offset+size)
{
LLMeshRepository::sCacheBytesRead += size;
@@ -1563,7 +1561,7 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id)
delete[] buffer;
}
- //reading from VFS failed for whatever reason, fetch from sim
+ //reading from cache failed for whatever reason, fetch from sim
std::string http_url;
constructUrl(mesh_id, &http_url);
@@ -1634,8 +1632,8 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params, bool c
++LLMeshRepository::sMeshRequestCount;
{
- //look for mesh in asset in vfs
- LLVFile file(gVFS, mesh_params.getSculptID(), LLAssetType::AT_MESH);
+ //look for mesh in asset in cache
+ LLVFile file(mesh_params.getSculptID(), LLAssetType::AT_MESH);
S32 size = file.getSize();
@@ -1649,7 +1647,7 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params, bool c
file.read(buffer, bytes);
if (headerReceived(mesh_params, buffer, bytes))
{
- // Found mesh in VFS cache
+ // Found mesh in cache
return true;
}
}
@@ -1713,8 +1711,8 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod,
if (version <= MAX_MESH_VERSION && offset >= 0 && size > 0)
{
- //check VFS for mesh asset
- LLVFile file(gVFS, mesh_id, LLAssetType::AT_MESH);
+ //check cache for mesh asset
+ LLVFile file(mesh_id, LLAssetType::AT_MESH);
if (file.getSize() >= offset+size)
{
U8* buffer = new(std::nothrow) U8[size];
@@ -1749,7 +1747,7 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod,
delete[] buffer;
}
- //reading from VFS failed for whatever reason, fetch from sim
+ //reading from cache failed for whatever reason, fetch from sim
std::string http_url;
constructUrl(mesh_id, &http_url);
@@ -3162,7 +3160,7 @@ void LLMeshHeaderHandler::processData(LLCore::BufferArray * /* body */, S32 /* b
}
else if (data && data_size > 0)
{
- // header was successfully retrieved from sim and parsed, cache in vfs
+ // header was successfully retrieved from sim and parsed and is in cache
S32 header_bytes = 0;
LLSD header;
@@ -3199,10 +3197,10 @@ void LLMeshHeaderHandler::processData(LLCore::BufferArray * /* body */, S32 /* b
// It's possible for the remote asset to have more data than is needed for the local cache
- // only allocate as much space in the VFS as is needed for the local cache
+ // only allocate as much space in the cache as is needed for the local cache
data_size = llmin(data_size, bytes);
- LLVFile file(gVFS, mesh_id, LLAssetType::AT_MESH, LLVFile::WRITE);
+ LLVFile file(mesh_id, LLAssetType::AT_MESH, LLVFile::WRITE);
if (file.getMaxSize() >= bytes || file.setMaxSize(bytes))
{
LLMeshRepository::sCacheBytesWritten += data_size;
@@ -3273,8 +3271,8 @@ void LLMeshLODHandler::processData(LLCore::BufferArray * /* body */, S32 /* body
EMeshProcessingResult result = gMeshRepo.mThread->lodReceived(mMeshParams, mLOD, data, data_size);
if (result == MESH_OK)
{
- // good fetch from sim, write to VFS for caching
- LLVFile file(gVFS, mMeshParams.getSculptID(), LLAssetType::AT_MESH, LLVFile::WRITE);
+ // good fetch from sim, write to cache
+ LLVFile file(mMeshParams.getSculptID(), LLAssetType::AT_MESH, LLVFile::WRITE);
S32 offset = mOffset;
S32 size = mRequestedBytes;
@@ -3337,8 +3335,8 @@ void LLMeshSkinInfoHandler::processData(LLCore::BufferArray * /* body */, S32 /*
&& ((data != NULL) == (data_size > 0)) // if we have data but no size or have size but no data, something is wrong
&& gMeshRepo.mThread->skinInfoReceived(mMeshID, data, data_size))
{
- // good fetch from sim, write to VFS for caching
- LLVFile file(gVFS, mMeshID, LLAssetType::AT_MESH, LLVFile::WRITE);
+ // good fetch from sim, write to cache
+ LLVFile file(mMeshID, LLAssetType::AT_MESH, LLVFile::WRITE);
S32 offset = mOffset;
S32 size = mRequestedBytes;
@@ -3385,8 +3383,8 @@ void LLMeshDecompositionHandler::processData(LLCore::BufferArray * /* body */, S
&& ((data != NULL) == (data_size > 0)) // if we have data but no size or have size but no data, something is wrong
&& gMeshRepo.mThread->decompositionReceived(mMeshID, data, data_size))
{
- // good fetch from sim, write to VFS for caching
- LLVFile file(gVFS, mMeshID, LLAssetType::AT_MESH, LLVFile::WRITE);
+ // good fetch from sim, write to cache
+ LLVFile file(mMeshID, LLAssetType::AT_MESH, LLVFile::WRITE);
S32 offset = mOffset;
S32 size = mRequestedBytes;
@@ -3432,8 +3430,8 @@ void LLMeshPhysicsShapeHandler::processData(LLCore::BufferArray * /* body */, S3
&& ((data != NULL) == (data_size > 0)) // if we have data but no size or have size but no data, something is wrong
&& gMeshRepo.mThread->physicsShapeReceived(mMeshID, data, data_size))
{
- // good fetch from sim, write to VFS for caching
- LLVFile file(gVFS, mMeshID, LLAssetType::AT_MESH, LLVFile::WRITE);
+ // good fetch from sim, write to cache for caching
+ LLVFile file(mMeshID, LLAssetType::AT_MESH, LLVFile::WRITE);
S32 offset = mOffset;
S32 size = mRequestedBytes;