From d9acd27126b2f9f7684fdfebbc50d953d1002a77 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Sat, 21 Jan 2017 22:16:30 +0100 Subject: [PATCH 1/2] Rename GLES files to match the convention the other backends use. --- CMakeLists.txt | 38 +++--- Core/Reporting.cpp | 2 +- GPU/Common/TextureScalerCommon.cpp | 24 ++-- GPU/Common/TextureScalerCommon.h | 6 +- GPU/Directx9/GPU_DX9.cpp | 16 +-- GPU/Directx9/TextureScalerDX9.h | 2 +- ...zeShader.cpp => DepalettizeShaderGLES.cpp} | 20 +-- ...ettizeShader.h => DepalettizeShaderGLES.h} | 6 +- GPU/GLES/DrawEngineGLES.cpp | 8 +- GPU/GLES/DrawEngineGLES.h | 26 ++-- ...or.cpp => FragmentShaderGeneratorGLES.cpp} | 6 +- ...erator.h => FragmentShaderGeneratorGLES.h} | 0 ...estCache.cpp => FragmentTestCacheGLES.cpp} | 16 +-- ...entTestCache.h => FragmentTestCacheGLES.h} | 12 +- ...ebuffer.cpp => FramebufferManagerGLES.cpp} | 96 +++++++-------- ...Framebuffer.h => FramebufferManagerGLES.h} | 18 +-- GPU/GLES/GPU_GLES.cpp | 14 +-- GPU/GLES/GPU_GLES.h | 20 +-- ...haderManager.cpp => ShaderManagerGLES.cpp} | 32 ++--- .../{ShaderManager.h => ShaderManagerGLES.h} | 10 +- ...{StateMapping.cpp => StateMappingGLES.cpp} | 10 +- .../{StateMapping.h => StateMappingGLES.h} | 0 ...tencilBuffer.cpp => StencilBufferGLES.cpp} | 8 +- ...{TextureCache.cpp => TextureCacheGLES.cpp} | 70 +++++------ .../{TextureCache.h => TextureCacheGLES.h} | 28 ++--- ...extureScaler.cpp => TextureScalerGLES.cpp} | 8 +- .../{TextureScaler.h => TextureScalerGLES.h} | 2 +- ...ator.cpp => VertexShaderGeneratorGLES.cpp} | 4 +- ...enerator.h => VertexShaderGeneratorGLES.h} | 0 GPU/GPU.vcxproj | 40 +++--- GPU/GPU.vcxproj.filters | 116 +++++++++--------- GPU/GPUState.cpp | 2 +- GPU/Null/NullGpu.h | 2 +- GPU/Software/SoftGpu.h | 2 +- GPU/Vulkan/TextureScalerVulkan.h | 2 +- UI/DisplayLayoutScreen.cpp | 2 +- UI/EmuScreen.cpp | 2 +- UI/GameSettingsScreen.cpp | 2 +- Windows/MainWindowMenu.cpp | 22 ++-- android/jni/Android.mk | 20 +-- 40 files changed, 357 insertions(+), 357 deletions(-) rename GPU/GLES/{DepalettizeShader.cpp => DepalettizeShaderGLES.cpp} (92%) rename GPU/GLES/{DepalettizeShader.h => DepalettizeShaderGLES.h} (95%) rename GPU/GLES/{FragmentShaderGenerator.cpp => FragmentShaderGeneratorGLES.cpp} (99%) rename GPU/GLES/{FragmentShaderGenerator.h => FragmentShaderGeneratorGLES.h} (100%) rename GPU/GLES/{FragmentTestCache.cpp => FragmentTestCacheGLES.cpp} (90%) rename GPU/GLES/{FragmentTestCache.h => FragmentTestCacheGLES.h} (90%) rename GPU/GLES/{Framebuffer.cpp => FramebufferManagerGLES.cpp} (94%) rename GPU/GLES/{Framebuffer.h => FramebufferManagerGLES.h} (94%) rename GPU/GLES/{ShaderManager.cpp => ShaderManagerGLES.cpp} (97%) rename GPU/GLES/{ShaderManager.h => ShaderManagerGLES.h} (97%) rename GPU/GLES/{StateMapping.cpp => StateMappingGLES.cpp} (98%) rename GPU/GLES/{StateMapping.h => StateMappingGLES.h} (100%) rename GPU/GLES/{StencilBuffer.cpp => StencilBufferGLES.cpp} (97%) rename GPU/GLES/{TextureCache.cpp => TextureCacheGLES.cpp} (95%) rename GPU/GLES/{TextureCache.h => TextureCacheGLES.h} (87%) rename GPU/GLES/{TextureScaler.cpp => TextureScalerGLES.cpp} (89%) rename GPU/GLES/{TextureScaler.h => TextureScalerGLES.h} (94%) rename GPU/GLES/{VertexShaderGenerator.cpp => VertexShaderGeneratorGLES.cpp} (99%) rename GPU/GLES/{VertexShaderGenerator.h => VertexShaderGeneratorGLES.h} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 54baf1a26dd9..99e541edce8d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1058,33 +1058,33 @@ if(ARMV7) endif() set(GPU_GLES - GPU/GLES/DepalettizeShader.cpp - GPU/GLES/DepalettizeShader.h + GPU/GLES/DepalettizeShaderGLES.cpp + GPU/GLES/DepalettizeShaderGLES.h GPU/GLES/FBO.cpp GPU/GLES/FBO.h GPU/GLES/GPU_GLES.cpp GPU/GLES/GPU_GLES.h GPU/GLES/GLStateCache.cpp GPU/GLES/GLStateCache.h - GPU/GLES/FragmentShaderGenerator.cpp - GPU/GLES/FragmentShaderGenerator.h - GPU/GLES/FragmentTestCache.cpp - GPU/GLES/FragmentTestCache.h - GPU/GLES/Framebuffer.cpp - GPU/GLES/Framebuffer.h - GPU/GLES/ShaderManager.cpp - GPU/GLES/ShaderManager.h - GPU/GLES/StateMapping.cpp - GPU/GLES/StateMapping.h - GPU/GLES/StencilBuffer.cpp - GPU/GLES/TextureCache.cpp - GPU/GLES/TextureCache.h - GPU/GLES/TextureScaler.cpp - GPU/GLES/TextureScaler.h + GPU/GLES/FragmentShaderGeneratorGLES.cpp + GPU/GLES/FragmentShaderGeneratorGLES.h + GPU/GLES/FragmentTestCacheGLES.cpp + GPU/GLES/FragmentTestCacheGLES.h + GPU/GLES/FramebufferGLES.cpp + GPU/GLES/FramebufferGLES.h + GPU/GLES/ShaderManagerGLES.cpp + GPU/GLES/ShaderManagerGLES.h + GPU/GLES/StateMappingGLES.cpp + GPU/GLES/StateMappingGLES.h + GPU/GLES/StencilBufferGLES.cpp + GPU/GLES/TextureCacheGLES.cpp + GPU/GLES/TextureCacheGLES.h + GPU/GLES/TextureScalerGLES.cpp + GPU/GLES/TextureScalerGLES.h GPU/GLES/DrawEngineGLES.cpp GPU/GLES/DrawEngineGLES.h - GPU/GLES/VertexShaderGenerator.cpp - GPU/GLES/VertexShaderGenerator.h + GPU/GLES/VertexShaderGeneratorGLES.cpp + GPU/GLES/VertexShaderGeneratorGLES.h ) set(GPU_VULKAN diff --git a/Core/Reporting.cpp b/Core/Reporting.cpp index b270dd283bc1..22a640fde3aa 100644 --- a/Core/Reporting.cpp +++ b/Core/Reporting.cpp @@ -32,7 +32,7 @@ #include "Core/ELF/ParamSFO.h" #include "GPU/GPUInterface.h" #include "GPU/GPUState.h" -#include "GPU/GLES/Framebuffer.h" +#include "GPU/GLES/FramebufferManagerGLES.h" #include "net/http_client.h" #include "net/resolve.h" #include "net/url.h" diff --git a/GPU/Common/TextureScalerCommon.cpp b/GPU/Common/TextureScalerCommon.cpp index 14d93de1502e..2491f2e5fd5a 100644 --- a/GPU/Common/TextureScalerCommon.cpp +++ b/GPU/Common/TextureScalerCommon.cpp @@ -487,14 +487,14 @@ void dbgPGM(int w, int h, u32* pixels, const char* prefix = "dbg") { // 1 compon /////////////////////////////////////// Texture Scaler -TextureScaler::TextureScaler() { +TextureScalerCommon::TextureScalerCommon() { initBicubicWeights(); } -TextureScaler::~TextureScaler() { +TextureScalerCommon::~TextureScalerCommon() { } -bool TextureScaler::IsEmptyOrFlat(u32* data, int pixels, int fmt) { +bool TextureScalerCommon::IsEmptyOrFlat(u32* data, int pixels, int fmt) { int pixelsPerWord = 4 / BytesPerPixel(fmt); u32 ref = data[0]; if (pixelsPerWord > 1 && (ref & 0x0000FFFF) != (ref >> 16)) { @@ -506,7 +506,7 @@ bool TextureScaler::IsEmptyOrFlat(u32* data, int pixels, int fmt) { return true; } -void TextureScaler::ScaleAlways(u32 *out, u32 *src, u32 &dstFmt, int &width, int &height, int factor) { +void TextureScalerCommon::ScaleAlways(u32 *out, u32 *src, u32 &dstFmt, int &width, int &height, int factor) { if (IsEmptyOrFlat(src, width*height, dstFmt)) { // This means it was a flat texture. Vulkan wants the size up front, so we need to make it happen. u32 pixel; @@ -535,7 +535,7 @@ void TextureScaler::ScaleAlways(u32 *out, u32 *src, u32 &dstFmt, int &width, int } } -bool TextureScaler::ScaleInto(u32 *outputBuf, u32 *src, u32 &dstFmt, int &width, int &height, int factor) { +bool TextureScalerCommon::ScaleInto(u32 *outputBuf, u32 *src, u32 &dstFmt, int &width, int &height, int factor) { #ifdef SCALING_MEASURE_TIME double t_start = real_time_now(); #endif @@ -587,7 +587,7 @@ bool TextureScaler::ScaleInto(u32 *outputBuf, u32 *src, u32 &dstFmt, int &width, return true; } -bool TextureScaler::Scale(u32* &data, u32 &dstFmt, int &width, int &height, int factor) { +bool TextureScalerCommon::Scale(u32* &data, u32 &dstFmt, int &width, int &height, int factor) { // prevent processing empty or flat textures (this happens a lot in some games) // doesn't hurt the standard case, will be very quick for textures with actual texture if (IsEmptyOrFlat(data, width*height, dstFmt)) { @@ -605,27 +605,27 @@ bool TextureScaler::Scale(u32* &data, u32 &dstFmt, int &width, int &height, int return false; } -void TextureScaler::ScaleXBRZ(int factor, u32* source, u32* dest, int width, int height) { +void TextureScalerCommon::ScaleXBRZ(int factor, u32* source, u32* dest, int width, int height) { xbrz::ScalerCfg cfg; GlobalThreadPool::Loop(std::bind(&xbrz::scale, factor, source, dest, width, height, xbrz::ColorFormat::ARGB, cfg, std::placeholders::_1, std::placeholders::_2), 0, height); } -void TextureScaler::ScaleBilinear(int factor, u32* source, u32* dest, int width, int height) { +void TextureScalerCommon::ScaleBilinear(int factor, u32* source, u32* dest, int width, int height) { bufTmp1.resize(width*height*factor); u32 *tmpBuf = bufTmp1.data(); GlobalThreadPool::Loop(std::bind(&bilinearH, factor, source, tmpBuf, width, std::placeholders::_1, std::placeholders::_2), 0, height); GlobalThreadPool::Loop(std::bind(&bilinearV, factor, tmpBuf, dest, width, 0, height, std::placeholders::_1, std::placeholders::_2), 0, height); } -void TextureScaler::ScaleBicubicBSpline(int factor, u32* source, u32* dest, int width, int height) { +void TextureScalerCommon::ScaleBicubicBSpline(int factor, u32* source, u32* dest, int width, int height) { GlobalThreadPool::Loop(std::bind(&scaleBicubicBSpline, factor, source, dest, width, height, std::placeholders::_1, std::placeholders::_2), 0, height); } -void TextureScaler::ScaleBicubicMitchell(int factor, u32* source, u32* dest, int width, int height) { +void TextureScalerCommon::ScaleBicubicMitchell(int factor, u32* source, u32* dest, int width, int height) { GlobalThreadPool::Loop(std::bind(&scaleBicubicMitchell, factor, source, dest, width, height, std::placeholders::_1, std::placeholders::_2), 0, height); } -void TextureScaler::ScaleHybrid(int factor, u32* source, u32* dest, int width, int height, bool bicubic) { +void TextureScalerCommon::ScaleHybrid(int factor, u32* source, u32* dest, int width, int height, bool bicubic) { // Basic algorithm: // 1) determine a feature mask C based on a sobel-ish filter + splatting, and upscale that mask bilinearly // 2) generate 2 scaled images: A - using Bilinear filtering, B - using xBRZ @@ -655,7 +655,7 @@ void TextureScaler::ScaleHybrid(int factor, u32* source, u32* dest, int width, i GlobalThreadPool::Loop(std::bind(&mix, dest, bufTmp2.data(), bufTmp3.data(), 8192, width*factor, std::placeholders::_1, std::placeholders::_2), 0, height*factor); } -void TextureScaler::DePosterize(u32* source, u32* dest, int width, int height) { +void TextureScalerCommon::DePosterize(u32* source, u32* dest, int width, int height) { bufTmp3.resize(width*height); GlobalThreadPool::Loop(std::bind(&deposterizeH, source, bufTmp3.data(), width, std::placeholders::_1, std::placeholders::_2), 0, height); GlobalThreadPool::Loop(std::bind(&deposterizeV, bufTmp3.data(), dest, width, height, std::placeholders::_1, std::placeholders::_2), 0, height); diff --git a/GPU/Common/TextureScalerCommon.h b/GPU/Common/TextureScalerCommon.h index 5af1d6d6ff8b..cf3438130512 100644 --- a/GPU/Common/TextureScalerCommon.h +++ b/GPU/Common/TextureScalerCommon.h @@ -22,10 +22,10 @@ #include -class TextureScaler { +class TextureScalerCommon { public: - TextureScaler(); - ~TextureScaler(); + TextureScalerCommon(); + ~TextureScalerCommon(); void ScaleAlways(u32 *out, u32 *src, u32 &dstFmt, int &width, int &height, int factor); bool Scale(u32 *&data, u32 &dstfmt, int &width, int &height, int factor); diff --git a/GPU/Directx9/GPU_DX9.cpp b/GPU/Directx9/GPU_DX9.cpp index 9af047151ae2..ec3f08011ebc 100644 --- a/GPU/Directx9/GPU_DX9.cpp +++ b/GPU/Directx9/GPU_DX9.cpp @@ -139,14 +139,14 @@ static const CommandTableEntry commandTable[] = { // These change the vertex shader so need flushing. {GE_CMD_REVERSENORMAL, FLAG_FLUSHBEFOREONCHANGE}, {GE_CMD_LIGHTINGENABLE, FLAG_FLUSHBEFOREONCHANGE}, - {GE_CMD_LIGHTENABLE0, FLAG_FLUSHBEFOREONCHANGE}, - {GE_CMD_LIGHTENABLE1, FLAG_FLUSHBEFOREONCHANGE}, - {GE_CMD_LIGHTENABLE2, FLAG_FLUSHBEFOREONCHANGE}, - {GE_CMD_LIGHTENABLE3, FLAG_FLUSHBEFOREONCHANGE}, - {GE_CMD_LIGHTTYPE0, FLAG_FLUSHBEFOREONCHANGE}, - {GE_CMD_LIGHTTYPE1, FLAG_FLUSHBEFOREONCHANGE}, - {GE_CMD_LIGHTTYPE2, FLAG_FLUSHBEFOREONCHANGE}, - {GE_CMD_LIGHTTYPE3, FLAG_FLUSHBEFOREONCHANGE}, + {GE_CMD_LIGHTENABLE0, FLAG_FLUSHBEFOREONCHANGE | FLAG_EXECUTEONCHANGE, &GPU_DX9::Execute_Light0Param}, + {GE_CMD_LIGHTENABLE1, FLAG_FLUSHBEFOREONCHANGE | FLAG_EXECUTEONCHANGE, &GPU_DX9::Execute_Light1Param}, + {GE_CMD_LIGHTENABLE2, FLAG_FLUSHBEFOREONCHANGE | FLAG_EXECUTEONCHANGE, &GPU_DX9::Execute_Light2Param}, + {GE_CMD_LIGHTENABLE3, FLAG_FLUSHBEFOREONCHANGE | FLAG_EXECUTEONCHANGE, &GPU_DX9::Execute_Light3Param}, + {GE_CMD_LIGHTTYPE0, FLAG_FLUSHBEFOREONCHANGE | FLAG_EXECUTEONCHANGE, &GPU_DX9::Execute_Light0Param}, + {GE_CMD_LIGHTTYPE1, FLAG_FLUSHBEFOREONCHANGE | FLAG_EXECUTEONCHANGE, &GPU_DX9::Execute_Light1Param}, + {GE_CMD_LIGHTTYPE2, FLAG_FLUSHBEFOREONCHANGE | FLAG_EXECUTEONCHANGE, &GPU_DX9::Execute_Light2Param}, + {GE_CMD_LIGHTTYPE3, FLAG_FLUSHBEFOREONCHANGE | FLAG_EXECUTEONCHANGE, &GPU_DX9::Execute_Light3Param}, {GE_CMD_MATERIALUPDATE, FLAG_FLUSHBEFOREONCHANGE}, // This changes both shaders so need flushing. diff --git a/GPU/Directx9/TextureScalerDX9.h b/GPU/Directx9/TextureScalerDX9.h index 8f66e595d8a3..bbae69813080 100644 --- a/GPU/Directx9/TextureScalerDX9.h +++ b/GPU/Directx9/TextureScalerDX9.h @@ -22,7 +22,7 @@ namespace DX9 { -class TextureScalerDX9 : public TextureScaler { +class TextureScalerDX9 : public TextureScalerCommon { private: void ConvertTo8888(u32 format, u32* source, u32* &dest, int width, int height) override; int BytesPerPixel(u32 format) override; diff --git a/GPU/GLES/DepalettizeShader.cpp b/GPU/GLES/DepalettizeShaderGLES.cpp similarity index 92% rename from GPU/GLES/DepalettizeShader.cpp rename to GPU/GLES/DepalettizeShaderGLES.cpp index 0b21ab31b036..8437c46f65ae 100644 --- a/GPU/GLES/DepalettizeShader.cpp +++ b/GPU/GLES/DepalettizeShaderGLES.cpp @@ -20,8 +20,8 @@ #include "base/logging.h" #include "Common/Log.h" #include "Core/Reporting.h" -#include "DepalettizeShader.h" -#include "GPU/GLES/TextureCache.h" +#include "DepalettizeShaderGLES.h" +#include "GPU/GLES/TextureCacheGLES.h" #include "GPU/GLES/GLStateCache.h" #include "GPU/Common/DepalettizeShaderCommon.h" @@ -90,7 +90,7 @@ static bool CheckShaderCompileSuccess(GLuint shader, const char *code) { } } -DepalShaderCache::DepalShaderCache() { +DepalShaderCacheGLES::DepalShaderCacheGLES() { // Pre-build the vertex program useGL3_ = gl_extensions.GLES3 || gl_extensions.VersionGEThan(3, 3); @@ -98,11 +98,11 @@ DepalShaderCache::DepalShaderCache() { vertexShader_ = 0; } -DepalShaderCache::~DepalShaderCache() { +DepalShaderCacheGLES::~DepalShaderCacheGLES() { Clear(); } -bool DepalShaderCache::CreateVertexShader() { +bool DepalShaderCacheGLES::CreateVertexShader() { if (vertexShaderFailed_) { return false; } @@ -121,11 +121,11 @@ bool DepalShaderCache::CreateVertexShader() { return !vertexShaderFailed_; } -u32 DepalShaderCache::GenerateShaderID(GEPaletteFormat clutFormat, GEBufferFormat pixelFormat) { +u32 DepalShaderCacheGLES::GenerateShaderID(GEPaletteFormat clutFormat, GEBufferFormat pixelFormat) { return (gstate.clutformat & 0xFFFFFF) | (pixelFormat << 24); } -GLuint DepalShaderCache::GetClutTexture(GEPaletteFormat clutFormat, const u32 clutID, u32 *rawClut) { +GLuint DepalShaderCacheGLES::GetClutTexture(GEPaletteFormat clutFormat, const u32 clutID, u32 *rawClut) { const u32 realClutID = clutID ^ clutFormat; auto oldtex = texCache_.find(realClutID); @@ -161,7 +161,7 @@ GLuint DepalShaderCache::GetClutTexture(GEPaletteFormat clutFormat, const u32 cl return tex->texture; } -void DepalShaderCache::Clear() { +void DepalShaderCacheGLES::Clear() { for (auto shader = cache_.begin(); shader != cache_.end(); ++shader) { glDeleteShader(shader->second->fragShader); if (shader->second->program) { @@ -181,7 +181,7 @@ void DepalShaderCache::Clear() { } } -void DepalShaderCache::Decimate() { +void DepalShaderCacheGLES::Decimate() { for (auto tex = texCache_.begin(); tex != texCache_.end(); ) { if (tex->second->lastFrame + DEPAL_TEXTURE_OLD_AGE < gpuStats.numFlips) { glDeleteTextures(1, &tex->second->texture); @@ -193,7 +193,7 @@ void DepalShaderCache::Decimate() { } } -DepalShader *DepalShaderCache::GetDepalettizeShader(GEPaletteFormat clutFormat, GEBufferFormat pixelFormat) { +DepalShader *DepalShaderCacheGLES::GetDepalettizeShader(GEPaletteFormat clutFormat, GEBufferFormat pixelFormat) { u32 id = GenerateShaderID(clutFormat, pixelFormat); auto shader = cache_.find(id); diff --git a/GPU/GLES/DepalettizeShader.h b/GPU/GLES/DepalettizeShaderGLES.h similarity index 95% rename from GPU/GLES/DepalettizeShader.h rename to GPU/GLES/DepalettizeShaderGLES.h index 1916d43df40e..2d845846cff3 100644 --- a/GPU/GLES/DepalettizeShader.h +++ b/GPU/GLES/DepalettizeShaderGLES.h @@ -36,10 +36,10 @@ class DepalTexture { }; // Caches both shaders and palette textures. -class DepalShaderCache { +class DepalShaderCacheGLES { public: - DepalShaderCache(); - ~DepalShaderCache(); + DepalShaderCacheGLES(); + ~DepalShaderCacheGLES(); // This also uploads the palette and binds the correct texture. DepalShader *GetDepalettizeShader(GEPaletteFormat clutFormat, GEBufferFormat pixelFormat); diff --git a/GPU/GLES/DrawEngineGLES.cpp b/GPU/GLES/DrawEngineGLES.cpp index 8a50df18e47e..35f660f2c83f 100644 --- a/GPU/GLES/DrawEngineGLES.cpp +++ b/GPU/GLES/DrawEngineGLES.cpp @@ -83,11 +83,11 @@ #include "GPU/Common/VertexDecoderCommon.h" #include "GPU/Common/SoftwareTransformCommon.h" #include "GPU/GLES/GLStateCache.h" -#include "GPU/GLES/FragmentTestCache.h" -#include "GPU/GLES/StateMapping.h" -#include "GPU/GLES/TextureCache.h" +#include "GPU/GLES/FragmentTestCacheGLES.h" +#include "GPU/GLES/StateMappingGLES.h" +#include "GPU/GLES/TextureCacheGLES.h" #include "GPU/GLES/DrawEngineGLES.h" -#include "GPU/GLES/ShaderManager.h" +#include "GPU/GLES/ShaderManagerGLES.h" #include "GPU/GLES/GPU_GLES.h" extern const GLuint glprim[8] = { diff --git a/GPU/GLES/DrawEngineGLES.h b/GPU/GLES/DrawEngineGLES.h index afa85edc3eea..d8d7f0a4b9a3 100644 --- a/GPU/GLES/DrawEngineGLES.h +++ b/GPU/GLES/DrawEngineGLES.h @@ -25,17 +25,17 @@ #include "GPU/Common/VertexDecoderCommon.h" #include "GPU/Common/DrawEngineCommon.h" #include "GPU/Common/GPUStateUtils.h" -#include "GPU/GLES/FragmentShaderGenerator.h" +#include "GPU/GLES/FragmentShaderGeneratorGLES.h" #include "gfx/gl_common.h" #include "gfx/gl_lost_manager.h" class LinkedShader; -class ShaderManager; -class TextureCache; -class FramebufferManager; +class ShaderManagerGLES; +class TextureCacheGLES; +class FramebufferManagerGLES; class FramebufferManagerCommon; class TextureCacheCommon; -class FragmentTestCache; +class FragmentTestCacheGLES; struct TransformedVertex; struct DecVtxFormat; @@ -114,16 +114,16 @@ class DrawEngineGLES : public DrawEngineCommon, public GfxResourceHolder { void SubmitPrim(void *verts, void *inds, GEPrimitiveType prim, int vertexCount, u32 vertType, int *bytesRead); - void SetShaderManager(ShaderManager *shaderManager) { + void SetShaderManager(ShaderManagerGLES *shaderManager) { shaderManager_ = shaderManager; } - void SetTextureCache(TextureCache *textureCache) { + void SetTextureCache(TextureCacheGLES *textureCache) { textureCache_ = textureCache; } - void SetFramebufferManager(FramebufferManager *fbManager) { + void SetFramebufferManager(FramebufferManagerGLES *fbManager) { framebufferManager_ = fbManager; } - void SetFragmentTestCache(FragmentTestCache *testCache) { + void SetFragmentTestCache(FragmentTestCacheGLES *testCache) { fragmentTestCache_ = testCache; } void RestoreVAO(); @@ -253,10 +253,10 @@ class DrawEngineGLES : public DrawEngineCommon, public GfxResourceHolder { GLuint sharedVao_; // Other - ShaderManager *shaderManager_; - TextureCache *textureCache_; - FramebufferManager *framebufferManager_; - FragmentTestCache *fragmentTestCache_; + ShaderManagerGLES *shaderManager_; + TextureCacheGLES *textureCache_; + FramebufferManagerGLES *framebufferManager_; + FragmentTestCacheGLES *fragmentTestCache_; enum { MAX_DEFERRED_DRAW_CALLS = 128 }; DeferredDrawCall drawCalls[MAX_DEFERRED_DRAW_CALLS]; diff --git a/GPU/GLES/FragmentShaderGenerator.cpp b/GPU/GLES/FragmentShaderGeneratorGLES.cpp similarity index 99% rename from GPU/GLES/FragmentShaderGenerator.cpp rename to GPU/GLES/FragmentShaderGeneratorGLES.cpp index e199bd01b775..52047739458e 100644 --- a/GPU/GLES/FragmentShaderGenerator.cpp +++ b/GPU/GLES/FragmentShaderGeneratorGLES.cpp @@ -25,9 +25,9 @@ #include "Core/Config.h" #include "GPU/Common/GPUStateUtils.h" #include "GPU/Common/ShaderId.h" -#include "GPU/GLES/FragmentShaderGenerator.h" -#include "GPU/GLES/Framebuffer.h" -#include "GPU/GLES/ShaderManager.h" +#include "GPU/GLES/FragmentShaderGeneratorGLES.h" +#include "GPU/GLES/FramebufferManagerGLES.h" +#include "GPU/GLES/ShaderManagerGLES.h" #include "GPU/ge_constants.h" #include "GPU/GPUState.h" diff --git a/GPU/GLES/FragmentShaderGenerator.h b/GPU/GLES/FragmentShaderGeneratorGLES.h similarity index 100% rename from GPU/GLES/FragmentShaderGenerator.h rename to GPU/GLES/FragmentShaderGeneratorGLES.h diff --git a/GPU/GLES/FragmentTestCache.cpp b/GPU/GLES/FragmentTestCacheGLES.cpp similarity index 90% rename from GPU/GLES/FragmentTestCache.cpp rename to GPU/GLES/FragmentTestCacheGLES.cpp index 10d04789fed2..b2c7881e2aa4 100644 --- a/GPU/GLES/FragmentTestCache.cpp +++ b/GPU/GLES/FragmentTestCacheGLES.cpp @@ -16,7 +16,7 @@ // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. #include "Core/Config.h" -#include "GPU/GLES/FragmentTestCache.h" +#include "GPU/GLES/FragmentTestCacheGLES.h" #include "GPU/GPUState.h" #include "GPU/Common/GPUStateUtils.h" #include "GPU/Common/ShaderId.h" @@ -25,16 +25,16 @@ static const int FRAGTEST_TEXTURE_OLD_AGE = 307; static const int FRAGTEST_DECIMATION_INTERVAL = 113; -FragmentTestCache::FragmentTestCache() : textureCache_(NULL), lastTexture_(0), decimationCounter_(0) { +FragmentTestCacheGLES::FragmentTestCacheGLES() : textureCache_(NULL), lastTexture_(0), decimationCounter_(0) { scratchpad_ = new u8[256 * 4]; } -FragmentTestCache::~FragmentTestCache() { +FragmentTestCacheGLES::~FragmentTestCacheGLES() { Clear(); delete [] scratchpad_; } -void FragmentTestCache::BindTestTexture(GLenum unit) { +void FragmentTestCacheGLES::BindTestTexture(GLenum unit) { if (!g_Config.bFragmentTestCache) { return; } @@ -89,7 +89,7 @@ void FragmentTestCache::BindTestTexture(GLenum unit) { cache_[id] = item; } -FragmentTestID FragmentTestCache::GenerateTestID() const { +FragmentTestID FragmentTestCacheGLES::GenerateTestID() const { FragmentTestID id; // Let's just keep it simple, it's all in here. id.alpha = gstate.isAlphaTestEnabled() ? gstate.alphatest : 0; @@ -103,7 +103,7 @@ FragmentTestID FragmentTestCache::GenerateTestID() const { return id; } -GLuint FragmentTestCache::CreateTestTexture(const GEComparison funcs[4], const u8 refs[4], const u8 masks[4], const bool valid[4]) { +GLuint FragmentTestCacheGLES::CreateTestTexture(const GEComparison funcs[4], const u8 refs[4], const u8 masks[4], const bool valid[4]) { // TODO: Might it be better to use GL_ALPHA for simple textures? // TODO: Experiment with 4-bit/etc. textures. @@ -155,7 +155,7 @@ GLuint FragmentTestCache::CreateTestTexture(const GEComparison funcs[4], const u return tex; } -void FragmentTestCache::Clear(bool deleteThem) { +void FragmentTestCacheGLES::Clear(bool deleteThem) { if (deleteThem) { for (auto tex = cache_.begin(); tex != cache_.end(); ++tex) { glDeleteTextures(1, &tex->second.texture); @@ -165,7 +165,7 @@ void FragmentTestCache::Clear(bool deleteThem) { lastTexture_ = 0; } -void FragmentTestCache::Decimate() { +void FragmentTestCacheGLES::Decimate() { if (--decimationCounter_ <= 0) { for (auto tex = cache_.begin(); tex != cache_.end(); ) { if (tex->second.lastFrame + FRAGTEST_TEXTURE_OLD_AGE < gpuStats.numFlips) { diff --git a/GPU/GLES/FragmentTestCache.h b/GPU/GLES/FragmentTestCacheGLES.h similarity index 90% rename from GPU/GLES/FragmentTestCache.h rename to GPU/GLES/FragmentTestCacheGLES.h index 31df1233d9ff..71f483e02cb6 100644 --- a/GPU/GLES/FragmentTestCache.h +++ b/GPU/GLES/FragmentTestCacheGLES.h @@ -20,7 +20,7 @@ #include #include "Common/CommonTypes.h" #include "GPU/GLES/GLStateCache.h" -#include "GPU/GLES/TextureCache.h" +#include "GPU/GLES/TextureCacheGLES.h" #include "GPU/ge_constants.h" @@ -57,12 +57,12 @@ struct FragmentTestTexture { int lastFrame; }; -class FragmentTestCache { +class FragmentTestCacheGLES { public: - FragmentTestCache(); - ~FragmentTestCache(); + FragmentTestCacheGLES(); + ~FragmentTestCacheGLES(); - void SetTextureCache(TextureCache *tc) { + void SetTextureCache(TextureCacheGLES *tc) { textureCache_ = tc; } @@ -76,7 +76,7 @@ class FragmentTestCache { GLuint CreateTestTexture(const GEComparison funcs[4], const u8 refs[4], const u8 masks[4], const bool valid[4]); FragmentTestID GenerateTestID() const; - TextureCache *textureCache_; + TextureCacheGLES *textureCache_; std::map cache_; u8 *scratchpad_; diff --git a/GPU/GLES/Framebuffer.cpp b/GPU/GLES/FramebufferManagerGLES.cpp similarity index 94% rename from GPU/GLES/Framebuffer.cpp rename to GPU/GLES/FramebufferManagerGLES.cpp index 96047333c11f..26bb7de21550 100644 --- a/GPU/GLES/Framebuffer.cpp +++ b/GPU/GLES/FramebufferManagerGLES.cpp @@ -41,10 +41,10 @@ #include "GPU/Debugger/Stepping.h" #include "GPU/GLES/GLStateCache.h" #include "GPU/GLES/FBO.h" -#include "GPU/GLES/Framebuffer.h" -#include "GPU/GLES/TextureCache.h" +#include "GPU/GLES/FramebufferManagerGLES.h" +#include "GPU/GLES/TextureCacheGLES.h" #include "GPU/GLES/DrawEngineGLES.h" -#include "GPU/GLES/ShaderManager.h" +#include "GPU/GLES/ShaderManagerGLES.h" // #define DEBUG_READ_PIXELS 1 @@ -69,7 +69,7 @@ static const char basic_vs[] = void ConvertFromRGBA8888(u8 *dst, const u8 *src, u32 dstStride, u32 srcStride, u32 width, u32 height, GEBufferFormat format); -void FramebufferManager::ClearBuffer(bool keepState) { +void FramebufferManagerGLES::ClearBuffer(bool keepState) { if (keepState) { glstate.scissorTest.force(false); glstate.depthWrite.force(GL_TRUE); @@ -101,7 +101,7 @@ void FramebufferManager::ClearBuffer(bool keepState) { } } -void FramebufferManager::DisableState() { +void FramebufferManagerGLES::DisableState() { glstate.blend.disable(); glstate.cullFace.disable(); glstate.depthTest.disable(); @@ -114,7 +114,7 @@ void FramebufferManager::DisableState() { glstate.stencilMask.set(0xFF); } -void FramebufferManager::SetNumExtraFBOs(int num) { +void FramebufferManagerGLES::SetNumExtraFBOs(int num) { for (size_t i = 0; i < extraFBOs_.size(); i++) { fbo_destroy(extraFBOs_[i]); } @@ -133,7 +133,7 @@ void FramebufferManager::SetNumExtraFBOs(int num) { fbo_unbind(); } -void FramebufferManager::CompileDraw2DProgram() { +void FramebufferManagerGLES::CompileDraw2DProgram() { if (!draw2dprogram_) { std::string errorString; draw2dprogram_ = glsl_create_source(basic_vs, tex_fs, &errorString); @@ -201,7 +201,7 @@ void FramebufferManager::CompileDraw2DProgram() { } } -void FramebufferManager::UpdatePostShaderUniforms(int bufferWidth, int bufferHeight, int renderWidth, int renderHeight) { +void FramebufferManagerGLES::UpdatePostShaderUniforms(int bufferWidth, int bufferHeight, int renderWidth, int renderHeight) { float u_delta = 1.0f / renderWidth; float v_delta = 1.0f / renderHeight; float u_pixel_delta = u_delta; @@ -225,7 +225,7 @@ void FramebufferManager::UpdatePostShaderUniforms(int bufferWidth, int bufferHei } } -void FramebufferManager::DestroyDraw2DProgram() { +void FramebufferManagerGLES::DestroyDraw2DProgram() { if (draw2dprogram_) { glsl_destroy(draw2dprogram_); draw2dprogram_ = nullptr; @@ -236,7 +236,7 @@ void FramebufferManager::DestroyDraw2DProgram() { } } -FramebufferManager::FramebufferManager() : +FramebufferManagerGLES::FramebufferManagerGLES() : drawPixelsTex_(0), drawPixelsTexFormat_(GE_FORMAT_INVALID), convBuf_(nullptr), @@ -254,7 +254,7 @@ FramebufferManager::FramebufferManager() : { } -void FramebufferManager::Init() { +void FramebufferManagerGLES::Init() { FramebufferManagerCommon::Init(); // Workaround for upscaling shaders where we force x1 resolution without saving it resized_ = true; @@ -262,7 +262,7 @@ void FramebufferManager::Init() { SetLineWidth(); } -FramebufferManager::~FramebufferManager() { +FramebufferManagerGLES::~FramebufferManagerGLES() { if (drawPixelsTex_) glDeleteTextures(1, &drawPixelsTex_); DestroyDraw2DProgram(); @@ -279,7 +279,7 @@ FramebufferManager::~FramebufferManager() { delete [] convBuf_; } -void FramebufferManager::MakePixelTexture(const u8 *srcPixels, GEBufferFormat srcPixelFormat, int srcStride, int width, int height) { +void FramebufferManagerGLES::MakePixelTexture(const u8 *srcPixels, GEBufferFormat srcPixelFormat, int srcStride, int width, int height) { if (drawPixelsTex_ && (drawPixelsTexFormat_ != srcPixelFormat || drawPixelsTexW_ != width || drawPixelsTexH_ != height)) { glDeleteTextures(1, &drawPixelsTex_); drawPixelsTex_ = 0; @@ -358,7 +358,7 @@ void FramebufferManager::MakePixelTexture(const u8 *srcPixels, GEBufferFormat sr glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, useConvBuf ? convBuf_ : srcPixels); } -void FramebufferManager::DrawPixels(VirtualFramebuffer *vfb, int dstX, int dstY, const u8 *srcPixels, GEBufferFormat srcPixelFormat, int srcStride, int width, int height) { +void FramebufferManagerGLES::DrawPixels(VirtualFramebuffer *vfb, int dstX, int dstY, const u8 *srcPixels, GEBufferFormat srcPixelFormat, int srcStride, int width, int height) { float v0 = 0.0f, v1 = 1.0f; if (useBufferedRendering_ && vfb && vfb->fbo) { fbo_bind_as_render_target(vfb->fbo); @@ -379,7 +379,7 @@ void FramebufferManager::DrawPixels(VirtualFramebuffer *vfb, int dstX, int dstY, textureCache_->ForgetLastTexture(); } -void FramebufferManager::DrawFramebufferToOutput(const u8 *srcPixels, GEBufferFormat srcPixelFormat, int srcStride, bool applyPostShader) { +void FramebufferManagerGLES::DrawFramebufferToOutput(const u8 *srcPixels, GEBufferFormat srcPixelFormat, int srcStride, bool applyPostShader) { MakePixelTexture(srcPixels, srcPixelFormat, srcStride, 512, 272); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, g_Config.iTexFiltering == TEX_FILTER_NEAREST ? GL_NEAREST : GL_LINEAR); @@ -440,7 +440,7 @@ void FramebufferManager::DrawFramebufferToOutput(const u8 *srcPixels, GEBufferFo } // x, y, w, h are relative coordinates against destW/destH, which is not very intuitive. -void FramebufferManager::DrawActiveTexture(GLuint texture, float x, float y, float w, float h, float destW, float destH, float u0, float v0, float u1, float v1, GLSLProgram *program, int uvRotation) { +void FramebufferManagerGLES::DrawActiveTexture(GLuint texture, float x, float y, float w, float h, float destW, float destH, float u0, float v0, float u1, float v1, GLSLProgram *program, int uvRotation) { float texCoords[8] = { u0,v0, u1,v0, @@ -527,7 +527,7 @@ void FramebufferManager::DrawActiveTexture(GLuint texture, float x, float y, flo glsl_unbind(); } -void FramebufferManager::DestroyFramebuf(VirtualFramebuffer *v) { +void FramebufferManagerGLES::DestroyFramebuf(VirtualFramebuffer *v) { textureCache_->NotifyFramebuffer(v->fb_address, v, NOTIFY_FB_DESTROYED); if (v->fbo) { fbo_destroy(v->fbo); @@ -547,7 +547,7 @@ void FramebufferManager::DestroyFramebuf(VirtualFramebuffer *v) { delete v; } -void FramebufferManager::RebindFramebuffer() { +void FramebufferManagerGLES::RebindFramebuffer() { if (currentRenderVfb_ && currentRenderVfb_->fbo) { fbo_bind_as_render_target(currentRenderVfb_->fbo); } else { @@ -557,7 +557,7 @@ void FramebufferManager::RebindFramebuffer() { glstate.viewport.restore(); } -void FramebufferManager::ResizeFramebufFBO(VirtualFramebuffer *vfb, u16 w, u16 h, bool force, bool skipCopy) { +void FramebufferManagerGLES::ResizeFramebufFBO(VirtualFramebuffer *vfb, u16 w, u16 h, bool force, bool skipCopy) { VirtualFramebuffer old = *vfb; if (force) { @@ -632,7 +632,7 @@ void FramebufferManager::ResizeFramebufFBO(VirtualFramebuffer *vfb, u16 w, u16 h } } -void FramebufferManager::NotifyRenderFramebufferCreated(VirtualFramebuffer *vfb) { +void FramebufferManagerGLES::NotifyRenderFramebufferCreated(VirtualFramebuffer *vfb) { if (!useBufferedRendering_) { fbo_unbind(); // Let's ignore rendering to targets that have not (yet) been displayed. @@ -651,7 +651,7 @@ void FramebufferManager::NotifyRenderFramebufferCreated(VirtualFramebuffer *vfb) } } -void FramebufferManager::NotifyRenderFramebufferSwitched(VirtualFramebuffer *prevVfb, VirtualFramebuffer *vfb, bool isClearingDepth) { +void FramebufferManagerGLES::NotifyRenderFramebufferSwitched(VirtualFramebuffer *prevVfb, VirtualFramebuffer *vfb, bool isClearingDepth) { if (ShouldDownloadFramebuffer(vfb) && !vfb->memoryUpdated) { ReadFramebufferToMemory(vfb, true, 0, 0, vfb->width, vfb->height); } else { @@ -714,7 +714,7 @@ void FramebufferManager::NotifyRenderFramebufferSwitched(VirtualFramebuffer *pre } } -void FramebufferManager::NotifyRenderFramebufferUpdated(VirtualFramebuffer *vfb, bool vfbFormatChanged) { +void FramebufferManagerGLES::NotifyRenderFramebufferUpdated(VirtualFramebuffer *vfb, bool vfbFormatChanged) { if (vfbFormatChanged) { textureCache_->NotifyFramebuffer(vfb->fb_address, vfb, NOTIFY_FB_UPDATED); if (vfb->drawnFormat != vfb->format) { @@ -728,7 +728,7 @@ void FramebufferManager::NotifyRenderFramebufferUpdated(VirtualFramebuffer *vfb, } } -void FramebufferManager::SetLineWidth() { +void FramebufferManagerGLES::SetLineWidth() { #ifndef USING_GLES2 if (g_Config.iInternalResolution == 0) { glLineWidth(std::max(1, (int)(renderWidth_ / 480))); @@ -740,7 +740,7 @@ void FramebufferManager::SetLineWidth() { #endif } -void FramebufferManager::ReformatFramebufferFrom(VirtualFramebuffer *vfb, GEBufferFormat old) { +void FramebufferManagerGLES::ReformatFramebufferFrom(VirtualFramebuffer *vfb, GEBufferFormat old) { if (!useBufferedRendering_ || !vfb->fbo) { return; } @@ -770,7 +770,7 @@ void FramebufferManager::ReformatFramebufferFrom(VirtualFramebuffer *vfb, GEBuff RebindFramebuffer(); } -void FramebufferManager::BlitFramebufferDepth(VirtualFramebuffer *src, VirtualFramebuffer *dst) { +void FramebufferManagerGLES::BlitFramebufferDepth(VirtualFramebuffer *src, VirtualFramebuffer *dst) { if (g_Config.bDisableSlowFramebufEffects) { return; } @@ -803,7 +803,7 @@ void FramebufferManager::BlitFramebufferDepth(VirtualFramebuffer *src, VirtualFr } } -FBO *FramebufferManager::GetTempFBO(u16 w, u16 h, FBOColorDepth depth) { +FBO *FramebufferManagerGLES::GetTempFBO(u16 w, u16 h, FBOColorDepth depth) { u64 key = ((u64)depth << 32) | ((u32)w << 16) | h; auto it = tempFBOs_.find(key); if (it != tempFBOs_.end()) { @@ -822,7 +822,7 @@ FBO *FramebufferManager::GetTempFBO(u16 w, u16 h, FBOColorDepth depth) { return fbo; } -void FramebufferManager::BindFramebufferColor(int stage, u32 fbRawAddress, VirtualFramebuffer *framebuffer, int flags) { +void FramebufferManagerGLES::BindFramebufferColor(int stage, u32 fbRawAddress, VirtualFramebuffer *framebuffer, int flags) { if (framebuffer == NULL) { framebuffer = currentRenderVfb_; } @@ -886,7 +886,7 @@ void FramebufferManager::BindFramebufferColor(int stage, u32 fbRawAddress, Virtu } } -struct CardboardSettings * FramebufferManager::GetCardboardSettings(struct CardboardSettings * cardboardSettings) { +struct CardboardSettings * FramebufferManagerGLES::GetCardboardSettings(struct CardboardSettings * cardboardSettings) { if (cardboardSettings) { // Calculate Cardboard Settings float cardboardScreenScale = g_Config.iCardboardScreenSize / 100.0f; @@ -912,7 +912,7 @@ struct CardboardSettings * FramebufferManager::GetCardboardSettings(struct Cardb return cardboardSettings; } -void FramebufferManager::CopyDisplayToOutput() { +void FramebufferManagerGLES::CopyDisplayToOutput() { DownloadFramebufferOnSwitch(currentRenderVfb_); glstate.viewport.set(0, 0, pixelWidth_, pixelHeight_); @@ -1128,7 +1128,7 @@ void FramebufferManager::CopyDisplayToOutput() { } } -void FramebufferManager::ReadFramebufferToMemory(VirtualFramebuffer *vfb, bool sync, int x, int y, int w, int h) { +void FramebufferManagerGLES::ReadFramebufferToMemory(VirtualFramebuffer *vfb, bool sync, int x, int y, int w, int h) { PROFILE_THIS_SCOPE("gpu-readback"); if (sync) { // flush async just in case when we go for synchronous update @@ -1163,7 +1163,7 @@ void FramebufferManager::ReadFramebufferToMemory(VirtualFramebuffer *vfb, bool s } } -void FramebufferManager::DownloadFramebufferForClut(u32 fb_address, u32 loadBytes) { +void FramebufferManagerGLES::DownloadFramebufferForClut(u32 fb_address, u32 loadBytes) { PROFILE_THIS_SCOPE("gpu-readback"); // Flush async just in case. PackFramebufferAsync_(nullptr); @@ -1202,7 +1202,7 @@ void FramebufferManager::DownloadFramebufferForClut(u32 fb_address, u32 loadByte } } -bool FramebufferManager::CreateDownloadTempBuffer(VirtualFramebuffer *nvfb) { +bool FramebufferManagerGLES::CreateDownloadTempBuffer(VirtualFramebuffer *nvfb) { // When updating VRAM, it need to be exact format. if (!gstate_c.Supports(GPU_PREFER_CPU_DOWNLOAD)) { switch (nvfb->format) { @@ -1234,7 +1234,7 @@ bool FramebufferManager::CreateDownloadTempBuffer(VirtualFramebuffer *nvfb) { return true; } -void FramebufferManager::UpdateDownloadTempBuffer(VirtualFramebuffer *nvfb) { +void FramebufferManagerGLES::UpdateDownloadTempBuffer(VirtualFramebuffer *nvfb) { _assert_msg_(G3D, nvfb->fbo, "Expecting a valid nvfb in UpdateDownloadTempBuffer"); // Discard the previous contents of this buffer where possible. @@ -1248,7 +1248,7 @@ void FramebufferManager::UpdateDownloadTempBuffer(VirtualFramebuffer *nvfb) { } } -void FramebufferManager::BlitFramebuffer(VirtualFramebuffer *dst, int dstX, int dstY, VirtualFramebuffer *src, int srcX, int srcY, int w, int h, int bpp) { +void FramebufferManagerGLES::BlitFramebuffer(VirtualFramebuffer *dst, int dstX, int dstY, VirtualFramebuffer *src, int srcX, int srcY, int w, int h, int bpp) { if (!dst->fbo || !src->fbo || !useBufferedRendering_) { // This can happen if they recently switched from non-buffered. fbo_unbind(); @@ -1509,7 +1509,7 @@ static void SafeGLReadPixels(GLint x, GLint y, GLsizei w, GLsizei h, GLenum fmt, } } -void FramebufferManager::PackFramebufferAsync_(VirtualFramebuffer *vfb) { +void FramebufferManagerGLES::PackFramebufferAsync_(VirtualFramebuffer *vfb) { const int MAX_PBO = 2; GLubyte *packed = 0; bool unbind = false; @@ -1670,7 +1670,7 @@ void FramebufferManager::PackFramebufferAsync_(VirtualFramebuffer *vfb) { } } -void FramebufferManager::PackFramebufferSync_(VirtualFramebuffer *vfb, int x, int y, int w, int h) { +void FramebufferManagerGLES::PackFramebufferSync_(VirtualFramebuffer *vfb, int x, int y, int w, int h) { if (vfb->fbo) { fbo_bind_for_read(vfb->fbo); } else { @@ -1739,7 +1739,7 @@ void FramebufferManager::PackFramebufferSync_(VirtualFramebuffer *vfb, int x, in fbo_unbind_read(); } -void FramebufferManager::PackDepthbuffer(VirtualFramebuffer *vfb, int x, int y, int w, int h) { +void FramebufferManagerGLES::PackDepthbuffer(VirtualFramebuffer *vfb, int x, int y, int w, int h) { if (vfb->fbo) { fbo_bind_for_read(vfb->fbo); } else { @@ -1782,7 +1782,7 @@ void FramebufferManager::PackDepthbuffer(VirtualFramebuffer *vfb, int x, int y, fbo_unbind_read(); } -void FramebufferManager::EndFrame() { +void FramebufferManagerGLES::EndFrame() { if (resized_) { // TODO: Only do this if the new size actually changed the renderwidth/height. DestroyAllFBOs(false); @@ -1854,13 +1854,13 @@ void FramebufferManager::EndFrame() { } } -void FramebufferManager::DeviceLost() { +void FramebufferManagerGLES::DeviceLost() { DestroyAllFBOs(false); DestroyDraw2DProgram(); resized_ = false; } -std::vector FramebufferManager::GetFramebufferList() { +std::vector FramebufferManagerGLES::GetFramebufferList() { std::vector list; for (size_t i = 0; i < vfbs_.size(); ++i) { @@ -1879,7 +1879,7 @@ std::vector FramebufferManager::GetFramebufferList() { return list; } -void FramebufferManager::DecimateFBOs() { +void FramebufferManagerGLES::DecimateFBOs() { fbo_unbind(); currentRenderVfb_ = 0; @@ -1926,7 +1926,7 @@ void FramebufferManager::DecimateFBOs() { } } -void FramebufferManager::DestroyAllFBOs(bool forceDelete) { +void FramebufferManagerGLES::DestroyAllFBOs(bool forceDelete) { fbo_unbind(); currentRenderVfb_ = 0; displayFramebuf_ = 0; @@ -1955,7 +1955,7 @@ void FramebufferManager::DestroyAllFBOs(bool forceDelete) { DisableState(); } -void FramebufferManager::FlushBeforeCopy() { +void FramebufferManagerGLES::FlushBeforeCopy() { // Flush anything not yet drawn before blitting, downloading, or uploading. // This might be a stalled list, or unflushed before a block transfer, etc. @@ -1966,11 +1966,11 @@ void FramebufferManager::FlushBeforeCopy() { transformDraw_->Flush(); } -void FramebufferManager::Resized() { +void FramebufferManagerGLES::Resized() { resized_ = true; } -bool FramebufferManager::GetFramebuffer(u32 fb_address, int fb_stride, GEBufferFormat format, GPUDebugBuffer &buffer, int maxRes) { +bool FramebufferManagerGLES::GetFramebuffer(u32 fb_address, int fb_stride, GEBufferFormat format, GPUDebugBuffer &buffer, int maxRes) { VirtualFramebuffer *vfb = currentRenderVfb_; if (!vfb) { vfb = GetVFBAt(fb_address); @@ -2016,7 +2016,7 @@ bool FramebufferManager::GetFramebuffer(u32 fb_address, int fb_stride, GEBufferF return true; } -bool FramebufferManager::GetOutputFramebuffer(GPUDebugBuffer &buffer) { +bool FramebufferManagerGLES::GetOutputFramebuffer(GPUDebugBuffer &buffer) { fbo_unbind_read(); int pw = PSP_CoreParameter().pixelWidth; @@ -2029,7 +2029,7 @@ bool FramebufferManager::GetOutputFramebuffer(GPUDebugBuffer &buffer) { return true; } -bool FramebufferManager::GetDepthbuffer(u32 fb_address, int fb_stride, u32 z_address, int z_stride, GPUDebugBuffer &buffer) { +bool FramebufferManagerGLES::GetDepthbuffer(u32 fb_address, int fb_stride, u32 z_address, int z_stride, GPUDebugBuffer &buffer) { VirtualFramebuffer *vfb = currentRenderVfb_; if (!vfb) { vfb = GetVFBAt(fb_address); @@ -2056,7 +2056,7 @@ bool FramebufferManager::GetDepthbuffer(u32 fb_address, int fb_stride, u32 z_add return true; } -bool FramebufferManager::GetStencilbuffer(u32 fb_address, int fb_stride, GPUDebugBuffer &buffer) { +bool FramebufferManagerGLES::GetStencilbuffer(u32 fb_address, int fb_stride, GPUDebugBuffer &buffer) { VirtualFramebuffer *vfb = currentRenderVfb_; if (!vfb) { vfb = GetVFBAt(fb_address); diff --git a/GPU/GLES/Framebuffer.h b/GPU/GLES/FramebufferManagerGLES.h similarity index 94% rename from GPU/GLES/Framebuffer.h rename to GPU/GLES/FramebufferManagerGLES.h index 5ad05fc8199a..8527881e90f9 100644 --- a/GPU/GLES/Framebuffer.h +++ b/GPU/GLES/FramebufferManagerGLES.h @@ -34,9 +34,9 @@ #include "Core/Config.h" struct GLSLProgram; -class TextureCache; +class TextureCacheGLES; class DrawEngineGLES; -class ShaderManager; +class ShaderManagerGLES; // Simple struct for asynchronous PBO readbacks struct AsyncPBO { @@ -60,15 +60,15 @@ struct CardboardSettings { float screenHeight; }; -class FramebufferManager : public FramebufferManagerCommon { +class FramebufferManagerGLES : public FramebufferManagerCommon { public: - FramebufferManager(); - ~FramebufferManager(); + FramebufferManagerGLES(); + ~FramebufferManagerGLES(); - void SetTextureCache(TextureCache *tc) { + void SetTextureCache(TextureCacheGLES *tc) { textureCache_ = tc; } - void SetShaderManager(ShaderManager *sm) { + void SetShaderManager(ShaderManagerGLES *sm) { shaderManager_ = sm; } void SetTransformDrawEngine(DrawEngineGLES *td) { @@ -164,8 +164,8 @@ class FramebufferManager : public FramebufferManagerCommon { int pixelDeltaLoc_; int deltaLoc_; - TextureCache *textureCache_; - ShaderManager *shaderManager_; + TextureCacheGLES *textureCache_; + ShaderManagerGLES *shaderManager_; DrawEngineGLES *transformDraw_; // Used by post-processing shader diff --git a/GPU/GLES/GPU_GLES.cpp b/GPU/GLES/GPU_GLES.cpp index e81aa994ffc8..432153fbb81f 100644 --- a/GPU/GLES/GPU_GLES.cpp +++ b/GPU/GLES/GPU_GLES.cpp @@ -36,11 +36,11 @@ #include "GPU/Common/FramebufferCommon.h" #include "GPU/GLES/GLStateCache.h" -#include "GPU/GLES/ShaderManager.h" +#include "GPU/GLES/ShaderManagerGLES.h" #include "GPU/GLES/GPU_GLES.h" -#include "GPU/GLES/Framebuffer.h" +#include "GPU/GLES/FramebufferManagerGLES.h" #include "GPU/GLES/DrawEngineGLES.h" -#include "GPU/GLES/TextureCache.h" +#include "GPU/GLES/TextureCacheGLES.h" #include "Core/MIPS/MIPS.h" #include "Core/HLE/sceKernelThread.h" @@ -401,10 +401,10 @@ GPU_GLES::GPU_GLES(GraphicsContext *ctx) UpdateVsyncInterval(true); CheckGPUFeatures(); - shaderManager_ = new ShaderManager(); - framebufferManagerGL_ = new FramebufferManager(); + shaderManager_ = new ShaderManagerGLES(); + framebufferManagerGL_ = new FramebufferManagerGLES(); framebufferManager_ = framebufferManagerGL_; - textureCacheGL_ = new TextureCache(); + textureCacheGL_ = new TextureCacheGLES(); textureCache_ = textureCacheGL_; drawEngine_.SetShaderManager(shaderManager_); @@ -2207,7 +2207,7 @@ bool GPU_GLES::GetCurrentClut(GPUDebugBuffer &buffer) { } bool GPU_GLES::GetOutputFramebuffer(GPUDebugBuffer &buffer) { - return FramebufferManager::GetOutputFramebuffer(buffer); + return FramebufferManagerGLES::GetOutputFramebuffer(buffer); } bool GPU_GLES::GetCurrentSimpleVertices(int count, std::vector &vertices, std::vector &indices) { diff --git a/GPU/GLES/GPU_GLES.h b/GPU/GLES/GPU_GLES.h index 72cff5362665..fa4afa5901fe 100644 --- a/GPU/GLES/GPU_GLES.h +++ b/GPU/GLES/GPU_GLES.h @@ -22,13 +22,13 @@ #include "GPU/GPUCommon.h" #include "GPU/GLES/FBO.h" -#include "GPU/GLES/Framebuffer.h" +#include "GPU/GLES/FramebufferManagerGLES.h" #include "GPU/GLES/DrawEngineGLES.h" -#include "GPU/GLES/TextureCache.h" -#include "GPU/GLES/DepalettizeShader.h" -#include "GPU/GLES/FragmentTestCache.h" +#include "GPU/GLES/TextureCacheGLES.h" +#include "GPU/GLES/DepalettizeShaderGLES.h" +#include "GPU/GLES/FragmentTestCacheGLES.h" -class ShaderManager; +class ShaderManagerGLES; class LinkedShader; class GraphicsContext; @@ -168,12 +168,12 @@ class GPU_GLES : public GPUCommon { static CommandInfo cmdInfo_[256]; - FramebufferManager *framebufferManagerGL_; - TextureCache *textureCacheGL_; - DepalShaderCache depalShaderCache_; + FramebufferManagerGLES *framebufferManagerGL_; + TextureCacheGLES *textureCacheGL_; + DepalShaderCacheGLES depalShaderCache_; DrawEngineGLES drawEngine_; - FragmentTestCache fragmentTestCache_; - ShaderManager *shaderManager_; + FragmentTestCacheGLES fragmentTestCache_; + ShaderManagerGLES *shaderManager_; int lastVsync_; diff --git a/GPU/GLES/ShaderManager.cpp b/GPU/GLES/ShaderManagerGLES.cpp similarity index 97% rename from GPU/GLES/ShaderManager.cpp rename to GPU/GLES/ShaderManagerGLES.cpp index 30f6da672895..f2fcca9a7502 100644 --- a/GPU/GLES/ShaderManager.cpp +++ b/GPU/GLES/ShaderManagerGLES.cpp @@ -39,9 +39,9 @@ #include "GPU/GPUState.h" #include "GPU/ge_constants.h" #include "GPU/GLES/GLStateCache.h" -#include "GPU/GLES/ShaderManager.h" +#include "GPU/GLES/ShaderManagerGLES.h" #include "GPU/GLES/DrawEngineGLES.h" -#include "Framebuffer.h" +#include "FramebufferManagerGLES.h" Shader::Shader(const char *code, uint32_t glShaderType, bool useHWTransform) : failed_(false), useHWTransform_(useHWTransform) { @@ -756,18 +756,18 @@ void LinkedShader::UpdateUniforms(u32 vertType, const ShaderID &vsid) { } } -ShaderManager::ShaderManager() +ShaderManagerGLES::ShaderManagerGLES() : lastShader_(nullptr), globalDirty_(DIRTY_ALL), shaderSwitchDirty_(0), diskCacheDirty_(false) { codeBuffer_ = new char[16384]; lastFSID_.set_invalid(); lastVSID_.set_invalid(); } -ShaderManager::~ShaderManager() { +ShaderManagerGLES::~ShaderManagerGLES() { delete [] codeBuffer_; } -void ShaderManager::Clear() { +void ShaderManagerGLES::Clear() { DirtyLastShader(); for (auto iter = linkedShaderCache_.begin(); iter != linkedShaderCache_.end(); ++iter) { delete iter->ls; @@ -787,12 +787,12 @@ void ShaderManager::Clear() { DirtyShader(); } -void ShaderManager::ClearCache(bool deleteThem) { +void ShaderManagerGLES::ClearCache(bool deleteThem) { // TODO: Recreate all from the diskcache when we come back. Clear(); } -void ShaderManager::DirtyShader() { +void ShaderManagerGLES::DirtyShader() { // Forget the last shader ID lastFSID_.set_invalid(); lastVSID_.set_invalid(); @@ -801,27 +801,27 @@ void ShaderManager::DirtyShader() { shaderSwitchDirty_ = 0; } -void ShaderManager::DirtyLastShader() { // disables vertex arrays +void ShaderManagerGLES::DirtyLastShader() { // disables vertex arrays if (lastShader_) lastShader_->stop(); lastShader_ = nullptr; lastVShaderSame_ = false; } -Shader *ShaderManager::CompileFragmentShader(ShaderID FSID) { +Shader *ShaderManagerGLES::CompileFragmentShader(ShaderID FSID) { if (!GenerateFragmentShader(FSID, codeBuffer_)) { return nullptr; } return new Shader(codeBuffer_, GL_FRAGMENT_SHADER, false); } -Shader *ShaderManager::CompileVertexShader(ShaderID VSID) { +Shader *ShaderManagerGLES::CompileVertexShader(ShaderID VSID) { bool useHWTransform = VSID.Bit(VS_BIT_USE_HW_TRANSFORM); GenerateVertexShader(VSID, codeBuffer_); return new Shader(codeBuffer_, GL_VERTEX_SHADER, useHWTransform); } -Shader *ShaderManager::ApplyVertexShader(int prim, u32 vertType, ShaderID *VSID) { +Shader *ShaderManagerGLES::ApplyVertexShader(int prim, u32 vertType, ShaderID *VSID) { if (globalDirty_) { if (lastShader_) lastShader_->dirtyUniforms |= globalDirty_; @@ -873,7 +873,7 @@ Shader *ShaderManager::ApplyVertexShader(int prim, u32 vertType, ShaderID *VSID) return vs; } -LinkedShader *ShaderManager::ApplyFragmentShader(ShaderID VSID, Shader *vs, u32 vertType, int prim) { +LinkedShader *ShaderManagerGLES::ApplyFragmentShader(ShaderID VSID, Shader *vs, u32 vertType, int prim) { ShaderID FSID; ComputeFragmentShaderID(&FSID); if (lastVShaderSame_ && FSID == lastFSID_) { @@ -935,7 +935,7 @@ std::string Shader::GetShaderString(DebugShaderStringType type, ShaderID id) con } } -std::vector ShaderManager::DebugGetShaderIDs(DebugShaderType type) { +std::vector ShaderManagerGLES::DebugGetShaderIDs(DebugShaderType type) { std::string id; std::vector ids; switch (type) { @@ -961,7 +961,7 @@ std::vector ShaderManager::DebugGetShaderIDs(DebugShaderType type) return ids; } -std::string ShaderManager::DebugGetShaderString(std::string id, DebugShaderType type, DebugShaderStringType stringType) { +std::string ShaderManagerGLES::DebugGetShaderString(std::string id, DebugShaderType type, DebugShaderStringType stringType) { ShaderID shaderId; shaderId.FromString(id); switch (type) { @@ -1010,7 +1010,7 @@ struct CacheHeader { int numLinkedPrograms; }; -void ShaderManager::LoadAndPrecompile(const std::string &filename) { +void ShaderManagerGLES::LoadAndPrecompile(const std::string &filename) { File::IOFile f(filename, "rb"); if (!f.IsOpen()) { return; @@ -1075,7 +1075,7 @@ void ShaderManager::LoadAndPrecompile(const std::string &filename) { diskCacheDirty_ = false; } -void ShaderManager::Save(const std::string &filename) { +void ShaderManagerGLES::Save(const std::string &filename) { if (!diskCacheDirty_) { return; } diff --git a/GPU/GLES/ShaderManager.h b/GPU/GLES/ShaderManagerGLES.h similarity index 97% rename from GPU/GLES/ShaderManager.h rename to GPU/GLES/ShaderManagerGLES.h index c76a99eab90f..d934ad7994e6 100644 --- a/GPU/GLES/ShaderManager.h +++ b/GPU/GLES/ShaderManagerGLES.h @@ -23,8 +23,8 @@ #include "GPU/Common/ShaderCommon.h" #include "GPU/Common/ShaderId.h" -#include "GPU/GLES/VertexShaderGenerator.h" -#include "GPU/GLES/FragmentShaderGenerator.h" +#include "GPU/GLES/VertexShaderGeneratorGLES.h" +#include "GPU/GLES/FragmentShaderGeneratorGLES.h" class Shader; @@ -192,10 +192,10 @@ class Shader { bool isFragment_; }; -class ShaderManager { +class ShaderManagerGLES { public: - ShaderManager(); - ~ShaderManager(); + ShaderManagerGLES(); + ~ShaderManagerGLES(); void ClearCache(bool deleteThem); // TODO: deleteThem currently not respected diff --git a/GPU/GLES/StateMapping.cpp b/GPU/GLES/StateMappingGLES.cpp similarity index 98% rename from GPU/GLES/StateMapping.cpp rename to GPU/GLES/StateMappingGLES.cpp index c5e2e359451b..1e8daedde04f 100644 --- a/GPU/GLES/StateMapping.cpp +++ b/GPU/GLES/StateMappingGLES.cpp @@ -20,7 +20,7 @@ // https://github.com/hrydgard/ppsspp/issues/3768 -#include "StateMapping.h" +#include "StateMappingGLES.h" #include "profiler/profiler.h" #include "GPU/Math3D.h" @@ -31,10 +31,10 @@ #include "Core/Reporting.h" #include "GPU/GLES/GPU_GLES.h" #include "GPU/GLES/GLStateCache.h" -#include "GPU/GLES/ShaderManager.h" -#include "GPU/GLES/TextureCache.h" -#include "GPU/GLES/Framebuffer.h" -#include "GPU/GLES/FragmentShaderGenerator.h" +#include "GPU/GLES/ShaderManagerGLES.h" +#include "GPU/GLES/TextureCacheGLES.h" +#include "GPU/GLES/FramebufferManagerGLES.h" +#include "GPU/GLES/FragmentShaderGeneratorGLES.h" static const GLushort glBlendFactorLookup[(size_t)BlendFactor::COUNT] = { GL_ZERO, diff --git a/GPU/GLES/StateMapping.h b/GPU/GLES/StateMappingGLES.h similarity index 100% rename from GPU/GLES/StateMapping.h rename to GPU/GLES/StateMappingGLES.h diff --git a/GPU/GLES/StencilBuffer.cpp b/GPU/GLES/StencilBufferGLES.cpp similarity index 97% rename from GPU/GLES/StencilBuffer.cpp rename to GPU/GLES/StencilBufferGLES.cpp index 4c694145ff18..3209c360b1b8 100644 --- a/GPU/GLES/StencilBuffer.cpp +++ b/GPU/GLES/StencilBufferGLES.cpp @@ -18,9 +18,9 @@ #include "gfx_es2/glsl_program.h" #include "Core/Reporting.h" #include "GPU/GLES/GLStateCache.h" -#include "GPU/GLES/Framebuffer.h" -#include "GPU/GLES/ShaderManager.h" -#include "GPU/GLES/TextureCache.h" +#include "GPU/GLES/FramebufferManagerGLES.h" +#include "GPU/GLES/ShaderManagerGLES.h" +#include "GPU/GLES/TextureCacheGLES.h" static const char *gles_prefix = "#version 100\n" @@ -89,7 +89,7 @@ static u8 StencilBits8888(const u8 *ptr8, u32 numPixels) { return bits >> 24; } -bool FramebufferManager::NotifyStencilUpload(u32 addr, int size, bool skipZero) { +bool FramebufferManagerGLES::NotifyStencilUpload(u32 addr, int size, bool skipZero) { if (!MayIntersectFramebuffer(addr)) { return false; } diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCacheGLES.cpp similarity index 95% rename from GPU/GLES/TextureCache.cpp rename to GPU/GLES/TextureCacheGLES.cpp index 3bddffd48711..dd14f7a19ead 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCacheGLES.cpp @@ -31,11 +31,11 @@ #include "GPU/ge_constants.h" #include "GPU/GPUState.h" #include "GPU/GLES/GLStateCache.h" -#include "GPU/GLES/TextureCache.h" -#include "GPU/GLES/Framebuffer.h" -#include "GPU/GLES/FragmentShaderGenerator.h" -#include "GPU/GLES/DepalettizeShader.h" -#include "GPU/GLES/ShaderManager.h" +#include "GPU/GLES/TextureCacheGLES.h" +#include "GPU/GLES/FramebufferManagerGLES.h" +#include "GPU/GLES/FragmentShaderGeneratorGLES.h" +#include "GPU/GLES/DepalettizeShaderGLES.h" +#include "GPU/GLES/ShaderManagerGLES.h" #include "GPU/GLES/DrawEngineGLES.h" #include "GPU/Common/TextureDecoder.h" @@ -70,7 +70,7 @@ #define INVALID_TEX -1 -TextureCache::TextureCache() : secondCacheSizeEstimate_(0), clearCacheNextFrame_(false), lowMemoryMode_(false), texelsScaledThisFrame_(0) { +TextureCacheGLES::TextureCacheGLES() : secondCacheSizeEstimate_(0), clearCacheNextFrame_(false), lowMemoryMode_(false), texelsScaledThisFrame_(0) { timesInvalidatedAllThisFrame_ = 0; lastBoundTexture = INVALID_TEX; decimationCounter_ = TEXCACHE_DECIMATION_INTERVAL; @@ -81,11 +81,11 @@ TextureCache::TextureCache() : secondCacheSizeEstimate_(0), clearCacheNextFrame_ nextTexture_ = nullptr; } -TextureCache::~TextureCache() { +TextureCacheGLES::~TextureCacheGLES() { Clear(true); } -void TextureCache::Clear(bool delete_them) { +void TextureCacheGLES::Clear(bool delete_them) { glBindTexture(GL_TEXTURE_2D, 0); lastBoundTexture = INVALID_TEX; if (delete_them) { @@ -113,7 +113,7 @@ void TextureCache::Clear(bool delete_them) { videos_.clear(); } -void TextureCache::DeleteTexture(TexCache::iterator it) { +void TextureCacheGLES::DeleteTexture(TexCache::iterator it) { glDeleteTextures(1, &it->second.textureName); auto fbInfo = fbTexInfo_.find(it->first); if (fbInfo != fbTexInfo_.end()) { @@ -125,7 +125,7 @@ void TextureCache::DeleteTexture(TexCache::iterator it) { } // Removes old textures. -void TextureCache::Decimate() { +void TextureCacheGLES::Decimate() { if (--decimationCounter_ <= 0) { decimationCounter_ = TEXCACHE_DECIMATION_INTERVAL; } else { @@ -169,7 +169,7 @@ void TextureCache::Decimate() { DecimateVideos(); } -void TextureCache::Invalidate(u32 addr, int size, GPUInvalidationType type) { +void TextureCacheGLES::Invalidate(u32 addr, int size, GPUInvalidationType type) { // If we're hashing every use, without backoff, then this isn't needed. if (!g_Config.bTextureBackoffCache) { return; @@ -213,7 +213,7 @@ void TextureCache::Invalidate(u32 addr, int size, GPUInvalidationType type) { } } -void TextureCache::InvalidateAll(GPUInvalidationType /*unused*/) { +void TextureCacheGLES::InvalidateAll(GPUInvalidationType /*unused*/) { // If we're hashing every use, without backoff, then this isn't needed. if (!g_Config.bTextureBackoffCache) { return; @@ -234,11 +234,11 @@ void TextureCache::InvalidateAll(GPUInvalidationType /*unused*/) { } } -void TextureCache::ClearNextFrame() { +void TextureCacheGLES::ClearNextFrame() { clearCacheNextFrame_ = true; } -bool TextureCache::AttachFramebuffer(TexCacheEntry *entry, u32 address, VirtualFramebuffer *framebuffer, u32 texaddrOffset) { +bool TextureCacheGLES::AttachFramebuffer(TexCacheEntry *entry, u32 address, VirtualFramebuffer *framebuffer, u32 texaddrOffset) { static const u32 MAX_SUBAREA_Y_OFFSET_SAFE = 32; AttachedFramebufferInfo fbInfo = {0}; @@ -376,7 +376,7 @@ static const GLuint MagFiltGL[2] = { }; // This should not have to be done per texture! OpenGL is silly yo -void TextureCache::UpdateSamplingParams(TexCacheEntry &entry, bool force) { +void TextureCacheGLES::UpdateSamplingParams(TexCacheEntry &entry, bool force) { int minFilt; int magFilt; bool sClamp; @@ -430,7 +430,7 @@ void TextureCache::UpdateSamplingParams(TexCacheEntry &entry, bool force) { } } -void TextureCache::SetFramebufferSamplingParams(u16 bufferWidth, u16 bufferHeight) { +void TextureCacheGLES::SetFramebufferSamplingParams(u16 bufferWidth, u16 bufferHeight) { int minFilt; int magFilt; bool sClamp; @@ -481,7 +481,7 @@ static void ConvertColors(void *dstBuf, const void *srcBuf, GLuint dstFmt, int n } } -void TextureCache::StartFrame() { +void TextureCacheGLES::StartFrame() { lastBoundTexture = INVALID_TEX; timesInvalidatedAllThisFrame_ = 0; @@ -501,7 +501,7 @@ static inline u32 MiniHash(const u32 *ptr) { return ptr[0]; } -static inline u32 QuickTexHash(TextureReplacer &replacer, u32 addr, int bufw, int w, int h, GETextureFormat format, TextureCache::TexCacheEntry *entry) { +static inline u32 QuickTexHash(TextureReplacer &replacer, u32 addr, int bufw, int w, int h, GETextureFormat format, TextureCacheGLES::TexCacheEntry *entry) { if (replacer.Enabled()) { return replacer.ComputeHash(addr, bufw, w, h, format, entry->maxSeenV); } @@ -520,7 +520,7 @@ static inline u32 QuickTexHash(TextureReplacer &replacer, u32 addr, int bufw, in } } -void TextureCache::UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutBase, bool clutIndexIsSimple) { +void TextureCacheGLES::UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutBase, bool clutIndexIsSimple) { const u32 clutBaseBytes = clutFormat == GE_CMODE_32BIT_ABGR8888 ? (clutBase * sizeof(u32)) : (clutBase * sizeof(u16)); // Technically, these extra bytes weren't loaded, but hopefully it was loaded earlier. // If not, we're going to hash random data, which hopefully doesn't cause a performance issue. @@ -561,7 +561,7 @@ void TextureCache::UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutBase, b clutLastFormat_ = gstate.clutformat; } -inline u32 TextureCache::GetCurrentClutHash() { +inline u32 TextureCacheGLES::GetCurrentClutHash() { return clutHash_; } @@ -607,7 +607,7 @@ bool SetDebugTexture() { } #endif -void TextureCache::SetTextureFramebuffer(TexCacheEntry *entry, VirtualFramebuffer *framebuffer) { +void TextureCacheGLES::SetTextureFramebuffer(TexCacheEntry *entry, VirtualFramebuffer *framebuffer) { _dbg_assert_msg_(G3D, framebuffer != nullptr, "Framebuffer must not be null."); framebuffer->usageFlags |= FB_USAGE_TEXTURE; @@ -644,7 +644,7 @@ void TextureCache::SetTextureFramebuffer(TexCacheEntry *entry, VirtualFramebuffe nextNeedsRebuild_ = false; } -void TextureCache::ApplyTexture() { +void TextureCacheGLES::ApplyTexture() { TexCacheEntry *entry = nextTexture_; if (entry == nullptr) { return; @@ -700,7 +700,7 @@ void TextureCache::ApplyTexture() { } } -void TextureCache::DownloadFramebufferForClut(u32 clutAddr, u32 bytes) { +void TextureCacheGLES::DownloadFramebufferForClut(u32 clutAddr, u32 bytes) { framebufferManager_->DownloadFramebufferForClut(clutAddr, bytes); } @@ -836,7 +836,7 @@ class TextureShaderApplier { int renderH_; }; -void TextureCache::ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFramebuffer *framebuffer) { +void TextureCacheGLES::ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFramebuffer *framebuffer) { DepalShader *depal = nullptr; const GEPaletteFormat clutFormat = gstate.getClutPaletteFormat(); if ((entry->status & TexCacheEntry::STATUS_DEPALETTIZE) && !g_Config.bDisableSlowFramebufEffects) { @@ -885,7 +885,7 @@ void TextureCache::ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFramebuf lastBoundTexture = INVALID_TEX; } -bool TextureCache::SetOffsetTexture(u32 offset) { +bool TextureCacheGLES::SetOffsetTexture(u32 offset) { if (g_Config.iRenderingMode != FB_BUFFERED_MODE) { return false; } @@ -948,7 +948,7 @@ GLenum ToGLESFormat(ReplacedTextureFormat fmt) { } } -void TextureCache::SetTexture(bool force) { +void TextureCacheGLES::SetTexture(bool force) { #ifdef DEBUG_TEXTURES if (SetDebugTexture()) { // A different texture was bound, let's rebind next time. @@ -1159,7 +1159,7 @@ void TextureCache::SetTexture(bool force) { nextNeedsRebuild_= true; } -bool TextureCache::CheckFullHash(TexCacheEntry *const entry, bool &doDelete) { +bool TextureCacheGLES::CheckFullHash(TexCacheEntry *const entry, bool &doDelete) { bool hashFail = false; int w = gstate.getTextureWidth(0); int h = gstate.getTextureHeight(0); @@ -1222,7 +1222,7 @@ bool TextureCache::CheckFullHash(TexCacheEntry *const entry, bool &doDelete) { return true; } -bool TextureCache::HandleTextureChange(TexCacheEntry *const entry, const char *reason, bool initialMatch, bool doDelete) { +bool TextureCacheGLES::HandleTextureChange(TexCacheEntry *const entry, const char *reason, bool initialMatch, bool doDelete) { bool replaceImages = false; cacheSizeEstimate_ -= EstimateTexMemoryUsage(entry); @@ -1261,7 +1261,7 @@ bool TextureCache::HandleTextureChange(TexCacheEntry *const entry, const char *r return replaceImages; } -void TextureCache::BuildTexture(TexCacheEntry *const entry, bool replaceImages) { +void TextureCacheGLES::BuildTexture(TexCacheEntry *const entry, bool replaceImages) { entry->status &= ~TexCacheEntry::STATUS_ALPHA_MASK; // For the estimate, we assume cluts always point to 8888 for simplicity. @@ -1440,7 +1440,7 @@ void TextureCache::BuildTexture(TexCacheEntry *const entry, bool replaceImages) glPixelStorei(GL_PACK_ALIGNMENT, 1); } -u32 TextureCache::AllocTextureName() { +u32 TextureCacheGLES::AllocTextureName() { if (nameCache_.empty()) { nameCache_.resize(TEXCACHE_NAME_CACHE_SIZE); glGenTextures(TEXCACHE_NAME_CACHE_SIZE, &nameCache_[0]); @@ -1450,7 +1450,7 @@ u32 TextureCache::AllocTextureName() { return name; } -GLenum TextureCache::GetDestFormat(GETextureFormat format, GEPaletteFormat clutFormat) const { +GLenum TextureCacheGLES::GetDestFormat(GETextureFormat format, GEPaletteFormat clutFormat) const { switch (format) { case GE_TFMT_CLUT4: case GE_TFMT_CLUT8: @@ -1472,7 +1472,7 @@ GLenum TextureCache::GetDestFormat(GETextureFormat format, GEPaletteFormat clutF } } -void *TextureCache::DecodeTextureLevelOld(GETextureFormat format, GEPaletteFormat clutformat, int level, GLenum dstFmt, int scaleFactor, int *bufwout) { +void *TextureCacheGLES::DecodeTextureLevelOld(GETextureFormat format, GEPaletteFormat clutformat, int level, GLenum dstFmt, int scaleFactor, int *bufwout) { void *finalBuf = nullptr; u32 texaddr = gstate.getTextureAddress(level); int bufw = GetTextureBufw(level, texaddr, format); @@ -1504,7 +1504,7 @@ void *TextureCache::DecodeTextureLevelOld(GETextureFormat format, GEPaletteForma return finalBuf; } -TextureCache::TexCacheEntry::Status TextureCache::CheckAlpha(const u32 *pixelData, GLenum dstFmt, int stride, int w, int h) { +TextureCacheGLES::TexCacheEntry::Status TextureCacheGLES::CheckAlpha(const u32 *pixelData, GLenum dstFmt, int stride, int w, int h) { CheckAlphaResult res; switch (dstFmt) { case GL_UNSIGNED_SHORT_4_4_4_4: @@ -1525,7 +1525,7 @@ TextureCache::TexCacheEntry::Status TextureCache::CheckAlpha(const u32 *pixelDat return (TexCacheEntry::Status)res; } -void TextureCache::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &replaced, int level, bool replaceImages, int scaleFactor, GLenum dstFmt) { +void TextureCacheGLES::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &replaced, int level, bool replaceImages, int scaleFactor, GLenum dstFmt) { int w = gstate.getTextureWidth(level); int h = gstate.getTextureHeight(level); bool useUnpack = false; @@ -1639,7 +1639,7 @@ void TextureCache::LoadTextureLevel(TexCacheEntry &entry, ReplacedTexture &repla } // Only used by Qt UI? -bool TextureCache::DecodeTexture(u8* output, const GPUgstate &state) { +bool TextureCacheGLES::DecodeTexture(u8* output, const GPUgstate &state) { GPUgstate oldState = gstate; gstate = state; diff --git a/GPU/GLES/TextureCache.h b/GPU/GLES/TextureCacheGLES.h similarity index 87% rename from GPU/GLES/TextureCache.h rename to GPU/GLES/TextureCacheGLES.h index 9d89ea4ac357..5d9987d2ebef 100644 --- a/GPU/GLES/TextureCache.h +++ b/GPU/GLES/TextureCacheGLES.h @@ -25,13 +25,13 @@ #include "GPU/GPUInterface.h" #include "GPU/GPUState.h" #include "GPU/GLES/FBO.h" -#include "GPU/GLES/TextureScaler.h" +#include "GPU/GLES/TextureScalerGLES.h" #include "GPU/Common/TextureCacheCommon.h" struct VirtualFramebuffer; -class FramebufferManager; -class DepalShaderCache; -class ShaderManager; +class FramebufferManagerGLES; +class DepalShaderCacheGLES; +class ShaderManagerGLES; class DrawEngineGLES; inline bool UseBGRA8888() { @@ -42,10 +42,10 @@ inline bool UseBGRA8888() { return false; } -class TextureCache : public TextureCacheCommon { +class TextureCacheGLES : public TextureCacheCommon { public: - TextureCache(); - ~TextureCache(); + TextureCacheGLES(); + ~TextureCacheGLES(); void SetTexture(bool force = false); virtual bool SetOffsetTexture(u32 offset) override; @@ -56,13 +56,13 @@ class TextureCache : public TextureCacheCommon { void InvalidateAll(GPUInvalidationType type) override; void ClearNextFrame(); - void SetFramebufferManager(FramebufferManager *fbManager) { + void SetFramebufferManager(FramebufferManagerGLES *fbManager) { framebufferManager_ = fbManager; } - void SetDepalShaderCache(DepalShaderCache *dpCache) { + void SetDepalShaderCache(DepalShaderCacheGLES *dpCache) { depalShaderCache_ = dpCache; } - void SetShaderManager(ShaderManager *sm) { + void SetShaderManager(ShaderManagerGLES *sm) { shaderManager_ = sm; } void SetTransformDrawEngine(DrawEngineGLES *td) { @@ -115,7 +115,7 @@ class TextureCache : public TextureCacheCommon { bool clearCacheNextFrame_; bool lowMemoryMode_; - TextureScalerGL scaler; + TextureScalerGLES scaler; u32 clutHash_; @@ -126,9 +126,9 @@ class TextureCache : public TextureCacheCommon { int texelsScaledThisFrame_; int timesInvalidatedAllThisFrame_; - FramebufferManager *framebufferManager_; - DepalShaderCache *depalShaderCache_; - ShaderManager *shaderManager_; + FramebufferManagerGLES *framebufferManager_; + DepalShaderCacheGLES *depalShaderCache_; + ShaderManagerGLES *shaderManager_; DrawEngineGLES *transformDraw_; const char *nextChangeReason_; diff --git a/GPU/GLES/TextureScaler.cpp b/GPU/GLES/TextureScalerGLES.cpp similarity index 89% rename from GPU/GLES/TextureScaler.cpp rename to GPU/GLES/TextureScalerGLES.cpp index 65e148434832..d73c2ce9440c 100644 --- a/GPU/GLES/TextureScaler.cpp +++ b/GPU/GLES/TextureScalerGLES.cpp @@ -24,20 +24,20 @@ #include "gfx/gl_common.h" #include "GPU/Common/TextureScalerCommon.h" -#include "GPU/GLES/TextureScaler.h" +#include "GPU/GLES/TextureScalerGLES.h" #include "Common/ColorConv.h" #include "Common/Log.h" #include "Common/ThreadPools.h" -int TextureScalerGL::BytesPerPixel(u32 format) { +int TextureScalerGLES::BytesPerPixel(u32 format) { return (format == GL_UNSIGNED_BYTE) ? 4 : 2; } -u32 TextureScalerGL::Get8888Format() { +u32 TextureScalerGLES::Get8888Format() { return GL_UNSIGNED_BYTE; } -void TextureScalerGL::ConvertTo8888(u32 format, u32* source, u32* &dest, int width, int height) { +void TextureScalerGLES::ConvertTo8888(u32 format, u32* source, u32* &dest, int width, int height) { switch(format) { case GL_UNSIGNED_BYTE: dest = source; // already fine diff --git a/GPU/GLES/TextureScaler.h b/GPU/GLES/TextureScalerGLES.h similarity index 94% rename from GPU/GLES/TextureScaler.h rename to GPU/GLES/TextureScalerGLES.h index 7b5adcb2cfe1..bf82d8599de5 100644 --- a/GPU/GLES/TextureScaler.h +++ b/GPU/GLES/TextureScalerGLES.h @@ -20,7 +20,7 @@ #include "Common/CommonTypes.h" #include "GPU/Common/TextureScalerCommon.h" -class TextureScalerGL : public TextureScaler { +class TextureScalerGLES : public TextureScalerCommon { void ConvertTo8888(u32 format, u32* source, u32* &dest, int width, int height) override; int BytesPerPixel(u32 format) override; u32 Get8888Format() override; diff --git a/GPU/GLES/VertexShaderGenerator.cpp b/GPU/GLES/VertexShaderGeneratorGLES.cpp similarity index 99% rename from GPU/GLES/VertexShaderGenerator.cpp rename to GPU/GLES/VertexShaderGeneratorGLES.cpp index 159c3946e286..e23787fd75d0 100644 --- a/GPU/GLES/VertexShaderGenerator.cpp +++ b/GPU/GLES/VertexShaderGeneratorGLES.cpp @@ -29,8 +29,8 @@ #include "GPU/ge_constants.h" #include "GPU/GPUState.h" #include "Core/Config.h" -#include "GPU/GLES/VertexShaderGenerator.h" -#include "GPU/GLES/ShaderManager.h" +#include "GPU/GLES/VertexShaderGeneratorGLES.h" +#include "GPU/GLES/ShaderManagerGLES.h" #include "GPU/Common/ShaderId.h" #include "GPU/Common/VertexDecoderCommon.h" diff --git a/GPU/GLES/VertexShaderGenerator.h b/GPU/GLES/VertexShaderGeneratorGLES.h similarity index 100% rename from GPU/GLES/VertexShaderGenerator.h rename to GPU/GLES/VertexShaderGeneratorGLES.h diff --git a/GPU/GPU.vcxproj b/GPU/GPU.vcxproj index 0da54d12817c..a3f5fed3ecf8 100644 --- a/GPU/GPU.vcxproj +++ b/GPU/GPU.vcxproj @@ -219,19 +219,19 @@ - + - - - + + + - - - - + + + + - + @@ -309,20 +309,20 @@ - + - - - + + + - - - - - + + + + + - + @@ -355,4 +355,4 @@ - + \ No newline at end of file diff --git a/GPU/GPU.vcxproj.filters b/GPU/GPU.vcxproj.filters index 9818d21e9299..71c542d222f7 100644 --- a/GPU/GPU.vcxproj.filters +++ b/GPU/GPU.vcxproj.filters @@ -63,30 +63,9 @@ Common - - GLES - - - GLES - - - GLES - - - GLES - GLES - - GLES - - - GLES - - - GLES - DirectX9 @@ -159,12 +138,6 @@ Common - - GLES - - - GLES - Common @@ -240,6 +213,33 @@ Vulkan + + GLES + + + GLES + + + GLES + + + GLES + + + GLES + + + GLES + + + GLES + + + GLES + + + GLES + @@ -272,27 +272,9 @@ Common - - GLES - GLES - - GLES - - - GLES - - - GLES - - - GLES - - - GLES - DirectX9 @@ -320,9 +302,6 @@ DirectX9 - - GLES - Common @@ -362,15 +341,6 @@ Common - - GLES - - - GLES - - - GLES - Common @@ -461,5 +431,35 @@ Vulkan + + GLES + + + GLES + + + GLES + + + GLES + + + GLES + + + GLES + + + GLES + + + GLES + + + GLES + + + GLES + - + \ No newline at end of file diff --git a/GPU/GPUState.cpp b/GPU/GPUState.cpp index ce0606d5500a..f63eac714c52 100644 --- a/GPU/GPUState.cpp +++ b/GPU/GPUState.cpp @@ -17,7 +17,7 @@ #include "GPU/ge_constants.h" #include "GPU/GPUState.h" -#include "GPU/GLES/ShaderManager.h" +#include "GPU/GLES/ShaderManagerGLES.h" #include "Common/ChunkFile.h" #include "Core/CoreParameter.h" diff --git a/GPU/Null/NullGpu.h b/GPU/Null/NullGpu.h index b3e5504735a6..7e00213f98c9 100644 --- a/GPU/Null/NullGpu.h +++ b/GPU/Null/NullGpu.h @@ -20,7 +20,7 @@ #include "GPU/GPUState.h" #include "GPU/GPUCommon.h" -class ShaderManager; +class ShaderManagerGLES; class NullGPU : public GPUCommon { public: diff --git a/GPU/Software/SoftGpu.h b/GPU/Software/SoftGpu.h index ceb9771694b5..5f8dc04d29d2 100644 --- a/GPU/Software/SoftGpu.h +++ b/GPU/Software/SoftGpu.h @@ -45,7 +45,7 @@ typedef struct { } } FormatBuffer; -class ShaderManager; +class ShaderManagerGLES; class SoftGPU : public GPUCommon { public: diff --git a/GPU/Vulkan/TextureScalerVulkan.h b/GPU/Vulkan/TextureScalerVulkan.h index 6819689c8000..dfa840880668 100644 --- a/GPU/Vulkan/TextureScalerVulkan.h +++ b/GPU/Vulkan/TextureScalerVulkan.h @@ -20,7 +20,7 @@ #include "Common/CommonTypes.h" #include "GPU/Common/TextureScalerCommon.h" -class TextureScalerVulkan : public TextureScaler { +class TextureScalerVulkan : public TextureScalerCommon { protected: void ConvertTo8888(u32 format, u32* source, u32* &dest, int width, int height) override; int BytesPerPixel(u32 format) override; diff --git a/UI/DisplayLayoutScreen.cpp b/UI/DisplayLayoutScreen.cpp index 689e5092a00f..014df89e600b 100644 --- a/UI/DisplayLayoutScreen.cpp +++ b/UI/DisplayLayoutScreen.cpp @@ -28,7 +28,7 @@ #include "Core/Config.h" #include "Core/System.h" #include "DisplayLayoutEditor.h" -#include "GPU/GLES/Framebuffer.h" +#include "GPU/GLES/FramebufferManagerGLES.h" static const int leftColumnWidth = 200; static const float orgRatio = 1.764706f; diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 8d950d33a264..3927d817691d 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -45,7 +45,7 @@ #include "GPU/GPUState.h" #include "GPU/GPUInterface.h" #include "GPU/GLES/FBO.h" -#include "GPU/GLES/Framebuffer.h" +#include "GPU/GLES/FramebufferManagerGLES.h" #include "Core/HLE/sceCtrl.h" #include "Core/HLE/sceDisplay.h" #include "Core/HLE/sceSas.h" diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index c1f681f61c5c..2c920162a6b8 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -50,7 +50,7 @@ #include "Core/Reporting.h" #include "android/jni/TestRunner.h" #include "GPU/GPUInterface.h" -#include "GPU/GLES/Framebuffer.h" +#include "GPU/GLES/FramebufferManagerGLES.h" #if defined(_WIN32) #pragma warning(disable:4091) // workaround bug in VS2015 headers diff --git a/Windows/MainWindowMenu.cpp b/Windows/MainWindowMenu.cpp index d24404c1c550..0cf34fdb39d7 100644 --- a/Windows/MainWindowMenu.cpp +++ b/Windows/MainWindowMenu.cpp @@ -14,11 +14,11 @@ #include "Common/Log.h" #include "Common/LogManager.h" #include "Common/ConsoleListener.h" -#include "GPU/GLES/TextureScaler.h" -#include "GPU/GLES/TextureCache.h" +#include "GPU/GLES/TextureScalerGLES.h" +#include "GPU/GLES/TextureCacheGLES.h" #include "UI/OnScreenDisplay.h" #include "GPU/Common/PostShader.h" -#include "GPU/GLES/Framebuffer.h" +#include "GPU/GLES/FramebufferManagerGLES.h" #include "Core/Config.h" #include "Core/FileSystems/MetaFileSystem.h" #include "UI/OnScreenDisplay.h" @@ -698,10 +698,10 @@ namespace MainWindow { case ID_TEXTURESCALING_4X: setTexScalingMultiplier(TEXSCALING_4X); break; case ID_TEXTURESCALING_5X: setTexScalingMultiplier(TEXSCALING_MAX); break; - case ID_TEXTURESCALING_XBRZ: setTexScalingType(TextureScaler::XBRZ); break; - case ID_TEXTURESCALING_HYBRID: setTexScalingType(TextureScaler::HYBRID); break; - case ID_TEXTURESCALING_BICUBIC: setTexScalingType(TextureScaler::BICUBIC); break; - case ID_TEXTURESCALING_HYBRID_BICUBIC: setTexScalingType(TextureScaler::HYBRID_BICUBIC); break; + case ID_TEXTURESCALING_XBRZ: setTexScalingType(TextureScalerCommon::XBRZ); break; + case ID_TEXTURESCALING_HYBRID: setTexScalingType(TextureScalerCommon::HYBRID); break; + case ID_TEXTURESCALING_BICUBIC: setTexScalingType(TextureScalerCommon::BICUBIC); break; + case ID_TEXTURESCALING_HYBRID_BICUBIC: setTexScalingType(TextureScalerCommon::HYBRID_BICUBIC); break; case ID_TEXTURESCALING_DEPOSTERIZE: g_Config.bTexDeposterize = !g_Config.bTexDeposterize; @@ -1092,11 +1092,11 @@ namespace MainWindow { ID_TEXTURESCALING_BICUBIC, ID_TEXTURESCALING_HYBRID_BICUBIC, }; - if (g_Config.iTexScalingType < TextureScaler::XBRZ) - g_Config.iTexScalingType = TextureScaler::XBRZ; + if (g_Config.iTexScalingType < TextureScalerCommon::XBRZ) + g_Config.iTexScalingType = TextureScalerCommon::XBRZ; - else if (g_Config.iTexScalingType > TextureScaler::HYBRID_BICUBIC) - g_Config.iTexScalingType = TextureScaler::HYBRID_BICUBIC; + else if (g_Config.iTexScalingType > TextureScalerCommon::HYBRID_BICUBIC) + g_Config.iTexScalingType = TextureScalerCommon::HYBRID_BICUBIC; for (int i = 0; i < ARRAY_SIZE(texscalingtypeitems); i++) { CheckMenuItem(menu, texscalingtypeitems[i], MF_BYCOMMAND | ((i == g_Config.iTexScalingType) ? MF_CHECKED : MF_UNCHECKED)); diff --git a/android/jni/Android.mk b/android/jni/Android.mk index 6599693f0754..e5deb90be6c7 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -223,20 +223,20 @@ EXEC_AND_LIB_FILES := \ $(SRC)/GPU/Common/PostShader.cpp \ $(SRC)/GPU/Debugger/Breakpoints.cpp \ $(SRC)/GPU/Debugger/Stepping.cpp \ - $(SRC)/GPU/GLES/Framebuffer.cpp \ - $(SRC)/GPU/GLES/DepalettizeShader.cpp \ + $(SRC)/GPU/GLES/FramebufferManagerGLES.cpp \ + $(SRC)/GPU/GLES/DepalettizeShaderGLES.cpp \ $(SRC)/GPU/GLES/GPU_GLES.cpp.arm \ $(SRC)/GPU/GLES/GLStateCache.cpp.arm \ $(SRC)/GPU/GLES/FBO.cpp \ - $(SRC)/GPU/GLES/StencilBuffer.cpp.arm \ - $(SRC)/GPU/GLES/TextureCache.cpp.arm \ + $(SRC)/GPU/GLES/StencilBufferGLES.cpp.arm \ + $(SRC)/GPU/GLES/TextureCacheGLES.cpp.arm \ $(SRC)/GPU/GLES/DrawEngineGLES.cpp.arm \ - $(SRC)/GPU/GLES/StateMapping.cpp.arm \ - $(SRC)/GPU/GLES/ShaderManager.cpp.arm \ - $(SRC)/GPU/GLES/VertexShaderGenerator.cpp.arm \ - $(SRC)/GPU/GLES/FragmentShaderGenerator.cpp.arm \ - $(SRC)/GPU/GLES/FragmentTestCache.cpp.arm \ - $(SRC)/GPU/GLES/TextureScaler.cpp \ + $(SRC)/GPU/GLES/StateMappingGLES.cpp.arm \ + $(SRC)/GPU/GLES/ShaderManagerGLES.cpp.arm \ + $(SRC)/GPU/GLES/VertexShaderGeneratorGLES.cpp.arm \ + $(SRC)/GPU/GLES/FragmentShaderGeneratorGLES.cpp.arm \ + $(SRC)/GPU/GLES/FragmentTestCacheGLES.cpp.arm \ + $(SRC)/GPU/GLES/TextureScalerGLES.cpp \ $(SRC)/GPU/Null/NullGpu.cpp \ $(SRC)/GPU/Software/Clipper.cpp \ $(SRC)/GPU/Software/Lighting.cpp \ From e1cc13fd84dcf741355a8544901d810000a70771 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Sun, 22 Jan 2017 07:28:44 +0100 Subject: [PATCH 2/2] Buildfix --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 99e541edce8d..f6e1e3b56fb6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1070,8 +1070,8 @@ set(GPU_GLES GPU/GLES/FragmentShaderGeneratorGLES.h GPU/GLES/FragmentTestCacheGLES.cpp GPU/GLES/FragmentTestCacheGLES.h - GPU/GLES/FramebufferGLES.cpp - GPU/GLES/FramebufferGLES.h + GPU/GLES/FramebufferManagerGLES.cpp + GPU/GLES/FramebufferManagerGLES.h GPU/GLES/ShaderManagerGLES.cpp GPU/GLES/ShaderManagerGLES.h GPU/GLES/StateMappingGLES.cpp