From 9bd4201c83feccffdda9dbf12117f72efc085553 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 9 Aug 2022 10:47:54 +0200 Subject: [PATCH] Cleanup --- GPU/Common/DepalettizeCommon.h | 11 ++++++++++- GPU/Common/DepalettizeShaderCommon.cpp | 9 --------- GPU/Common/DepalettizeShaderCommon.h | 9 --------- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/GPU/Common/DepalettizeCommon.h b/GPU/Common/DepalettizeCommon.h index 79c53de85c..af90da8015 100644 --- a/GPU/Common/DepalettizeCommon.h +++ b/GPU/Common/DepalettizeCommon.h @@ -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; diff --git a/GPU/Common/DepalettizeShaderCommon.cpp b/GPU/Common/DepalettizeShaderCommon.cpp index 66cd807a4b..064e3fce1c 100644 --- a/GPU/Common/DepalettizeShaderCommon.cpp +++ b/GPU/Common/DepalettizeShaderCommon.cpp @@ -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 diff --git a/GPU/Common/DepalettizeShaderCommon.h b/GPU/Common/DepalettizeShaderCommon.h index 75a46c67ad..8058e40bf7 100644 --- a/GPU/Common/DepalettizeShaderCommon.h +++ b/GPU/Common/DepalettizeShaderCommon.h @@ -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; -};