// // Created by atdunbg on 2026/9/23. // // Cubemap 实现:纯资源持有(构造注入 + 成对析构)。 // 预积分生成见 IblGenerator(compute 链);CPU 积分路径已整体移除, // 环境切换从秒级阻塞降到毫秒级 GPU 提交。 // #include #include #include namespace Engine { Cubemap::~Cubemap() { const auto& vkDevice = m_Device.GetDevice(); vkDevice.destroySampler(m_EnvSampler); vkDevice.destroySampler(m_LutSampler); // 三元组成对释放:view → (image + 显存) 经 VMA 成对销毁 for (EnvTexture* tex : {&m_Env, &m_Irr, &m_Pref, &m_Lut}) { vkDevice.destroyImageView(tex->view); m_Allocator.Destroy(tex->allocation); } } } // namespace Engine