summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader/shader_jit.cpp
blob: 69fb7f6be29bdb4d5cb1072ef758b3a791d041c5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright 2015 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

#include "video_core/pica.h"

#include "shader.h"
#include "shader_jit.h"

namespace Pica {

namespace Shader {

JitShader::JitShader() : jitted(nullptr) {
}

void JitShader::DoJit(JitCompiler& jit) {
    jitted = jit.Compile();
}

void JitShader::Run(UnitState& state) {
    if (jitted)
        jitted(&state);
}

JitCompiler::JitCompiler() {
    AllocCodeSpace(1024 * 1024 * 4);
}

void JitCompiler::Clear() {
    ClearCodeSpace();
}

} // namespace Shader

} // namespace Pica