Share fragment UBO between shadergen programs

This commit is contained in:
wheremyfoodat 2024-07-25 19:51:29 +03:00
parent df5d14e3d8
commit a0e506affc
2 changed files with 8 additions and 9 deletions

View file

@ -69,11 +69,11 @@ class RendererGL final : public Renderer {
// The "default" vertex shader to use when using specialized shaders but not PICA vertex shader -> GLSL recompilation
// We can compile this once and then link it with all other generated fragment shaders
OpenGL::Shader defaultShadergenVs;
GLuint shadergenFragmentUBO;
// Cached recompiled fragment shader
struct CachedProgram {
OpenGL::Program program;
uint uboBinding;
};
std::unordered_map<PICA::FragmentConfig, CachedProgram> shaderCache;