mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Reformat all the things. Have fun with merge conflicts.
This commit is contained in:
@ -8,79 +8,61 @@
|
||||
#include <memory>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/NonCopyable.h"
|
||||
#include "Common/GL/GLUtil.h"
|
||||
#include "Common/NonCopyable.h"
|
||||
#include "VideoBackends/OGL/Render.h"
|
||||
|
||||
namespace OGL
|
||||
{
|
||||
|
||||
class SamplerCache : NonCopyable
|
||||
{
|
||||
public:
|
||||
SamplerCache();
|
||||
~SamplerCache();
|
||||
SamplerCache();
|
||||
~SamplerCache();
|
||||
|
||||
void SetSamplerState(int stage, const TexMode0& tm0, const TexMode1& tm1, bool custom_tex);
|
||||
void Clear();
|
||||
void BindNearestSampler(int stage);
|
||||
void BindLinearSampler(int stage);
|
||||
void SetSamplerState(int stage, const TexMode0& tm0, const TexMode1& tm1, bool custom_tex);
|
||||
void Clear();
|
||||
void BindNearestSampler(int stage);
|
||||
void BindLinearSampler(int stage);
|
||||
|
||||
private:
|
||||
struct Params
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
TexMode0 tm0;
|
||||
TexMode1 tm1;
|
||||
};
|
||||
struct Params
|
||||
{
|
||||
union {
|
||||
struct
|
||||
{
|
||||
TexMode0 tm0;
|
||||
TexMode1 tm1;
|
||||
};
|
||||
|
||||
u64 hex;
|
||||
};
|
||||
u64 hex;
|
||||
};
|
||||
|
||||
Params()
|
||||
: hex()
|
||||
{}
|
||||
Params() : hex() {}
|
||||
Params(const TexMode0& _tm0, const TexMode1& _tm1) : tm0(_tm0), tm1(_tm1)
|
||||
{
|
||||
static_assert(sizeof(Params) == 8, "Assuming I can treat this as a 64bit int.");
|
||||
}
|
||||
|
||||
Params(const TexMode0& _tm0, const TexMode1& _tm1)
|
||||
: tm0(_tm0)
|
||||
, tm1(_tm1)
|
||||
{
|
||||
static_assert(sizeof(Params) == 8, "Assuming I can treat this as a 64bit int.");
|
||||
}
|
||||
bool operator<(const Params& other) const { return hex < other.hex; }
|
||||
bool operator!=(const Params& other) const { return hex != other.hex; }
|
||||
};
|
||||
|
||||
bool operator<(const Params& other) const
|
||||
{
|
||||
return hex < other.hex;
|
||||
}
|
||||
struct Value
|
||||
{
|
||||
Value() : sampler_id() {}
|
||||
GLuint sampler_id;
|
||||
};
|
||||
|
||||
bool operator!=(const Params& other) const
|
||||
{
|
||||
return hex != other.hex;
|
||||
}
|
||||
};
|
||||
void SetParameters(GLuint sampler_id, const Params& params);
|
||||
Value& GetEntry(const Params& params);
|
||||
|
||||
struct Value
|
||||
{
|
||||
Value()
|
||||
: sampler_id()
|
||||
{}
|
||||
std::map<Params, Value> m_cache;
|
||||
std::pair<Params, Value> m_active_samplers[8];
|
||||
|
||||
GLuint sampler_id;
|
||||
};
|
||||
|
||||
void SetParameters(GLuint sampler_id, const Params& params);
|
||||
Value& GetEntry(const Params& params);
|
||||
|
||||
std::map<Params, Value> m_cache;
|
||||
std::pair<Params, Value> m_active_samplers[8];
|
||||
|
||||
int m_last_max_anisotropy;
|
||||
u32 m_sampler_id[2];
|
||||
int m_last_max_anisotropy;
|
||||
u32 m_sampler_id[2];
|
||||
};
|
||||
|
||||
extern std::unique_ptr<SamplerCache> g_sampler_cache;
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user