mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-24 08:00:14 +00:00
Allow texture load retries instead of permanently caching failures
Remove negative cache for transient load failures in M2, terrain, and character renderers. Failed textures return white and will be retried on next model/tile load when assets may have finished streaming.
This commit is contained in:
parent
3e6de8485b
commit
93f873b521
4 changed files with 11 additions and 25 deletions
|
|
@ -442,16 +442,10 @@ VkTexture* TerrainRenderer::loadTexture(const std::string& path) {
|
|||
it->second.lastUse = ++textureCacheCounter_;
|
||||
return it->second.texture.get();
|
||||
}
|
||||
if (failedTextureCache_.count(key)) {
|
||||
return whiteTexture.get();
|
||||
}
|
||||
|
||||
pipeline::BLPImage blp = assetManager->loadTexture(key);
|
||||
if (!blp.isValid()) {
|
||||
static constexpr size_t kMaxFailedTextureCache = 200000;
|
||||
if (failedTextureCache_.size() < kMaxFailedTextureCache) {
|
||||
failedTextureCache_.insert(key);
|
||||
}
|
||||
// Return white fallback but don't cache the failure — allow retry
|
||||
// on next tile load in case the asset becomes available.
|
||||
if (loggedTextureLoadFails_.insert(key).second) {
|
||||
LOG_WARNING("Failed to load texture: ", path);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue