mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-20 20:49:12 +12:00
[Shader JIT] Moar
This commit is contained in:
parent
6a70edca7e
commit
415e276ef9
7 changed files with 51 additions and 8 deletions
|
@ -7,6 +7,7 @@ void ShaderJIT::reset() {
|
|||
}
|
||||
|
||||
void ShaderJIT::prepare(PICAShader& shaderUnit) {
|
||||
shaderUnit.pc = shaderUnit.entrypoint;
|
||||
// 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
|
||||
// This code is inspired from how Citra solves this problem
|
||||
|
@ -15,11 +16,10 @@ void ShaderJIT::prepare(PICAShader& shaderUnit) {
|
|||
|
||||
if (it == cache.end()) { // Block has not been compiled yet
|
||||
auto emitter = std::make_unique<ShaderEmitter>();
|
||||
emitter->compile(shaderUnit);
|
||||
cache.emplace_hint(it, hash, std::move(emitter));
|
||||
} else { // Block has been compiled and found, use it
|
||||
|
||||
auto emitter = it->second.get();
|
||||
}
|
||||
|
||||
shaderUnit.pc = shaderUnit.entrypoint;
|
||||
}
|
||||
#endif // PANDA3DS_SHADER_JIT_SUPPORTED
|
11
src/core/PICA/dynapica/shader_rec_emitter_x64.cpp
Normal file
11
src/core/PICA/dynapica/shader_rec_emitter_x64.cpp
Normal file
|
@ -0,0 +1,11 @@
|
|||
#if defined(PANDA3DS_DYNAPICA_SUPPORTED) && defined(PANDA3DS_X64_HOST)
|
||||
#include "PICA/dynapica/shader_rec_emitter_x64.hpp"
|
||||
|
||||
using namespace Xbyak;
|
||||
using namespace Xbyak::util;
|
||||
|
||||
void ShaderEmitter::compile(const PICAShader& shaderUnit) {
|
||||
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue