build: Update to support multi-arch builds.

This commit is contained in:
Steveice10 2023-01-06 07:28:02 -08:00
parent 0e325255f3
commit a8848cce43
25 changed files with 114 additions and 66 deletions

View file

@ -4,6 +4,7 @@
#include <cmath>
#include <cstring>
#include "common/arch.h"
#include "common/bit_set.h"
#include "common/logging/log.h"
#include "common/microprofile.h"
@ -12,9 +13,9 @@
#include "video_core/regs_shader.h"
#include "video_core/shader/shader.h"
#include "video_core/shader/shader_interpreter.h"
#ifdef ARCHITECTURE_x86_64
#if CITRA_ARCH(x86_64)
#include "video_core/shader/shader_jit_x64.h"
#endif // ARCHITECTURE_x86_64
#endif // CITRA_ARCH(x86_64)
#include "video_core/video_core.h"
namespace Pica::Shader {
@ -134,13 +135,13 @@ void GSUnitState::ConfigOutput(const ShaderRegs& config) {
MICROPROFILE_DEFINE(GPU_Shader, "GPU", "Shader", MP_RGB(50, 50, 240));
#ifdef ARCHITECTURE_x86_64
#if CITRA_ARCH(x86_64)
static std::unique_ptr<JitX64Engine> jit_engine;
#endif // ARCHITECTURE_x86_64
#endif // CITRA_ARCH(x86_64)
static InterpreterEngine interpreter_engine;
ShaderEngine* GetEngine() {
#ifdef ARCHITECTURE_x86_64
#if CITRA_ARCH(x86_64)
// TODO(yuriks): Re-initialize on each change rather than being persistent
if (VideoCore::g_shader_jit_enabled) {
if (jit_engine == nullptr) {
@ -148,15 +149,15 @@ ShaderEngine* GetEngine() {
}
return jit_engine.get();
}
#endif // ARCHITECTURE_x86_64
#endif // CITRA_ARCH(x86_64)
return &interpreter_engine;
}
void Shutdown() {
#ifdef ARCHITECTURE_x86_64
#if CITRA_ARCH(x86_64)
jit_engine = nullptr;
#endif // ARCHITECTURE_x86_64
#endif // CITRA_ARCH(x86_64)
}
} // namespace Pica::Shader