mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-27 07:20:49 +00:00
Cleanup
This commit is contained in:
parent
46342ee92d
commit
9bd4201c83
@ -43,7 +43,7 @@ public:
|
||||
};
|
||||
|
||||
// Caches both shaders and palette textures.
|
||||
class DepalShaderCache : public DepalShaderCacheCommon {
|
||||
class DepalShaderCache {
|
||||
public:
|
||||
DepalShaderCache(Draw::DrawContext *draw);
|
||||
~DepalShaderCache();
|
||||
@ -66,6 +66,15 @@ public:
|
||||
static bool GenerateVertexShader(char *buffer, const ShaderLanguageDesc &lang);
|
||||
|
||||
private:
|
||||
static uint32_t GenerateShaderID(uint32_t clutMode, GEBufferFormat pixelFormat) {
|
||||
return (clutMode & 0xFFFFFF) | (pixelFormat << 24);
|
||||
}
|
||||
|
||||
static uint32_t GetClutID(GEPaletteFormat clutFormat, uint32_t clutHash) {
|
||||
// Simplistic.
|
||||
return clutHash ^ (uint32_t)clutFormat;
|
||||
}
|
||||
|
||||
Draw::DrawContext *draw_;
|
||||
Draw::ShaderModule *vertexShader_ = nullptr;
|
||||
Draw::SamplerState *nearestSampler_ = nullptr;
|
||||
|
@ -343,13 +343,4 @@ void GenerateDepalShader(char *buffer, GEBufferFormat pixelFormat, ShaderLanguag
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t DepalShaderCacheCommon::GenerateShaderID(uint32_t clutMode, GEBufferFormat pixelFormat) const {
|
||||
return (clutMode & 0xFFFFFF) | (pixelFormat << 24);
|
||||
}
|
||||
|
||||
uint32_t DepalShaderCacheCommon::GetClutID(GEPaletteFormat clutFormat, uint32_t clutHash) const {
|
||||
// Simplistic.
|
||||
return clutHash ^ (uint32_t)clutFormat;
|
||||
}
|
||||
|
||||
#undef WRITE
|
||||
|
@ -25,12 +25,3 @@
|
||||
static const int DEPAL_TEXTURE_OLD_AGE = 120;
|
||||
|
||||
void GenerateDepalShader(char *buffer, GEBufferFormat pixelFormat, ShaderLanguage language);
|
||||
|
||||
class DepalShaderCacheCommon {
|
||||
public:
|
||||
virtual ~DepalShaderCacheCommon() {}
|
||||
|
||||
protected:
|
||||
uint32_t GenerateShaderID(uint32_t clutMode, GEBufferFormat pixelFormat) const;
|
||||
uint32_t GetClutID(GEPaletteFormat clutFormat, uint32_t clutHash) const;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user