Add Renderer::deinitGraphicsContext
This commit is contained in:
@@ -801,4 +801,15 @@ void RendererGL::screenshot(const std::string& name) {
|
||||
}
|
||||
|
||||
stbi_write_png(name.c_str(), width, height, 4, flippedPixels.data(), 0);
|
||||
}
|
||||
|
||||
void RendererGL::deinitGraphicsContext() {
|
||||
// Invalidate all surface caches since they'll no longer be valid
|
||||
textureCache.reset();
|
||||
depthBufferCache.reset();
|
||||
colourBufferCache.reset();
|
||||
|
||||
// All other GL objects should be invalidated automatically and be recreated by the next call to initGraphicsContext
|
||||
// TODO: Make it so that depth and colour buffers get written back to 3DS memory
|
||||
printf("RendererGL::DeinitGraphicsContext called\n");
|
||||
}
|
||||
@@ -12,3 +12,4 @@ void RendererNull::displayTransfer(u32 inputAddr, u32 outputAddr, u32 inputSize,
|
||||
void RendererNull::textureCopy(u32 inputAddr, u32 outputAddr, u32 totalBytes, u32 inputSize, u32 outputSize, u32 flags) {}
|
||||
void RendererNull::drawVertices(PICA::PrimType primType, std::span<const PICA::Vertex> vertices) {}
|
||||
void RendererNull::screenshot(const std::string& name) {}
|
||||
void RendererNull::deinitGraphicsContext() {}
|
||||
@@ -23,3 +23,4 @@ void RendererSw::drawVertices(PICA::PrimType primType, std::span<const PICA::Ver
|
||||
}
|
||||
|
||||
void RendererSw::screenshot(const std::string& name) { printf("RendererSW: Unimplemented screenshot call\n"); }
|
||||
void RendererSw::deinitGraphicsContext() { printf("RendererSW: Unimplemented DeinitGraphicsContext call\n"); }
|
||||
@@ -1581,3 +1581,11 @@ void RendererVK::drawVertices(PICA::PrimType primType, std::span<const PICA::Ver
|
||||
}
|
||||
|
||||
void RendererVK::screenshot(const std::string& name) {}
|
||||
|
||||
void RendererVK::deinitGraphicsContext() {
|
||||
// Invalidate the entire texture cache since they'll no longer be valid
|
||||
textureCache.clear();
|
||||
|
||||
// TODO: Make it so that depth and colour buffers get written back to 3DS memory
|
||||
printf("RendererVK::DeinitGraphicsContext called\n");
|
||||
}
|
||||
Reference in New Issue
Block a user