Skip to content

Commit

Permalink
softjit: Add config setting to enable/disable.
Browse files Browse the repository at this point in the history
Also use it for samplerjit.
  • Loading branch information
unknownbrackets committed Nov 23, 2021
1 parent 78a746d commit 6f2ddb7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
1 change: 1 addition & 0 deletions Core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,7 @@ static ConfigSetting graphicsSettings[] = {
ConfigSetting("VendorBugChecksEnabled", &g_Config.bVendorBugChecksEnabled, true, false, false),
ReportedConfigSetting("RenderingMode", &g_Config.iRenderingMode, 1, true, true),
ConfigSetting("SoftwareRenderer", &g_Config.bSoftwareRendering, false, true, true),
ConfigSetting("SoftwareRendererJit", &g_Config.bSoftwareRenderingJit, true, true, true),
ReportedConfigSetting("HardwareTransform", &g_Config.bHardwareTransform, true, true, true),
ReportedConfigSetting("SoftwareSkinning", &g_Config.bSoftwareSkinning, true, true, true),
ReportedConfigSetting("TextureFiltering", &g_Config.iTexFiltering, 1, true, true),
Expand Down
1 change: 1 addition & 0 deletions Core/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ struct Config {
std::string sMicDevice;

bool bSoftwareRendering;
bool bSoftwareRenderingJit;
bool bHardwareTransform; // only used in the GLES backend
bool bSoftwareSkinning; // may speed up some games
bool bVendorBugChecksEnabled;
Expand Down
14 changes: 8 additions & 6 deletions GPU/Software/DrawPixel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include <mutex>
#include "Common/Data/Convert/ColorConv.h"
#include "Core/Config.h"
#include "GPU/GPUState.h"
#include "GPU/Software/DrawPixel.h"
#include "GPU/Software/FuncId.h"
Expand Down Expand Up @@ -562,13 +563,14 @@ SingleFunc PixelJitCache::GetSingle(const PixelFuncID &id) {
}

#if PPSSPP_ARCH(AMD64) && !PPSSPP_PLATFORM(UWP)
addresses_[id] = GetCodePointer();
SingleFunc func = CompileSingle(id);
cache_[id] = func;
return func;
#else
return nullptr;
if (g_Config.bSoftwareRenderingJit) {
addresses_[id] = GetCodePointer();
SingleFunc func = CompileSingle(id);
cache_[id] = func;
return func;
}
#endif
return nullptr;
}

void PixelRegCache::Reset() {
Expand Down
14 changes: 8 additions & 6 deletions GPU/Software/Sampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <unordered_map>
#include <mutex>
#include "Common/Data/Convert/ColorConv.h"
#include "Core/Config.h"
#include "Core/Reporting.h"
#include "GPU/Common/TextureDecoder.h"
#include "GPU/GPUState.h"
Expand Down Expand Up @@ -216,13 +217,14 @@ NearestFunc SamplerJitCache::GetNearest(const SamplerID &id) {
}

#if PPSSPP_ARCH(AMD64) && !PPSSPP_PLATFORM(UWP)
addresses_[id] = GetCodePointer();
NearestFunc func = Compile(id);
cache_[id] = func;
return func;
#else
return nullptr;
if (g_Config.bSoftwareRenderingJit) {
addresses_[id] = GetCodePointer();
NearestFunc func = Compile(id);
cache_[id] = func;
return func;
}
#endif
return nullptr;
}

LinearFunc SamplerJitCache::GetLinear(const SamplerID &id) {
Expand Down

0 comments on commit 6f2ddb7

Please sign in to comment.