diff options
| author | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-12-11 01:42:52 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-11 01:42:52 +0200 |
| commit | c92b0b74cbd963cd79d1cb7754256b801f1479b1 (patch) | |
| tree | 5f3cf34559856bdafd950acf0c9a4d6dec59f0bc /indra/llrender/llshadermgr.cpp | |
| parent | dbbce566e7d66c907dde7bd6c4212b0954b9a5e1 (diff) | |
Revert #4899 "Add more functionality to LLFile and cleanup LLAPRFile"
Interferes with linux work, will be moved to a different branch and applied separately.
Diffstat (limited to 'indra/llrender/llshadermgr.cpp')
| -rw-r--r--[-rwxr-xr-x] | indra/llrender/llshadermgr.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 0522307661..2c35a6acae 100755..100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -1014,6 +1014,7 @@ void LLShaderMgr::initShaderCache(bool enabled, const LLUUID& old_cache_version, mShaderCacheDir = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "shader_cache"); LLFile::mkdir(mShaderCacheDir); + { std::string meta_out_path = gDirUtilp->add(mShaderCacheDir, "shaderdata.llsd"); if (gDirUtilp->fileExists(meta_out_path)) @@ -1058,7 +1059,7 @@ void LLShaderMgr::clearShaderCache() LL_INFOS("ShaderMgr") << "Removing shader cache at " << shader_cache << LL_ENDL; const std::string mask = "*"; gDirUtilp->deleteFilesInDir(shader_cache, mask); - LLFile::remove(shader_cache); + LLFile::rmdir(shader_cache); mShaderBinaryCache.clear(); } @@ -1077,7 +1078,7 @@ void LLShaderMgr::persistShaderCacheMetadata() // Settings and shader cache get saved at different time, thus making // RenderShaderCacheVersion unreliable when running multiple viewer // instances, or for cases where viewer crashes before saving settings. - // Duplicate version to the cache itself. + // Dupplicate version to the cache itself. out["version"] = mShaderCacheVersion; out["shaders"] = LLSD::emptyMap(); LLSD &shaders = out["shaders"]; @@ -1130,11 +1131,11 @@ bool LLShaderMgr::loadCachedProgramBinary(LLGLSLShader* shader) { std::vector<U8> in_data; in_data.resize(shader_info.mBinaryLength); - std::error_code ec; - LLFile filep = LLFile(in_path, LLFile::in | LLFile::binary, ec); - if (!ec && (bool)filep) + + LLUniqueFile filep = LLFile::fopen(in_path, "rb"); + if (filep) { - size_t result = filep.read(in_data.data(), in_data.size(), ec); + size_t result = fread(in_data.data(), sizeof(U8), in_data.size(), filep); filep.close(); if (result == in_data.size()) @@ -1179,12 +1180,11 @@ bool LLShaderMgr::saveCachedProgramBinary(LLGLSLShader* shader) if (error == GL_NO_ERROR) { std::string out_path = gDirUtilp->add(mShaderCacheDir, shader->mShaderHash.asString() + ".shaderbin"); - std::error_code ec; - LLFile filep = LLFile(out_path, LLFile::out | LLFile::binary, ec); - if (filep) + LLUniqueFile outfile = LLFile::fopen(out_path, "wb"); + if (outfile) { - filep.write(program_binary.data(), program_binary.size(), ec); - filep.close(); + fwrite(program_binary.data(), sizeof(U8), program_binary.size(), outfile); + outfile.close(); binary_info.mLastUsedTime = (F32)LLTimer::getTotalSeconds(); |
