diff options
Diffstat (limited to 'src/runtimerender/Qt3DSRenderCustomMaterialSystem.cpp')
-rw-r--r-- | src/runtimerender/Qt3DSRenderCustomMaterialSystem.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/runtimerender/Qt3DSRenderCustomMaterialSystem.cpp b/src/runtimerender/Qt3DSRenderCustomMaterialSystem.cpp index 4e090a9..4e109dd 100644 --- a/src/runtimerender/Qt3DSRenderCustomMaterialSystem.cpp +++ b/src/runtimerender/Qt3DSRenderCustomMaterialSystem.cpp @@ -909,10 +909,10 @@ struct SMaterialSystem : public ICustomMaterialSystem void clearImageAndBufferCaches() { while (m_AllocatedBuffers.size()) - ReleaseBuffer(0); + ReleaseBuffer(0, true); } - void ReleaseBuffer(QT3DSU32 inIdx) + void ReleaseBuffer(QT3DSU32 inIdx, bool forceRelease) { // Don't call this on MaterialSystem destroy. // This causes issues for scene liftime buffers @@ -922,8 +922,8 @@ struct SMaterialSystem : public ICustomMaterialSystem theEntry.m_FrameBuffer->Attach(NVRenderFrameBufferAttachments::Color0, NVRenderTextureOrRenderBuffer()); - theManager.Release(*theEntry.m_FrameBuffer); - theManager.Release(*theEntry.m_Texture); + theManager.Release(*theEntry.m_FrameBuffer, forceRelease); + theManager.Release(*theEntry.m_Texture, forceRelease); m_AllocatedBuffers.replace_with_last(inIdx); } @@ -1513,7 +1513,7 @@ struct SMaterialSystem : public ICustomMaterialSystem && theDetails.m_Format == theFormat) { theTexture = theEntry.m_Texture; } else { - ReleaseBuffer(bufferIdx); + ReleaseBuffer(bufferIdx, false); } } @@ -1885,7 +1885,7 @@ struct SMaterialSystem : public ICustomMaterialSystem // Release any per-frame buffers for (QT3DSU32 idx = 0; idx < m_AllocatedBuffers.size(); ++idx) { if (m_AllocatedBuffers[idx].m_Flags.IsSceneLifetime() == false) { - ReleaseBuffer(idx); + ReleaseBuffer(idx, false); --idx; } } |