mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-22 05:15:51 +12:00
[Shader JIT] Moar
This commit is contained in:
parent
6a70edca7e
commit
415e276ef9
7 changed files with 51 additions and 8 deletions
|
@ -7,8 +7,7 @@
|
|||
#include <unordered_map>
|
||||
|
||||
#ifdef PANDA3DS_X64_HOST
|
||||
#include "xbyak/xbyak.h"
|
||||
using ShaderEmitter = Xbyak::CodeGenerator;
|
||||
#include "shader_rec_emitter_x64.hpp"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -16,6 +15,7 @@ class ShaderJIT {
|
|||
#ifdef PANDA3DS_SHADER_JIT_SUPPORTED
|
||||
using Hash = PICAShader::Hash;
|
||||
using ShaderCache = std::unordered_map<Hash, std::unique_ptr<ShaderEmitter>>;
|
||||
ShaderEmitter::Callback activeShaderCallback;
|
||||
|
||||
ShaderCache cache;
|
||||
void compileShader(PICAShader& shaderUnit);
|
||||
|
@ -35,8 +35,13 @@ public:
|
|||
Helpers::panic("Vertex Loader JIT: Tried to load vertices with JIT on platform that does not support vertex loader jit");
|
||||
}
|
||||
|
||||
// Define dummy callback. This should never be called if the shader JIT is not supported
|
||||
using Callback = void(*)(PICAShader& shaderUnit);
|
||||
Callback activeShaderCallback = nullptr;
|
||||
|
||||
void reset() {}
|
||||
static constexpr bool isAvailable() { return false; }
|
||||
#endif
|
||||
|
||||
auto getCallback() { return activeShaderCallback; }
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue