Skip to content

Commit

Permalink
OpenGL: Restore ProgramBinary cache for GL shaders (#1209)
Browse files Browse the repository at this point in the history
  • Loading branch information
goeiecool9999 committed May 22, 2024
1 parent c913a59 commit 523a165
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Cafe/HW/Latte/Renderer/OpenGL/RendererShaderGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,13 @@ bool RendererShaderGL::loadBinary()
cemu_assert_debug(m_baseHash != 0);
uint64 h1, h2;
GenerateShaderPrecompiledCacheFilename(m_type, m_baseHash, m_auxHash, h1, h2);
sint32 fileSize = 0;
std::vector<uint8> cacheFileData;
if (!s_programBinaryCache->GetFile({h1, h2 }, cacheFileData))
return false;
if (fileSize < sizeof(uint32))
{
if (cacheFileData.size() <= sizeof(uint32))
return false;
}

uint32 shaderBinFormat = *(uint32*)(cacheFileData.data() + 0);
uint32 shaderBinFormat = *(uint32*)(cacheFileData.data());

m_program = glCreateProgram();
glProgramBinary(m_program, shaderBinFormat, cacheFileData.data()+4, cacheFileData.size()-4);
Expand Down

0 comments on commit 523a165

Please sign in to comment.