From 2bbcdfade2ec9ea316a8f980d36824ff4039e56f Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Sun, 9 Jul 2023 01:40:30 +0300 Subject: [PATCH] Add proper warning to surface cache --- include/renderer_gl/surface_cache.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/renderer_gl/surface_cache.hpp b/include/renderer_gl/surface_cache.hpp index 8d3ae5e5..44580fef 100644 --- a/include/renderer_gl/surface_cache.hpp +++ b/include/renderer_gl/surface_cache.hpp @@ -57,6 +57,10 @@ public: SurfaceType& add(const SurfaceType& surface) { if (size >= capacity) { if constexpr (evictOnOverflow) { // Do a ring buffer if evictOnOverflow is true + if constexpr (std::is_same() || std::is_same()) { + Helpers::panicDev("Colour/Depth buffer cache overflowed, currently stubbed to do a ring-buffer. This might snap in half"); + } + auto& e = buffer[evictionIndex]; evictionIndex = (evictionIndex + 1) % capacity;