diff --git a/Source/Urho3D/Graphics/Renderer.cpp b/Source/Urho3D/Graphics/Renderer.cpp index 4424960cd..f6b6d7396 100644 --- a/Source/Urho3D/Graphics/Renderer.cpp +++ b/Source/Urho3D/Graphics/Renderer.cpp @@ -1047,8 +1047,9 @@ Texture* Renderer::GetScreenBuffer(int width, int height, unsigned format, int m screenBufferAllocations_[searchKey] = 0; // Reuse depth-stencil buffers whenever the size matches, instead of allocating new + // Unless persistency specified unsigned allocations = screenBufferAllocations_[searchKey]; - if (!depthStencil) + if (!depthStencil || persistentKey) ++screenBufferAllocations_[searchKey]; if (allocations >= screenBuffers_[searchKey].Size()) @@ -1386,17 +1387,6 @@ bool Renderer::ResizeInstancingBuffer(unsigned numInstances) return true; } -void Renderer::SaveScreenBufferAllocations() -{ - savedScreenBufferAllocations_ = screenBufferAllocations_; -} - -void Renderer::RestoreScreenBufferAllocations() -{ - screenBufferAllocations_ = savedScreenBufferAllocations_; -} - - void Renderer::OptimizeLightByScissor(Light* light, Camera* camera) { if (light && light->GetLightType() != LIGHT_DIRECTIONAL) diff --git a/Source/Urho3D/Graphics/Renderer.h b/Source/Urho3D/Graphics/Renderer.h index 2c28ac10b..3d69c7e5d 100644 --- a/Source/Urho3D/Graphics/Renderer.h +++ b/Source/Urho3D/Graphics/Renderer.h @@ -415,10 +415,6 @@ public: void SetCullMode(CullMode mode, Camera* camera); /// Ensure sufficient size of the instancing vertex buffer. Return true if successful. bool ResizeInstancingBuffer(unsigned numInstances); - /// Save the screen buffer allocation status. Called by View. - void SaveScreenBufferAllocations(); - /// Restore the screen buffer allocation status. Called by View. - void RestoreScreenBufferAllocations(); /// Optimize a light by scissor rectangle. void OptimizeLightByScissor(Light* light, Camera* camera); /// Optimize a light by marking it to the stencil buffer and setting a stencil test. diff --git a/bin/CoreData/RenderPaths/DeferredHWDepth.xml b/bin/CoreData/RenderPaths/DeferredHWDepth.xml index d2391b2b0..74d6da39c 100644 --- a/bin/CoreData/RenderPaths/DeferredHWDepth.xml +++ b/bin/CoreData/RenderPaths/DeferredHWDepth.xml @@ -1,7 +1,7 @@ - + diff --git a/bin/CoreData/RenderPaths/PBRDeferredHWDepth.xml b/bin/CoreData/RenderPaths/PBRDeferredHWDepth.xml index b8922a1e9..fff410902 100644 --- a/bin/CoreData/RenderPaths/PBRDeferredHWDepth.xml +++ b/bin/CoreData/RenderPaths/PBRDeferredHWDepth.xml @@ -2,7 +2,7 @@ - + diff --git a/bin/CoreData/RenderPaths/PrepassHWDepth.xml b/bin/CoreData/RenderPaths/PrepassHWDepth.xml index 82a8d936e..3d40e455d 100644 --- a/bin/CoreData/RenderPaths/PrepassHWDepth.xml +++ b/bin/CoreData/RenderPaths/PrepassHWDepth.xml @@ -1,7 +1,7 @@ - +