Some preparations

This commit is contained in:
Henrik Rydgård committed 2023-02-16 23:17:08 +01:00
1 parent be833550ec
commit b5de9e0cc3
5 files changed
+52 -5

No files matched your search

+15
View File
@@ -3,6 +3,21 @@
#include "Common/GPU/OpenGL/GLRenderManager.h"
#include "Common/Log.h"
void GLCachedReadback::Destroy(bool skipGLCalls) {
if (buffer && !skipGLCalls) {
glDeleteBuffers(1, &buffer);
}
buffer = 0;
}
void GLFrameData::Destroy(bool skipGLCalls) {
readbacks_.IterateMut([=](const GLReadbackKey &key, GLCachedReadback *value) {
value->Destroy(skipGLCalls);
delete value;
});
readbacks_.Clear();
}
void GLDeleter::Take(GLDeleter &other) {
_assert_msg_(IsEmpty(), "Deleter already has stuff");
shaders = std::move(other.shaders);