From 9e1a9130601aad71309b63a41f16c73babc24f64 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Mon, 23 Feb 2026 04:32:58 -0800 Subject: [PATCH] Increase texture cache budgets to 4GB and cap repetitive warnings Raise all texture cache defaults from 1GB to 4GB to reduce rejections. Cap cache-full warnings (texture + model) to 3 messages per renderer, and cap update block parse errors to 5 messages. --- src/game/game_handler.cpp | 4 +++- src/game/world_packets.cpp | 7 ++++++- src/rendering/character_renderer.cpp | 4 ++-- src/rendering/m2_renderer.cpp | 6 +++--- src/rendering/terrain_renderer.cpp | 4 ++-- src/rendering/wmo_renderer.cpp | 6 +++--- 6 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 755a2c6a..faa7913c 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -4622,7 +4622,9 @@ void GameHandler::handleUpdateObject(network::Packet& packet) { static const bool kVerboseUpdateObject = envFlagEnabled("WOWEE_LOG_UPDATE_OBJECT_VERBOSE", false); UpdateObjectData data; if (!packetParsers_->parseUpdateObject(packet, data)) { - LOG_WARNING("Failed to parse SMSG_UPDATE_OBJECT"); + static int updateObjErrors = 0; + if (++updateObjErrors <= 5) + LOG_WARNING("Failed to parse SMSG_UPDATE_OBJECT"); return; } diff --git a/src/game/world_packets.cpp b/src/game/world_packets.cpp index 68073633..e044d78a 100644 --- a/src/game/world_packets.cpp +++ b/src/game/world_packets.cpp @@ -1253,7 +1253,12 @@ bool UpdateObjectParser::parse(network::Packet& packet, UpdateObjectData& data) UpdateBlock block; if (!parseUpdateBlock(packet, block)) { - LOG_ERROR("Failed to parse update block ", i + 1); + static int parseBlockErrors = 0; + if (++parseBlockErrors <= 5) { + LOG_ERROR("Failed to parse update block ", i + 1); + if (parseBlockErrors == 5) + LOG_ERROR("(suppressing further update block parse errors)"); + } return false; } diff --git a/src/rendering/character_renderer.cpp b/src/rendering/character_renderer.cpp index 7dd5e7fe..4ff49bc7 100644 --- a/src/rendering/character_renderer.cpp +++ b/src/rendering/character_renderer.cpp @@ -294,7 +294,7 @@ bool CharacterRenderer::initialize(VkContext* ctx, VkDescriptorSetLayout perFram } // Diagnostics-only: cache lifetime is currently tied to renderer lifetime. - textureCacheBudgetBytes_ = envSizeMBOrDefault("WOWEE_CHARACTER_TEX_CACHE_MB", 1024) * 1024ull * 1024ull; + textureCacheBudgetBytes_ = envSizeMBOrDefault("WOWEE_CHARACTER_TEX_CACHE_MB", 4096) * 1024ull * 1024ull; LOG_INFO("Character texture cache budget: ", textureCacheBudgetBytes_ / (1024 * 1024), " MB"); core::Logger::getInstance().info("Character renderer initialized (Vulkan)"); @@ -548,7 +548,7 @@ VkTexture* CharacterRenderer::loadTexture(const std::string& path) { // Budget is saturated; avoid repeatedly decoding/uploading this texture. failedTextureCache_.insert(key); } - if (textureBudgetRejectWarnings_ < 8 || (textureBudgetRejectWarnings_ % 120) == 0) { + if (textureBudgetRejectWarnings_ < 3) { core::Logger::getInstance().warning( "Character texture cache full (", textureCacheBytes_ / (1024 * 1024), " MB / ", diff --git a/src/rendering/m2_renderer.cpp b/src/rendering/m2_renderer.cpp index 1ed0e1ed..63fe6427 100644 --- a/src/rendering/m2_renderer.cpp +++ b/src/rendering/m2_renderer.cpp @@ -625,7 +625,7 @@ bool M2Renderer::initialize(VkContext* ctx, VkDescriptorSetLayout perFrameLayout glowTexture_->createSampler(device, VK_FILTER_LINEAR, VK_FILTER_LINEAR, VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE); } textureCacheBudgetBytes_ = - envSizeMBOrDefault("WOWEE_M2_TEX_CACHE_MB", 1024) * 1024ull * 1024ull; + envSizeMBOrDefault("WOWEE_M2_TEX_CACHE_MB", 4096) * 1024ull * 1024ull; modelCacheLimit_ = envSizeMBOrDefault("WOWEE_M2_MODEL_LIMIT", 6000); LOG_INFO("M2 texture cache budget: ", textureCacheBudgetBytes_ / (1024 * 1024), " MB"); LOG_INFO("M2 model cache limit: ", modelCacheLimit_); @@ -859,7 +859,7 @@ bool M2Renderer::loadModel(const pipeline::M2Model& model, uint32_t modelId) { return true; } if (models.size() >= modelCacheLimit_) { - if (modelLimitRejectWarnings_ < 8 || (modelLimitRejectWarnings_ % 120) == 0) { + if (modelLimitRejectWarnings_ < 3) { LOG_WARNING("M2 model cache full (", models.size(), "/", modelCacheLimit_, "), skipping model load: id=", modelId, " name=", model.name); } @@ -3301,7 +3301,7 @@ VkTexture* M2Renderer::loadTexture(const std::string& path, uint32_t texFlags) { // the same textures every frame once budget is saturated. failedTextureCache_.insert(key); } - if (textureBudgetRejectWarnings_ < 8 || (textureBudgetRejectWarnings_ % 120) == 0) { + if (textureBudgetRejectWarnings_ < 3) { LOG_WARNING("M2 texture cache full (", textureCacheBytes_ / (1024 * 1024), " MB / ", textureCacheBudgetBytes_ / (1024 * 1024), " MB), rejecting texture: ", path); diff --git a/src/rendering/terrain_renderer.cpp b/src/rendering/terrain_renderer.cpp index 6618cbe7..67770dfd 100644 --- a/src/rendering/terrain_renderer.cpp +++ b/src/rendering/terrain_renderer.cpp @@ -197,7 +197,7 @@ bool TerrainRenderer::initialize(VkContext* ctx, VkDescriptorSetLayout perFrameL opaqueAlphaTexture->createSampler(device, VK_FILTER_LINEAR, VK_FILTER_LINEAR, VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE); textureCacheBudgetBytes_ = - envSizeMBOrDefault("WOWEE_TERRAIN_TEX_CACHE_MB", 512) * 1024ull * 1024ull; + envSizeMBOrDefault("WOWEE_TERRAIN_TEX_CACHE_MB", 4096) * 1024ull * 1024ull; LOG_INFO("Terrain texture cache budget: ", textureCacheBudgetBytes_ / (1024 * 1024), " MB"); LOG_INFO("Terrain renderer initialized (Vulkan)"); @@ -461,7 +461,7 @@ VkTexture* TerrainRenderer::loadTexture(const std::string& path) { size_t base = static_cast(blp.width) * static_cast(blp.height) * 4ull; size_t approxBytes = base + (base / 3); if (textureCacheBytes_ + approxBytes > textureCacheBudgetBytes_) { - if (textureBudgetRejectWarnings_ < 8 || (textureBudgetRejectWarnings_ % 120) == 0) { + if (textureBudgetRejectWarnings_ < 3) { LOG_WARNING("Terrain texture cache full (", textureCacheBytes_ / (1024 * 1024), " MB / ", textureCacheBudgetBytes_ / (1024 * 1024), " MB), rejecting texture: ", path); diff --git a/src/rendering/wmo_renderer.cpp b/src/rendering/wmo_renderer.cpp index 1ca93250..76a584bc 100644 --- a/src/rendering/wmo_renderer.cpp +++ b/src/rendering/wmo_renderer.cpp @@ -274,7 +274,7 @@ bool WMORenderer::initialize(VkContext* ctx, VkDescriptorSetLayout perFrameLayou flatNormalTexture_->createSampler(device, VK_FILTER_LINEAR, VK_FILTER_LINEAR, VK_SAMPLER_ADDRESS_MODE_REPEAT); textureCacheBudgetBytes_ = - envSizeMBOrDefault("WOWEE_WMO_TEX_CACHE_MB", 1024) * 1024ull * 1024ull; + envSizeMBOrDefault("WOWEE_WMO_TEX_CACHE_MB", 4096) * 1024ull * 1024ull; modelCacheLimit_ = envSizeMBOrDefault("WOWEE_WMO_MODEL_LIMIT", 4000); core::Logger::getInstance().info("WMO texture cache budget: ", textureCacheBudgetBytes_ / (1024 * 1024), " MB"); @@ -393,7 +393,7 @@ bool WMORenderer::loadModel(const pipeline::WMOModel& model, uint32_t id) { } } if (loadedModels.size() >= modelCacheLimit_) { - if (modelLimitRejectWarnings_ < 8 || (modelLimitRejectWarnings_ % 120) == 0) { + if (modelLimitRejectWarnings_ < 3) { core::Logger::getInstance().warning("WMO model cache full (", loadedModels.size(), "/", modelCacheLimit_, "), skipping model load: id=", id); @@ -2259,7 +2259,7 @@ VkTexture* WMORenderer::loadTexture(const std::string& path) { size_t base = static_cast(blp.width) * static_cast(blp.height) * 4ull; size_t approxBytes = base + (base / 3); if (textureCacheBytes_ + approxBytes > textureCacheBudgetBytes_) { - if (textureBudgetRejectWarnings_ < 8 || (textureBudgetRejectWarnings_ % 120) == 0) { + if (textureBudgetRejectWarnings_ < 3) { core::Logger::getInstance().warning( "WMO texture cache full (", textureCacheBytes_ / (1024 * 1024), " MB / ", textureCacheBudgetBytes_ / (1024 * 1024),