mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-26 23:10:38 +00:00
vertexjit: Simplify CPU core check.
This also avoids allocating the memory we won't use if it's off.
This commit is contained in:
parent
f199a0fee3
commit
9c21184352
@ -36,7 +36,9 @@ enum {
|
||||
};
|
||||
|
||||
DrawEngineCommon::DrawEngineCommon() : decoderMap_(16) {
|
||||
decJitCache_ = new VertexDecoderJitCache();
|
||||
if (g_Config.bVertexDecoderJit && g_Config.iCpuCore == (int)CPUCore::JIT) {
|
||||
decJitCache_ = new VertexDecoderJitCache();
|
||||
}
|
||||
transformed = (TransformedVertex *)AllocateMemoryPages(TRANSFORMED_VERTEX_BUFFER_SIZE, MEM_PROT_READ | MEM_PROT_WRITE);
|
||||
transformedExpanded = (TransformedVertex *)AllocateMemoryPages(3 * TRANSFORMED_VERTEX_BUFFER_SIZE, MEM_PROT_READ | MEM_PROT_WRITE);
|
||||
}
|
||||
@ -169,7 +171,8 @@ static Vec3f ScreenToDrawing(const Vec3f& coords) {
|
||||
}
|
||||
|
||||
void DrawEngineCommon::NotifyConfigChanged() {
|
||||
decJitCache_->Clear();
|
||||
if (decJitCache_)
|
||||
decJitCache_->Clear();
|
||||
lastVType_ = -1;
|
||||
dec_ = nullptr;
|
||||
decoderMap_.Iterate([&](const uint32_t vtype, VertexDecoder *decoder) {
|
||||
|
@ -117,7 +117,9 @@ public:
|
||||
}
|
||||
|
||||
bool IsCodePtrVertexDecoder(const u8 *ptr) const {
|
||||
return decJitCache_->IsInSpace(ptr);
|
||||
if (decJitCache_)
|
||||
return decJitCache_->IsInSpace(ptr);
|
||||
return false;
|
||||
}
|
||||
int GetNumDrawCalls() const {
|
||||
return numDrawCalls;
|
||||
|
@ -1274,7 +1274,7 @@ void VertexDecoder::SetVertexType(u32 fmt, const VertexDecoderOptions &options,
|
||||
|
||||
// Attempt to JIT as well. But only do that if the main CPU JIT is enabled, in order to aid
|
||||
// debugging attempts - if the main JIT doesn't work, this one won't do any better, probably.
|
||||
if (jitCache && g_Config.bVertexDecoderJit && g_Config.iCpuCore == (int)CPUCore::JIT) {
|
||||
if (jitCache) {
|
||||
jitted_ = jitCache->Compile(*this, &jittedSize_);
|
||||
if (!jitted_) {
|
||||
WARN_LOG(G3D, "Vertex decoder JIT failed! fmt = %08x (%s)", fmt_, GetString(SHADER_STRING_SHORT_DESC).c_str());
|
||||
|
@ -38,9 +38,6 @@ public:
|
||||
dst_ = new u8[BUFFER_SIZE];
|
||||
cache_ = new VertexDecoderJitCache();
|
||||
|
||||
g_Config.bVertexDecoderJit = true;
|
||||
// Required for jit to be enabled.
|
||||
g_Config.iCpuCore = (int)CPUCore::JIT;
|
||||
gstate_c.uv.uScale = 1.0f;
|
||||
gstate_c.uv.vScale = 1.0f;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user