[Shader JIT] Add caching

This commit is contained in:
wheremyfoodat 2023-06-07 20:33:37 +03:00
parent 364443d66f
commit 4064abfdeb
9 changed files with 77 additions and 5 deletions
src/core/PICA/dynapica

View file

@ -1,7 +1,14 @@
#include "PICA/dynapica/shader_rec.hpp"
#include "cityhash.hpp"
#ifdef PANDA3DS_SHADER_JIT_SUPPORTED
void ShaderJIT::reset() {
cache.clear();
}
void ShaderJIT::prepare(PICAShader& shaderUnit) {
printf("HAPPY HAPPY HAPPY\n");
// We construct a shader hash from both the code and operand descriptor hashes
// This is so that if only one of them changes, we still properly recompile the shader
Hash hash = shaderUnit.getCodeHash() ^ shaderUnit.getOpdescHash();
}
#endif // PANDA3DS_SHADER_JIT_SUPPORTED