From 82a6c42e174fef9670581997efe26069031d5a25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 22 Aug 2022 12:20:21 +0200 Subject: [PATCH] DepalettizeCommon -> TextureShaderCommon. Simplifications. --- CMakeLists.txt | 4 +- GPU/Common/DepalettizeShaderCommon.cpp | 4 +- GPU/Common/DepalettizeShaderCommon.h | 2 +- GPU/Common/TextureCacheCommon.cpp | 4 +- GPU/Common/TextureCacheCommon.h | 6 +- ...tizeCommon.cpp => TextureShaderCommon.cpp} | 114 +++++++++--------- ...alettizeCommon.h => TextureShaderCommon.h} | 26 ++-- GPU/D3D11/GPU_D3D11.h | 2 +- GPU/D3D11/TextureCacheD3D11.cpp | 2 +- GPU/D3D11/TextureCacheD3D11.h | 2 +- GPU/Directx9/GPU_DX9.h | 2 +- GPU/Directx9/TextureCacheDX9.cpp | 2 +- GPU/Directx9/TextureCacheDX9.h | 2 +- GPU/GLES/GPU_GLES.h | 2 +- GPU/GLES/TextureCacheGLES.cpp | 2 +- GPU/GLES/TextureCacheGLES.h | 4 +- GPU/GPU.vcxproj | 4 +- GPU/GPU.vcxproj.filters | 4 +- GPU/Vulkan/GPU_Vulkan.h | 2 +- GPU/Vulkan/TextureCacheVulkan.cpp | 2 +- GPU/Vulkan/TextureCacheVulkan.h | 2 +- UWP/GPU_UWP/GPU_UWP.vcxproj | 6 +- UWP/GPU_UWP/GPU_UWP.vcxproj.filters | 6 +- android/jni/Android.mk | 2 +- libretro/Makefile.common | 2 +- unittest/TestShaderGenerators.cpp | 2 +- 26 files changed, 105 insertions(+), 107 deletions(-) rename GPU/Common/{DepalettizeCommon.cpp => TextureShaderCommon.cpp} (78%) rename GPU/Common/{DepalettizeCommon.h => TextureShaderCommon.h} (68%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c5dbcd989..09cae88753 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1536,8 +1536,8 @@ set(GPU_SOURCES ${GPU_NEON} GPU/Common/Draw2D.cpp GPU/Common/Draw2D.h - GPU/Common/DepalettizeCommon.cpp - GPU/Common/DepalettizeCommon.h + GPU/Common/TextureShaderCommon.cpp + GPU/Common/TextureShaderCommon.h GPU/Common/DepalettizeShaderCommon.cpp GPU/Common/DepalettizeShaderCommon.h GPU/Common/FragmentShaderGenerator.cpp diff --git a/GPU/Common/DepalettizeShaderCommon.cpp b/GPU/Common/DepalettizeShaderCommon.cpp index af2bf13437..2b9ddca413 100644 --- a/GPU/Common/DepalettizeShaderCommon.cpp +++ b/GPU/Common/DepalettizeShaderCommon.cpp @@ -34,7 +34,7 @@ static const InputDef vsInputs[2] = { { "vec2", "a_texcoord0", Draw::SEM_TEXCOORD0, }, }; -// TODO: Deduplicate with DepalettizeCommon.cpp +// TODO: Deduplicate with TextureShaderCommon.cpp static const SamplerDef samplers[2] = { { "tex" }, { "pal" }, @@ -309,7 +309,7 @@ void GenerateDepalFs(char *buffer, const DepalConfig &config, const ShaderLangua writer.EndFSMain("outColor", FSFLAG_NONE); } -void GenerateDepalVs(char *buffer, const ShaderLanguageDesc &lang) { +void GenerateVs(char *buffer, const ShaderLanguageDesc &lang) { ShaderWriter writer(buffer, lang, ShaderStage::Vertex, nullptr, 0); writer.BeginVSMain(vsInputs, Slice::empty(), varyings); writer.C(" v_texcoord = a_texcoord0;\n"); diff --git a/GPU/Common/DepalettizeShaderCommon.h b/GPU/Common/DepalettizeShaderCommon.h index 74bb38d196..91186f5d20 100644 --- a/GPU/Common/DepalettizeShaderCommon.h +++ b/GPU/Common/DepalettizeShaderCommon.h @@ -34,4 +34,4 @@ struct DepalConfig { }; void GenerateDepalFs(char *buffer, const DepalConfig &config, const ShaderLanguageDesc &lang); -void GenerateDepalVs(char *buffer, const ShaderLanguageDesc &lang); +void GenerateVs(char *buffer, const ShaderLanguageDesc &lang); diff --git a/GPU/Common/TextureCacheCommon.cpp b/GPU/Common/TextureCacheCommon.cpp index 9b092f0e7c..b237c3a97e 100644 --- a/GPU/Common/TextureCacheCommon.cpp +++ b/GPU/Common/TextureCacheCommon.cpp @@ -124,7 +124,7 @@ TextureCacheCommon::TextureCacheCommon(Draw::DrawContext *draw) replacer_.Init(); - depalShaderCache_ = new DepalShaderCache(draw); + depalShaderCache_ = new TextureShaderCache(draw); } TextureCacheCommon::~TextureCacheCommon() { @@ -1860,7 +1860,7 @@ bool CanDepalettize(GETextureFormat texFormat, GEBufferFormat bufferFormat) { } void TextureCacheCommon::ApplyTextureFramebuffer(VirtualFramebuffer *framebuffer, GETextureFormat texFormat, RasterChannel channel) { - DepalShader *depalShader = nullptr; + TextureShader *depalShader = nullptr; uint32_t clutMode = gstate.clutformat & 0xFFFFFF; bool depth = channel == RASTER_DEPTH; diff --git a/GPU/Common/TextureCacheCommon.h b/GPU/Common/TextureCacheCommon.h index 12f0d64213..8be81d3433 100644 --- a/GPU/Common/TextureCacheCommon.h +++ b/GPU/Common/TextureCacheCommon.h @@ -29,7 +29,7 @@ #include "GPU/Common/GPUDebugInterface.h" #include "GPU/Common/TextureDecoder.h" #include "GPU/Common/TextureScalerCommon.h" -#include "GPU/Common/DepalettizeCommon.h" +#include "GPU/Common/TextureShaderCommon.h" enum FramebufferNotification { NOTIFY_FB_CREATED, @@ -291,7 +291,7 @@ public: void InvalidateAll(GPUInvalidationType type); void ClearNextFrame(); - DepalShaderCache *GetDepalShaderCache() { return depalShaderCache_; } + TextureShaderCache *GetDepalShaderCache() { return depalShaderCache_; } virtual void ForgetLastTexture() = 0; virtual void InvalidateLastTexture() = 0; @@ -403,7 +403,7 @@ protected: TextureReplacer replacer_; TextureScalerCommon scaler_; FramebufferManagerCommon *framebufferManager_; - DepalShaderCache *depalShaderCache_; + TextureShaderCache *depalShaderCache_; ShaderManagerCommon *shaderManager_; bool clearCacheNextFrame_ = false; diff --git a/GPU/Common/DepalettizeCommon.cpp b/GPU/Common/TextureShaderCommon.cpp similarity index 78% rename from GPU/Common/DepalettizeCommon.cpp rename to GPU/Common/TextureShaderCommon.cpp index f23e2607ba..77072565ea 100644 --- a/GPU/Common/DepalettizeCommon.cpp +++ b/GPU/Common/TextureShaderCommon.cpp @@ -25,8 +25,8 @@ #include "Core/Reporting.h" #include "GPU/Common/DrawEngineCommon.h" #include "GPU/Common/TextureCacheCommon.h" +#include "GPU/Common/TextureShaderCommon.h" #include "GPU/Common/DepalettizeShaderCommon.h" -#include "GPU/Common/DepalettizeCommon.h" static const VaryingDef varyings[1] = { { "vec2", "v_texcoord", Draw::SEM_TEXCOORD0, 0, "highp" }, @@ -37,22 +37,23 @@ static const SamplerDef samplers[2] = { { "pal" }, }; -DepalShaderCache::DepalShaderCache(Draw::DrawContext *draw) : draw_(draw) { } +TextureShaderCache::TextureShaderCache(Draw::DrawContext *draw) : draw_(draw) { } -DepalShaderCache::~DepalShaderCache() { +TextureShaderCache::~TextureShaderCache() { DeviceLost(); } -void DepalShaderCache::DeviceRestore(Draw::DrawContext *draw) { +void TextureShaderCache::DeviceRestore(Draw::DrawContext *draw) { draw_ = draw; } -void DepalShaderCache::DeviceLost() { +void TextureShaderCache::DeviceLost() { Clear(); } -Draw::Texture *DepalShaderCache::GetClutTexture(GEPaletteFormat clutFormat, const u32 clutHash, u32 *rawClut) { - u32 clutId = GetClutID(clutFormat, clutHash); +Draw::Texture *TextureShaderCache::GetClutTexture(GEPaletteFormat clutFormat, const u32 clutHash, u32 *rawClut) { + // Simplistic, but works well enough. + u32 clutId = clutHash ^ (uint32_t)clutFormat; auto oldtex = texCache_.find(clutId); if (oldtex != texCache_.end()) { @@ -100,15 +101,14 @@ Draw::Texture *DepalShaderCache::GetClutTexture(GEPaletteFormat clutFormat, cons return tex->texture; } -void DepalShaderCache::Clear() { - for (auto shader = cache_.begin(); shader != cache_.end(); ++shader) { - shader->second->fragShader->Release(); +void TextureShaderCache::Clear() { + for (auto shader = depalCache_.begin(); shader != depalCache_.end(); ++shader) { if (shader->second->pipeline) { shader->second->pipeline->Release(); } delete shader->second; } - cache_.clear(); + depalCache_.clear(); for (auto tex = texCache_.begin(); tex != texCache_.end(); ++tex) { tex->second->texture->Release(); delete tex->second; @@ -124,7 +124,7 @@ void DepalShaderCache::Clear() { } } -void DepalShaderCache::Decimate() { +void TextureShaderCache::Decimate() { for (auto tex = texCache_.begin(); tex != texCache_.end(); ) { if (tex->second->lastFrame + DEPAL_TEXTURE_OLD_AGE < gpuStats.numFlips) { tex->second->texture->Release(); @@ -136,7 +136,7 @@ void DepalShaderCache::Decimate() { } } -Draw::SamplerState *DepalShaderCache::GetSampler() { +Draw::SamplerState *TextureShaderCache::GetSampler() { if (!nearestSampler_) { Draw::SamplerStateDesc desc{}; desc.wrapU = Draw::TextureAddressMode::CLAMP_TO_EDGE; @@ -147,39 +147,16 @@ Draw::SamplerState *DepalShaderCache::GetSampler() { return nearestSampler_; } -DepalShader *DepalShaderCache::GetDepalettizeShader(uint32_t clutMode, GETextureFormat textureFormat, GEBufferFormat bufferFormat) { +TextureShader *TextureShaderCache::CreateShader(const char *fs) { using namespace Draw; - - u32 id = GenerateShaderID(clutMode, textureFormat, bufferFormat); - - auto shader = cache_.find(id); - if (shader != cache_.end()) { - DepalShader *depal = shader->second; - return shader->second; - } - - char *buffer = new char[4096]; - if (!vertexShader_) { - GenerateDepalVs(buffer, draw_->GetShaderLanguageDesc()); + char *buffer = new char[4096]; + GenerateVs(buffer, draw_->GetShaderLanguageDesc()); vertexShader_ = draw_->CreateShaderModule(ShaderStage::Vertex, draw_->GetShaderLanguageDesc().shaderLanguage, (const uint8_t *)buffer, strlen(buffer), "depal_vs"); + delete[] buffer; } - // TODO: Parse these out of clutMode some nice way, to become a bit more stateless. - DepalConfig config; - config.clutFormat = gstate.getClutPaletteFormat(); - config.startPos = gstate.getClutIndexStartPos(); - config.shift = gstate.getClutIndexShift(); - config.mask = gstate.getClutIndexMask(); - config.bufferFormat = bufferFormat; - config.textureFormat = textureFormat; - - GenerateDepalFs(buffer, config, draw_->GetShaderLanguageDesc()); - - std::string src(buffer); - ShaderModule *fragShader = draw_->CreateShaderModule(ShaderStage::Fragment, draw_->GetShaderLanguageDesc().shaderLanguage, (const uint8_t *)buffer, strlen(buffer), "depal_fs"); - - DepalShader *depal = new DepalShader(); + ShaderModule *fragShader = draw_->CreateShaderModule(ShaderStage::Fragment, draw_->GetShaderLanguageDesc().shaderLanguage, (const uint8_t *)fs, strlen(fs), "depal_fs"); static const InputLayoutDesc desc = { { @@ -201,38 +178,67 @@ DepalShader *DepalShaderCache::GetDepalettizeShader(uint32_t clutMode, GETexture { vertexShader_, fragShader }, inputLayout, noDepthStencil, blendOff, rasterNoCull, nullptr, samplers }; - + Pipeline *pipeline = draw_->CreateGraphicsPipeline(depalPipelineDesc); inputLayout->Release(); blendOff->Release(); noDepthStencil->Release(); rasterNoCull->Release(); + fragShader->Release(); _assert_(pipeline); + TextureShader *depal = new TextureShader(); depal->pipeline = pipeline; - depal->fragShader = fragShader; - depal->code = buffer; - cache_[id] = depal; - - delete[] buffer; - return depal->pipeline ? depal : nullptr; + depal->code = fs; // to std::string + return depal; } -std::vector DepalShaderCache::DebugGetShaderIDs(DebugShaderType type) { +TextureShader *TextureShaderCache::GetDepalettizeShader(uint32_t clutMode, GETextureFormat textureFormat, GEBufferFormat bufferFormat) { + using namespace Draw; + + // Generate an ID for depal shaders. + u32 id = (clutMode & 0xFFFFFF) | (textureFormat << 24) | (bufferFormat << 28); + + auto shader = depalCache_.find(id); + if (shader != depalCache_.end()) { + TextureShader *depal = shader->second; + return shader->second; + } + + // TODO: Parse these out of clutMode some nice way, to become a bit more stateless. + DepalConfig config; + config.clutFormat = gstate.getClutPaletteFormat(); + config.startPos = gstate.getClutIndexStartPos(); + config.shift = gstate.getClutIndexShift(); + config.mask = gstate.getClutIndexMask(); + config.bufferFormat = bufferFormat; + config.textureFormat = textureFormat; + + char *buffer = new char[4096]; + GenerateDepalFs(buffer, config, draw_->GetShaderLanguageDesc()); + TextureShader *ts = CreateShader(buffer); + delete[] buffer; + + depalCache_[id] = ts; + + return ts->pipeline ? ts : nullptr; +} + +std::vector TextureShaderCache::DebugGetShaderIDs(DebugShaderType type) { std::vector ids; - for (auto &iter : cache_) { + for (auto &iter : depalCache_) { ids.push_back(StringFromFormat("%08x", iter.first)); } return ids; } -std::string DepalShaderCache::DebugGetShaderString(std::string idstr, DebugShaderType type, DebugShaderStringType stringType) { +std::string TextureShaderCache::DebugGetShaderString(std::string idstr, DebugShaderType type, DebugShaderStringType stringType) { uint32_t id; sscanf(idstr.c_str(), "%08x", &id); - auto iter = cache_.find(id); - if (iter == cache_.end()) + auto iter = depalCache_.find(id); + if (iter == depalCache_.end()) return ""; switch (stringType) { case SHADER_STRING_SHORT_DESC: @@ -245,7 +251,7 @@ std::string DepalShaderCache::DebugGetShaderString(std::string idstr, DebugShade } // TODO: Merge with DepalShaderCache? -void DepalShaderCache::ApplyShader(DepalShader *shader, float bufferW, float bufferH, int renderW, int renderH, const KnownVertexBounds &bounds, u32 uoff, u32 voff) { +void TextureShaderCache::ApplyShader(TextureShader *shader, float bufferW, float bufferH, int renderW, int renderH, const KnownVertexBounds &bounds, u32 uoff, u32 voff) { Draw2DVertex verts[4] = { {-1, -1, 0, 0 }, { 1, -1, 1, 0 }, diff --git a/GPU/Common/DepalettizeCommon.h b/GPU/Common/TextureShaderCommon.h similarity index 68% rename from GPU/Common/DepalettizeCommon.h rename to GPU/Common/TextureShaderCommon.h index 169e7e8b9d..628746b465 100644 --- a/GPU/Common/DepalettizeCommon.h +++ b/GPU/Common/TextureShaderCommon.h @@ -29,9 +29,8 @@ #include "GPU/Common/ShaderCommon.h" #include "GPU/Common/DepalettizeShaderCommon.h" -class DepalShader { +class TextureShader { public: - Draw::ShaderModule *fragShader; Draw::Pipeline *pipeline; std::string code; }; @@ -42,19 +41,19 @@ public: int lastFrame; }; +// For CLUT depal shaders, and other pre-bind texture shaders. // Caches both shaders and palette textures. -class DepalShaderCache { +class TextureShaderCache { public: - DepalShaderCache(Draw::DrawContext *draw); - ~DepalShaderCache(); + TextureShaderCache(Draw::DrawContext *draw); + ~TextureShaderCache(); - // This also uploads the palette and binds the correct texture. - DepalShader *GetDepalettizeShader(uint32_t clutMode, GETextureFormat texFormat, GEBufferFormat pixelFormat); + TextureShader *GetDepalettizeShader(uint32_t clutMode, GETextureFormat texFormat, GEBufferFormat pixelFormat); Draw::Texture *GetClutTexture(GEPaletteFormat clutFormat, const u32 clutHash, u32 *rawClut); Draw::SamplerState *GetSampler(); - void ApplyShader(DepalShader *shader, float bufferW, float bufferH, int renderW, int renderH, const KnownVertexBounds &bounds, u32 uoff, u32 voff); + void ApplyShader(TextureShader *shader, float bufferW, float bufferH, int renderW, int renderH, const KnownVertexBounds &bounds, u32 uoff, u32 voff); void Clear(); void Decimate(); @@ -65,19 +64,12 @@ public: void DeviceRestore(Draw::DrawContext *draw); private: - static uint32_t GenerateShaderID(uint32_t clutMode, GETextureFormat texFormat, GEBufferFormat pixelFormat) { - return (clutMode & 0xFFFFFF) | (pixelFormat << 24) | (texFormat << 28); - } - - static uint32_t GetClutID(GEPaletteFormat clutFormat, uint32_t clutHash) { - // Simplistic. - return clutHash ^ (uint32_t)clutFormat; - } + TextureShader *CreateShader(const char *fs); Draw::DrawContext *draw_; Draw::ShaderModule *vertexShader_ = nullptr; Draw::SamplerState *nearestSampler_ = nullptr; - std::map cache_; + std::map depalCache_; std::map texCache_; }; diff --git a/GPU/D3D11/GPU_D3D11.h b/GPU/D3D11/GPU_D3D11.h index 94a0aef915..33790c7f99 100644 --- a/GPU/D3D11/GPU_D3D11.h +++ b/GPU/D3D11/GPU_D3D11.h @@ -23,7 +23,7 @@ #include "GPU/GPUCommon.h" #include "GPU/D3D11/DrawEngineD3D11.h" -#include "GPU/Common/DepalettizeCommon.h" +#include "GPU/Common/TextureShaderCommon.h" #include "GPU/Common/VertexDecoderCommon.h" class FramebufferManagerD3D11; diff --git a/GPU/D3D11/TextureCacheD3D11.cpp b/GPU/D3D11/TextureCacheD3D11.cpp index 2fea477610..fabb7cca4a 100644 --- a/GPU/D3D11/TextureCacheD3D11.cpp +++ b/GPU/D3D11/TextureCacheD3D11.cpp @@ -31,7 +31,7 @@ #include "GPU/D3D11/TextureCacheD3D11.h" #include "GPU/D3D11/FramebufferManagerD3D11.h" #include "GPU/D3D11/ShaderManagerD3D11.h" -#include "GPU/Common/DepalettizeCommon.h" +#include "GPU/Common/TextureShaderCommon.h" #include "GPU/D3D11/D3D11Util.h" #include "GPU/Common/FramebufferManagerCommon.h" #include "GPU/Common/TextureDecoder.h" diff --git a/GPU/D3D11/TextureCacheD3D11.h b/GPU/D3D11/TextureCacheD3D11.h index 433f6e824e..b641c72866 100644 --- a/GPU/D3D11/TextureCacheD3D11.h +++ b/GPU/D3D11/TextureCacheD3D11.h @@ -28,7 +28,7 @@ struct VirtualFramebuffer; class FramebufferManagerD3D11; -class DepalShaderCache; +class TextureShaderCache; class ShaderManagerD3D11; class SamplerCacheD3D11 { diff --git a/GPU/Directx9/GPU_DX9.h b/GPU/Directx9/GPU_DX9.h index 349d2bd0a8..35ac9817e1 100644 --- a/GPU/Directx9/GPU_DX9.h +++ b/GPU/Directx9/GPU_DX9.h @@ -23,7 +23,7 @@ #include "GPU/GPUCommon.h" #include "GPU/Directx9/FramebufferManagerDX9.h" #include "GPU/Directx9/DrawEngineDX9.h" -#include "GPU/Common/DepalettizeCommon.h" +#include "GPU/Common/TextureShaderCommon.h" #include "GPU/Common/VertexDecoderCommon.h" class ShaderManagerDX9; diff --git a/GPU/Directx9/TextureCacheDX9.cpp b/GPU/Directx9/TextureCacheDX9.cpp index ea6b47e2e9..905f445c1c 100644 --- a/GPU/Directx9/TextureCacheDX9.cpp +++ b/GPU/Directx9/TextureCacheDX9.cpp @@ -28,7 +28,7 @@ #include "GPU/Directx9/FramebufferManagerDX9.h" #include "GPU/Directx9/ShaderManagerDX9.h" #include "Common/GPU/D3D9/D3D9StateCache.h" -#include "GPU/Common/DepalettizeCommon.h" +#include "GPU/Common/TextureShaderCommon.h" #include "GPU/Common/FramebufferManagerCommon.h" #include "GPU/Common/TextureDecoder.h" #include "Core/Config.h" diff --git a/GPU/Directx9/TextureCacheDX9.h b/GPU/Directx9/TextureCacheDX9.h index 47005cbd5c..40351be611 100644 --- a/GPU/Directx9/TextureCacheDX9.h +++ b/GPU/Directx9/TextureCacheDX9.h @@ -24,7 +24,7 @@ #include "GPU/Common/TextureCacheCommon.h" struct VirtualFramebuffer; -class DepalShaderCache; +class TextureShaderCache; class FramebufferManagerDX9; class ShaderManagerDX9; diff --git a/GPU/GLES/GPU_GLES.h b/GPU/GLES/GPU_GLES.h index a6e521763a..f308d15445 100644 --- a/GPU/GLES/GPU_GLES.h +++ b/GPU/GLES/GPU_GLES.h @@ -23,7 +23,7 @@ #include "Common/File/Path.h" #include "GPU/GPUCommon.h" -#include "GPU/Common/DepalettizeCommon.h" +#include "GPU/Common/TextureShaderCommon.h" #include "GPU/GLES/FramebufferManagerGLES.h" #include "GPU/GLES/DrawEngineGLES.h" #include "GPU/GLES/FragmentTestCacheGLES.h" diff --git a/GPU/GLES/TextureCacheGLES.cpp b/GPU/GLES/TextureCacheGLES.cpp index fb3c1a01b3..ddaad253bc 100644 --- a/GPU/GLES/TextureCacheGLES.cpp +++ b/GPU/GLES/TextureCacheGLES.cpp @@ -36,7 +36,7 @@ #include "GPU/GLES/TextureCacheGLES.h" #include "GPU/GLES/FramebufferManagerGLES.h" #include "GPU/Common/FragmentShaderGenerator.h" -#include "GPU/Common/DepalettizeCommon.h" +#include "GPU/Common/TextureShaderCommon.h" #include "GPU/GLES/ShaderManagerGLES.h" #include "GPU/GLES/DrawEngineGLES.h" #include "GPU/Common/TextureDecoder.h" diff --git a/GPU/GLES/TextureCacheGLES.h b/GPU/GLES/TextureCacheGLES.h index ac5313c3cb..b23af129f5 100644 --- a/GPU/GLES/TextureCacheGLES.h +++ b/GPU/GLES/TextureCacheGLES.h @@ -27,7 +27,7 @@ struct VirtualFramebuffer; class FramebufferManagerGLES; -class DepalShaderCache; +class TextureShaderCache; class ShaderManagerGLES; class DrawEngineGLES; class GLRTexture; @@ -41,7 +41,7 @@ public: void StartFrame() override; void SetFramebufferManager(FramebufferManagerGLES *fbManager); - void SetDepalShaderCache(DepalShaderCache *dpCache) { + void SetDepalShaderCache(TextureShaderCache *dpCache) { depalShaderCache_ = dpCache; } void SetDrawEngine(DrawEngineGLES *td) { diff --git a/GPU/GPU.vcxproj b/GPU/GPU.vcxproj index 86d21d3690..1f37652321 100644 --- a/GPU/GPU.vcxproj +++ b/GPU/GPU.vcxproj @@ -338,7 +338,7 @@ - + @@ -452,7 +452,7 @@ - + diff --git a/GPU/GPU.vcxproj.filters b/GPU/GPU.vcxproj.filters index cb2832c032..d581cb4bad 100644 --- a/GPU/GPU.vcxproj.filters +++ b/GPU/GPU.vcxproj.filters @@ -255,7 +255,7 @@ Common - + Common @@ -503,7 +503,7 @@ Common - + Common diff --git a/GPU/Vulkan/GPU_Vulkan.h b/GPU/Vulkan/GPU_Vulkan.h index 87e54dbf19..18da82e6b0 100644 --- a/GPU/Vulkan/GPU_Vulkan.h +++ b/GPU/Vulkan/GPU_Vulkan.h @@ -25,7 +25,7 @@ #include "GPU/GPUCommon.h" #include "GPU/Vulkan/DrawEngineVulkan.h" #include "GPU/Vulkan/PipelineManagerVulkan.h" -#include "GPU/Common/DepalettizeCommon.h" +#include "GPU/Common/TextureShaderCommon.h" class FramebufferManagerVulkan; class ShaderManagerVulkan; diff --git a/GPU/Vulkan/TextureCacheVulkan.cpp b/GPU/Vulkan/TextureCacheVulkan.cpp index 603b064f8b..132c0e081a 100644 --- a/GPU/Vulkan/TextureCacheVulkan.cpp +++ b/GPU/Vulkan/TextureCacheVulkan.cpp @@ -41,7 +41,7 @@ #include "GPU/ge_constants.h" #include "GPU/GPUState.h" -#include "GPU/Common/DepalettizeCommon.h" +#include "GPU/Common/TextureShaderCommon.h" #include "GPU/Common/PostShader.h" #include "GPU/Common/TextureCacheCommon.h" #include "GPU/Common/TextureDecoder.h" diff --git a/GPU/Vulkan/TextureCacheVulkan.h b/GPU/Vulkan/TextureCacheVulkan.h index c3fc55945e..c56652d2c9 100644 --- a/GPU/Vulkan/TextureCacheVulkan.h +++ b/GPU/Vulkan/TextureCacheVulkan.h @@ -22,7 +22,7 @@ #include "GPU/GPUState.h" #include "Common/GPU/Vulkan/VulkanContext.h" #include "GPU/Common/TextureCacheCommon.h" -#include "GPU/Common/DepalettizeCommon.h" +#include "GPU/Common/TextureShaderCommon.h" #include "GPU/Vulkan/VulkanUtil.h" struct VirtualFramebuffer; diff --git a/UWP/GPU_UWP/GPU_UWP.vcxproj b/UWP/GPU_UWP/GPU_UWP.vcxproj index 9a24b23185..277526509c 100644 --- a/UWP/GPU_UWP/GPU_UWP.vcxproj +++ b/UWP/GPU_UWP/GPU_UWP.vcxproj @@ -379,7 +379,7 @@ - + @@ -439,7 +439,7 @@ - + @@ -527,4 +527,4 @@ - \ No newline at end of file + diff --git a/UWP/GPU_UWP/GPU_UWP.vcxproj.filters b/UWP/GPU_UWP/GPU_UWP.vcxproj.filters index affb707ff7..2a797c0d2e 100644 --- a/UWP/GPU_UWP/GPU_UWP.vcxproj.filters +++ b/UWP/GPU_UWP/GPU_UWP.vcxproj.filters @@ -57,7 +57,7 @@ - + @@ -117,6 +117,6 @@ - + - \ No newline at end of file + diff --git a/android/jni/Android.mk b/android/jni/Android.mk index 71fcf8de3a..7f3afa7849 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -319,7 +319,7 @@ EXEC_AND_LIB_FILES := \ $(SRC)/GPU/GeConstants.cpp \ $(SRC)/GPU/GeDisasm.cpp \ $(SRC)/GPU/Common/Draw2D.cpp \ - $(SRC)/GPU/Common/DepalettizeCommon.cpp \ + $(SRC)/GPU/Common/TextureShaderCommon.cpp \ $(SRC)/GPU/Common/DepalettizeShaderCommon.cpp \ $(SRC)/GPU/Common/FragmentShaderGenerator.cpp \ $(SRC)/GPU/Common/FramebufferManagerCommon.cpp \ diff --git a/libretro/Makefile.common b/libretro/Makefile.common index 183afdf060..6e5a9726cb 100644 --- a/libretro/Makefile.common +++ b/libretro/Makefile.common @@ -327,7 +327,7 @@ SOURCES_CXX += \ $(GPUCOMMONDIR)/ShaderCommon.cpp \ $(GPUCOMMONDIR)/ShaderUniforms.cpp \ $(GPUCOMMONDIR)/GPUDebugInterface.cpp \ - $(GPUCOMMONDIR)/DepalettizeCommon.cpp \ + $(GPUCOMMONDIR)/TextureShaderCommon.cpp \ $(GPUCOMMONDIR)/DepalettizeShaderCommon.cpp \ $(GPUCOMMONDIR)/TransformCommon.cpp \ $(GPUCOMMONDIR)/IndexGenerator.cpp \ diff --git a/unittest/TestShaderGenerators.cpp b/unittest/TestShaderGenerators.cpp index a96df6657c..2463fde971 100644 --- a/unittest/TestShaderGenerators.cpp +++ b/unittest/TestShaderGenerators.cpp @@ -321,7 +321,7 @@ bool TestDepalShaders() { printf("===\n%s\n===\n", buffer); } - GenerateDepalVs(buffer, desc); + GenerateVs(buffer, desc); if (!TestCompileShader(buffer, languages[k], ShaderStage::Vertex, &errorMessage)) { printf("Error compiling depal shader:\n\n%s\n\n%s\n", LineNumberString(buffer).c_str(), errorMessage.c_str()); failed = true;