Skip to content

Commit

Permalink
Merge pull request #9225 from hrydgard/rename-gles-files
Browse files Browse the repository at this point in the history
Rename GLES files to match the convention the other backends use.
  • Loading branch information
hrydgard committed Jan 23, 2017
2 parents ce2feb2 + e1cc13f commit 9400238
Show file tree
Hide file tree
Showing 40 changed files with 357 additions and 357 deletions.
38 changes: 19 additions & 19 deletions CMakeLists.txt
Expand Up @@ -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/FramebufferManagerGLES.cpp
GPU/GLES/FramebufferManagerGLES.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
Expand Down
2 changes: 1 addition & 1 deletion Core/Reporting.cpp
Expand Up @@ -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"
Expand Down
24 changes: 12 additions & 12 deletions GPU/Common/TextureScalerCommon.cpp
Expand Up @@ -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)) {
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)) {
Expand All @@ -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
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions GPU/Common/TextureScalerCommon.h
Expand Up @@ -22,10 +22,10 @@

#include <vector>

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);
Expand Down
16 changes: 8 additions & 8 deletions GPU/Directx9/GPU_DX9.cpp
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion GPU/Directx9/TextureScalerDX9.h
Expand Up @@ -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;
Expand Down
Expand Up @@ -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"

Expand Down Expand Up @@ -90,19 +90,19 @@ 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);

vertexShaderFailed_ = false;
vertexShader_ = 0;
}

DepalShaderCache::~DepalShaderCache() {
DepalShaderCacheGLES::~DepalShaderCacheGLES() {
Clear();
}

bool DepalShaderCache::CreateVertexShader() {
bool DepalShaderCacheGLES::CreateVertexShader() {
if (vertexShaderFailed_) {
return false;
}
Expand All @@ -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);
Expand Down Expand Up @@ -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) {
Expand All @@ -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);
Expand All @@ -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);
Expand Down
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions GPU/GLES/DrawEngineGLES.cpp
Expand Up @@ -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] = {
Expand Down
26 changes: 13 additions & 13 deletions GPU/GLES/DrawEngineGLES.h
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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];
Expand Down
Expand Up @@ -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"

Expand Down
File renamed without changes.

1 comment on commit 9400238

@tausifj15
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sir henrik pls fix tekken frame drop in new builds thus issue is only in tekken pls fix it

Please sign in to comment.