softgpu: Remove std::function usage.

Wanted to avoid coupling these, but don't like the std::function
construct/destructs showing in profiles...
This commit is contained in:
Unknown W. Brackets committed 2022-12-06 19:15:57 -08:00
1 parent 77c98441f4
commit 87fb9eef37
8 files changed
+57 -47

No files matched your search

+16 -15
View File
@@ -25,6 +25,7 @@
#include "Core/Reporting.h"
#include "GPU/Common/TextureDecoder.h"
#include "GPU/GPUState.h"
#include "GPU/Software/BinManager.h"
#include "GPU/Software/Rasterizer.h"
#include "GPU/Software/RasterizerRegCache.h"
#include "GPU/Software/Sampler.h"
@@ -67,9 +68,9 @@ bool DescribeCodePtr(const u8 *ptr, std::string &name) {
return true;
}
NearestFunc GetNearestFunc(SamplerID id, std::function<void()> flushForCompile) {
NearestFunc GetNearestFunc(SamplerID id, BinManager *binner) {
id.linear = false;
NearestFunc jitted = jitCache->GetNearest(id, flushForCompile);
NearestFunc jitted = jitCache->GetNearest(id, binner);
if (jitted) {
return jitted;
}
@@ -77,9 +78,9 @@ NearestFunc GetNearestFunc(SamplerID id, std::function<void()> flushForCompile)
return &SampleNearest;
}
LinearFunc GetLinearFunc(SamplerID id, std::function<void()> flushForCompile) {
LinearFunc GetLinearFunc(SamplerID id, BinManager *binner) {
id.linear = true;
LinearFunc jitted = jitCache->GetLinear(id, flushForCompile);
LinearFunc jitted = jitCache->GetLinear(id, binner);
if (jitted) {
return jitted;
}
@@ -87,9 +88,9 @@ LinearFunc GetLinearFunc(SamplerID id, std::function<void()> flushForCompile) {
return &SampleLinear;
}
FetchFunc GetFetchFunc(SamplerID id, std::function<void()> flushForCompile) {
FetchFunc GetFetchFunc(SamplerID id, BinManager *binner) {
id.fetch = true;
FetchFunc jitted = jitCache->GetFetch(id, flushForCompile);
FetchFunc jitted = jitCache->GetFetch(id, binner);
if (jitted) {
return jitted;
}
@@ -153,7 +154,7 @@ void SamplerJitCache::Flush() {
compileQueue_.clear();
}
NearestFunc SamplerJitCache::GetByID(const SamplerID &id, std::function<void()> flushForCompile) {
NearestFunc SamplerJitCache::GetByID(const SamplerID &id, BinManager *binner) {
if (!g_Config.bSoftwareRenderingJit)
return nullptr;
@@ -164,14 +165,14 @@ NearestFunc SamplerJitCache::GetByID(const SamplerID &id, std::function<void()>
if (it != nullptr)
return it;
if (!flushForCompile) {
if (!binner) {
// Can't compile, let's try to do it later when there's an opportunity.
compileQueue_.insert(id);
return nullptr;
}
guard.unlock();
flushForCompile();
binner->Flush("compile");
guard.lock();
for (const auto &queued : compileQueue_) {
@@ -189,16 +190,16 @@ NearestFunc SamplerJitCache::GetByID(const SamplerID &id, std::function<void()>
return cache_.Get(key);
}
NearestFunc SamplerJitCache::GetNearest(const SamplerID &id, std::function<void()> flushForCompile) {
return (NearestFunc)GetByID(id, flushForCompile);
NearestFunc SamplerJitCache::GetNearest(const SamplerID &id, BinManager *binner) {
return (NearestFunc)GetByID(id, binner);
}
LinearFunc SamplerJitCache::GetLinear(const SamplerID &id, std::function<void()> flushForCompile) {
return (LinearFunc)GetByID(id, flushForCompile);
LinearFunc SamplerJitCache::GetLinear(const SamplerID &id, BinManager *binner) {
return (LinearFunc)GetByID(id, binner);
}
FetchFunc SamplerJitCache::GetFetch(const SamplerID &id, std::function<void()> flushForCompile) {
return (FetchFunc)GetByID(id, flushForCompile);
FetchFunc SamplerJitCache::GetFetch(const SamplerID &id, BinManager *binner) {
return (FetchFunc)GetByID(id, binner);
}
void SamplerJitCache::Compile(const SamplerID &id) {