Shader decompiler: Fix redundant compilations

This commit is contained in:
wheremyfoodat 2024-07-25 23:36:22 +03:00
parent 69accdec54
commit efcb42af2c
2 changed files with 1 additions and 2 deletions

View file

@ -95,7 +95,6 @@ class RendererGL final : public Renderer {
for (auto& it : programCache) {
CachedProgram& cachedProgram = it.second;
cachedProgram.program.free();
glDeleteBuffers(1, &cachedProgram.uboBinding);
}
for (auto& it : vertexShaderCache) {

View file

@ -944,7 +944,7 @@ bool RendererGL::prepareForDraw(ShaderUnit& shaderUnit, bool isImmediateMode) {
// If the optional is false, we have never tried to recompile the shader before. Try to recompile it and see if it works.
if (!shader.has_value()) {
// Initialize shader to a "null" shader (handle == 0)
*shader = OpenGL::Shader();
shader = OpenGL::Shader();
std::string picaShaderSource = PICA::ShaderGen::decompileShader(
shaderUnit.vs, *emulatorConfig, shaderUnit.vs.entrypoint, PICA::ShaderGen::API::GL, PICA::ShaderGen::Language::GLSL