Fix GPU resource leaks and re-entrant world loading for instance transitions

Reset descriptor pools in CharacterRenderer/M2Renderer/WMORenderer on map
change to prevent VK_ERROR_DEVICE_LOST from pool exhaustion. Defer re-entrant
SMSG_NEW_WORLD during active world load to avoid recursive cleanup crashes.
Gate swim bubbles on swimming state, skip redundant shadow pipeline re-init,
add WOWEE_SKIP_* env vars for render isolation debugging.
This commit is contained in:
Kelsi 2026-03-02 08:06:35 -08:00
parent 19652ae521
commit 48eb0b70a3
9 changed files with 255 additions and 47 deletions

View file

@ -9,6 +9,7 @@
#include <unordered_map>
#include <unordered_set>
#include <array>
#include <optional>
namespace wowee {
@ -189,6 +190,12 @@ private:
uint32_t wyvernDisplayId_ = 0;
bool lastTaxiFlight_ = false;
uint32_t loadedMapId_ = 0xFFFFFFFF; // Map ID of currently loaded terrain (0xFFFFFFFF = none)
uint32_t worldLoadGeneration_ = 0; // Incremented on each world entry to detect re-entrant loads
bool loadingWorld_ = false; // True while loadOnlineWorldTerrain is running
struct PendingWorldEntry {
uint32_t mapId; float x, y, z;
};
std::optional<PendingWorldEntry> pendingWorldEntry_; // Deferred world entry during loading
float taxiLandingClampTimer_ = 0.0f;
float worldEntryMovementGraceTimer_ = 0.0f;
float facingSendCooldown_ = 0.0f; // Rate-limits MSG_MOVE_SET_FACING

View file

@ -48,6 +48,7 @@ public:
VkRenderPass renderPassOverride = VK_NULL_HANDLE,
VkSampleCountFlagBits msaaSamples = VK_SAMPLE_COUNT_1_BIT);
void shutdown();
void clear(); // Remove all models/instances/textures but keep pipelines/pools
void setAssetManager(pipeline::AssetManager* am) { assetManager = am; }

View file

@ -254,6 +254,7 @@ public:
* Initialize shadow pipeline (Phase 7)
*/
bool initializeShadow(VkRenderPass shadowRenderPass);
bool hasShadowPipeline() const { return shadowPipeline_ != VK_NULL_HANDLE; }
/**
* Render depth-only pass for shadow casting