mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
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.
This commit is contained in:
parent
820a36ac12
commit
9e1a913060
6 changed files with 19 additions and 12 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 / ",
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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<size_t>(blp.width) * static_cast<size_t>(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);
|
||||
|
|
|
|||
|
|
@ -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<size_t>(blp.width) * static_cast<size_t>(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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue