diff --git a/include/Nazara/Graphics/BakedFrameGraph.hpp b/include/Nazara/Graphics/BakedFrameGraph.hpp index 7aec5064d..5d23f02cc 100644 --- a/include/Nazara/Graphics/BakedFrameGraph.hpp +++ b/include/Nazara/Graphics/BakedFrameGraph.hpp @@ -36,7 +36,7 @@ namespace Nz const std::shared_ptr& GetAttachmentTexture(std::size_t attachmentIndex) const; const std::shared_ptr& GetRenderPass(std::size_t passIndex) const; - bool Resize(unsigned int width, unsigned int height); + bool Resize(RenderFrame& renderFrame); BakedFrameGraph& operator=(const BakedFrameGraph&) = delete; BakedFrameGraph& operator=(BakedFrameGraph&&) noexcept = default; diff --git a/src/Nazara/Graphics/BakedFrameGraph.cpp b/src/Nazara/Graphics/BakedFrameGraph.cpp index 906d4e7fa..ff1d80e99 100644 --- a/src/Nazara/Graphics/BakedFrameGraph.cpp +++ b/src/Nazara/Graphics/BakedFrameGraph.cpp @@ -123,8 +123,9 @@ namespace Nz return m_passes[physicalPassIndex].renderPass; } - bool BakedFrameGraph::Resize(unsigned int width, unsigned int height) + bool BakedFrameGraph::Resize(RenderFrame& renderFrame) { + auto [width, height] = renderFrame.GetSize(); if (m_width == width && m_height == height) return false; @@ -133,12 +134,12 @@ namespace Nz // Delete previous textures to make some room in VRAM for (auto& passData : m_passes) { - passData.commandBuffer.reset(); - passData.framebuffer.reset(); + renderFrame.PushForRelease(std::move(passData.commandBuffer)); + renderFrame.PushForRelease(std::move(passData.framebuffer)); } for (auto& textureData : m_textures) - textureData.texture.reset(); + renderFrame.PushForRelease(std::move(textureData.texture)); for (auto& textureData : m_textures) {