Fix per-frame particle descriptor set leak in M2 renderer

Pre-allocate one stable VkDescriptorSet per particle emitter at model
upload time (particleTexSets[]) instead of allocating a new set from
materialDescPool_ every frame for each particle group.  The per-frame
path exhausted the 8192-set pool in ~14 s at 60 fps with 10 active
particle emitters, causing GPU device-lost crashes.  The old path is
kept as an explicit fallback but should never be reached in practice.
This commit is contained in:
Kelsi 2026-03-11 02:01:23 -07:00
parent 570465f51a
commit 7c77c4a81e
2 changed files with 59 additions and 18 deletions

View file

@ -127,7 +127,8 @@ struct M2ModelGPU {
// Particle emitter data (kept from M2Model)
std::vector<pipeline::M2ParticleEmitter> particleEmitters;
std::vector<VkTexture*> particleTextures; // Resolved Vulkan textures per emitter
std::vector<VkTexture*> particleTextures; // Resolved Vulkan textures per emitter
std::vector<VkDescriptorSet> particleTexSets; // Pre-allocated descriptor sets per emitter (stable, avoids per-frame alloc)
// Texture transform data for UV animation
std::vector<pipeline::M2TextureTransform> textureTransforms;