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:
parent
77c98441f4
commit
87fb9eef37
8 changed files with 57 additions and 47 deletions
|
@ -18,6 +18,7 @@
|
|||
#include "Common/Data/Random/Rng.h"
|
||||
#include "Common/StringUtils.h"
|
||||
#include "Core/Config.h"
|
||||
#include "GPU/Software/BinManager.h"
|
||||
#include "GPU/Software/DrawPixel.h"
|
||||
#include "GPU/Software/Sampler.h"
|
||||
#include "GPU/Software/SoftGpu.h"
|
||||
|
@ -25,21 +26,22 @@
|
|||
static bool TestSamplerJit() {
|
||||
using namespace Sampler;
|
||||
SamplerJitCache *cache = new SamplerJitCache();
|
||||
BinManager binner;
|
||||
|
||||
auto GetLinear = [&](SamplerID &id) {
|
||||
id.linear = true;
|
||||
id.fetch = false;
|
||||
return cache->GetLinear(id, [] {});
|
||||
return cache->GetLinear(id, &binner);
|
||||
};
|
||||
auto GetNearest = [&](SamplerID &id) {
|
||||
id.linear = false;
|
||||
id.fetch = false;
|
||||
return cache->GetNearest(id, [] {});
|
||||
return cache->GetNearest(id, &binner);
|
||||
};
|
||||
auto GetFetch = [&](SamplerID &id) {
|
||||
id.linear = false;
|
||||
id.fetch = true;
|
||||
return cache->GetFetch(id, [] {});
|
||||
return cache->GetFetch(id, &binner);
|
||||
};
|
||||
|
||||
GMRng rng;
|
||||
|
@ -111,6 +113,7 @@ static bool TestSamplerJit() {
|
|||
static bool TestPixelJit() {
|
||||
using namespace Rasterizer;
|
||||
PixelJitCache *cache = new PixelJitCache();
|
||||
BinManager binner;
|
||||
|
||||
GMRng rng;
|
||||
int successes = 0;
|
||||
|
@ -134,7 +137,7 @@ static bool TestPixelJit() {
|
|||
continue;
|
||||
i++;
|
||||
|
||||
SingleFunc func = cache->GetSingle(id, [] {});
|
||||
SingleFunc func = cache->GetSingle(id, &binner);
|
||||
SingleFunc genericFunc = cache->GenericSingle(id);
|
||||
if (func != genericFunc) {
|
||||
successes++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue