mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-07-08 00:02:58 +12:00
Properly flush shader cache
This commit is contained in:
parent
fe53214c86
commit
11c9279329
3 changed files with 42 additions and 25 deletions
|
@ -23,6 +23,11 @@ void RendererGL::reset() {
|
|||
colourBufferCache.reset();
|
||||
textureCache.reset();
|
||||
|
||||
for (auto& shader : shaderCache) {
|
||||
shader.second.program.free();
|
||||
}
|
||||
shaderCache.clear();
|
||||
|
||||
// Init the colour/depth buffer settings to some random defaults on reset
|
||||
colourBufferLoc = 0;
|
||||
colourBufferFormat = PICA::ColorFmt::RGBA8;
|
||||
|
@ -899,6 +904,11 @@ void RendererGL::deinitGraphicsContext() {
|
|||
depthBufferCache.reset();
|
||||
colourBufferCache.reset();
|
||||
|
||||
for (auto& shader : shaderCache) {
|
||||
shader.second.program.free();
|
||||
}
|
||||
shaderCache.clear();
|
||||
|
||||
// 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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue