Rename GLES files to match the convention the other backends use.

This commit is contained in:
Henrik Rydgard 2017-01-21 22:16:30 +01:00
parent ce2feb2a67
commit d9acd27126
40 changed files with 357 additions and 357 deletions

View File

@ -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

View File

@ -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"

View File

@ -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);

View File

@ -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);

View File

@ -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.

View File

@ -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;

View File

@ -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);

View File

@ -36,10 +36,10 @@ public:
};
// 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);

View File

@ -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] = {

View File

@ -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 @@ public:
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 @@ private:
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];

View File

@ -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"

View File

@ -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) {

View File

@ -20,7 +20,7 @@
#include <map>
#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 @@ private:
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<FragmentTestID, FragmentTestTexture> cache_;
u8 *scratchpad_;

View File

@ -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<FramebufferInfo> FramebufferManager::GetFramebufferList() {
std::vector<FramebufferInfo> FramebufferManagerGLES::GetFramebufferList() {
std::vector<FramebufferInfo> list;
for (size_t i = 0; i < vfbs_.size(); ++i) {
@ -1879,7 +1879,7 @@ std::vector<FramebufferInfo> 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);

View File

@ -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 @@ private:
int pixelDeltaLoc_;
int deltaLoc_;
TextureCache *textureCache_;
ShaderManager *shaderManager_;
TextureCacheGLES *textureCache_;
ShaderManagerGLES *shaderManager_;
DrawEngineGLES *transformDraw_;
// Used by post-processing shader

View File

@ -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<GPUDebugVertex> &vertices, std::vector<u16> &indices) {

View File

@ -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 @@ private:
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_;

View File

@ -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<std::string> ShaderManager::DebugGetShaderIDs(DebugShaderType type) {
std::vector<std::string> ShaderManagerGLES::DebugGetShaderIDs(DebugShaderType type) {
std::string id;
std::vector<std::string> ids;
switch (type) {
@ -961,7 +961,7 @@ std::vector<std::string> 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;
}

View File

@ -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 @@ private:
bool isFragment_;
};
class ShaderManager {
class ShaderManagerGLES {
public:
ShaderManager();
~ShaderManager();
ShaderManagerGLES();
~ShaderManagerGLES();
void ClearCache(bool deleteThem); // TODO: deleteThem currently not respected

View File

@ -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,

View File

@ -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;
}

View File

@ -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 @@ protected:
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;

View File

@ -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 @@ public:
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 @@ private:
bool clearCacheNextFrame_;
bool lowMemoryMode_;
TextureScalerGL scaler;
TextureScalerGLES scaler;
u32 clutHash_;
@ -126,9 +126,9 @@ private:
int texelsScaledThisFrame_;
int timesInvalidatedAllThisFrame_;
FramebufferManager *framebufferManager_;
DepalShaderCache *depalShaderCache_;
ShaderManager *shaderManager_;
FramebufferManagerGLES *framebufferManager_;
DepalShaderCacheGLES *depalShaderCache_;
ShaderManagerGLES *shaderManager_;
DrawEngineGLES *transformDraw_;
const char *nextChangeReason_;

View File

@ -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

View File

@ -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;

View File

@ -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"

View File

@ -219,19 +219,19 @@
<ClInclude Include="Directx9\VertexShaderGeneratorDX9.h" />
<ClInclude Include="ge_constants.h" />
<ClInclude Include="GeDisasm.h" />
<ClInclude Include="GLES\DepalettizeShader.h" />
<ClInclude Include="GLES\DepalettizeShaderGLES.h" />
<ClInclude Include="GLES\FBO.h" />
<ClInclude Include="GLES\FragmentShaderGenerator.h" />
<ClInclude Include="GLES\FragmentTestCache.h" />
<ClInclude Include="GLES\Framebuffer.h" />
<ClInclude Include="GLES\FragmentShaderGeneratorGLES.h" />
<ClInclude Include="GLES\FragmentTestCacheGLES.h" />
<ClInclude Include="GLES\FramebufferManagerGLES.h" />
<ClInclude Include="GLES\GPU_GLES.h" />
<ClInclude Include="GLES\GLStateCache.h" />
<ClInclude Include="GLES\ShaderManager.h" />
<ClInclude Include="GLES\StateMapping.h" />
<ClInclude Include="GLES\TextureCache.h" />
<ClInclude Include="GLES\TextureScaler.h" />
<ClInclude Include="GLES\ShaderManagerGLES.h" />
<ClInclude Include="GLES\StateMappingGLES.h" />
<ClInclude Include="GLES\TextureCacheGLES.h" />
<ClInclude Include="GLES\TextureScalerGLES.h" />
<ClInclude Include="GLES\DrawEngineGLES.h" />
<ClInclude Include="GLES\VertexShaderGenerator.h" />
<ClInclude Include="GLES\VertexShaderGeneratorGLES.h" />
<ClInclude Include="GPU.h" />
<ClInclude Include="GPUCommon.h" />
<ClInclude Include="GPUInterface.h" />
@ -309,20 +309,20 @@
<ClCompile Include="Directx9\DrawEngineDX9.cpp" />
<ClCompile Include="Directx9\VertexShaderGeneratorDX9.cpp" />
<ClCompile Include="GeDisasm.cpp" />
<ClCompile Include="GLES\DepalettizeShader.cpp" />
<ClCompile Include="GLES\DepalettizeShaderGLES.cpp" />
<ClCompile Include="GLES\FBO.cpp" />
<ClCompile Include="GLES\FragmentShaderGenerator.cpp" />
<ClCompile Include="GLES\FragmentTestCache.cpp" />
<ClCompile Include="GLES\Framebuffer.cpp" />
<ClCompile Include="GLES\FragmentShaderGeneratorGLES.cpp" />
<ClCompile Include="GLES\FragmentTestCacheGLES.cpp" />
<ClCompile Include="GLES\FramebufferManagerGLES.cpp" />
<ClCompile Include="GLES\GPU_GLES.cpp" />
<ClCompile Include="GLES\GLStateCache.cpp" />
<ClCompile Include="GLES\ShaderManager.cpp" />
<ClCompile Include="GLES\StateMapping.cpp" />
<ClCompile Include="GLES\StencilBuffer.cpp" />
<ClCompile Include="GLES\TextureCache.cpp" />
<ClCompile Include="GLES\TextureScaler.cpp" />
<ClCompile Include="GLES\ShaderManagerGLES.cpp" />
<ClCompile Include="GLES\StateMappingGLES.cpp" />
<ClCompile Include="GLES\StencilBufferGLES.cpp" />
<ClCompile Include="GLES\TextureCacheGLES.cpp" />
<ClCompile Include="GLES\TextureScalerGLES.cpp" />
<ClCompile Include="GLES\DrawEngineGLES.cpp" />
<ClCompile Include="GLES\VertexShaderGenerator.cpp" />
<ClCompile Include="GLES\VertexShaderGeneratorGLES.cpp" />
<ClCompile Include="GPU.cpp" />
<ClCompile Include="GPUCommon.cpp" />
<ClCompile Include="GPUState.cpp" />
@ -355,4 +355,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@ -63,30 +63,9 @@
<ClInclude Include="Common\VertexDecoderCommon.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="GLES\VertexShaderGenerator.h">
<Filter>GLES</Filter>
</ClInclude>
<ClInclude Include="GLES\StateMapping.h">
<Filter>GLES</Filter>
</ClInclude>
<ClInclude Include="GLES\TextureCache.h">
<Filter>GLES</Filter>
</ClInclude>
<ClInclude Include="GLES\TextureScaler.h">
<Filter>GLES</Filter>
</ClInclude>
<ClInclude Include="GLES\DrawEngineGLES.h">
<Filter>GLES</Filter>
</ClInclude>
<ClInclude Include="GLES\FragmentShaderGenerator.h">
<Filter>GLES</Filter>
</ClInclude>
<ClInclude Include="GLES\Framebuffer.h">
<Filter>GLES</Filter>
</ClInclude>
<ClInclude Include="GLES\ShaderManager.h">
<Filter>GLES</Filter>
</ClInclude>
<ClInclude Include="Directx9\GPU_DX9.h">
<Filter>DirectX9</Filter>
</ClInclude>
@ -159,12 +138,6 @@
<ClInclude Include="Common\TransformCommon.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="GLES\DepalettizeShader.h">
<Filter>GLES</Filter>
</ClInclude>
<ClInclude Include="GLES\FragmentTestCache.h">
<Filter>GLES</Filter>
</ClInclude>
<ClInclude Include="Common\FramebufferCommon.h">
<Filter>Common</Filter>
</ClInclude>
@ -240,6 +213,33 @@
<ClInclude Include="Vulkan\VulkanUtil.h">
<Filter>Vulkan</Filter>
</ClInclude>
<ClInclude Include="GLES\TextureCacheGLES.h">
<Filter>GLES</Filter>
</ClInclude>
<ClInclude Include="GLES\ShaderManagerGLES.h">
<Filter>GLES</Filter>
</ClInclude>
<ClInclude Include="GLES\StateMappingGLES.h">
<Filter>GLES</Filter>
</ClInclude>
<ClInclude Include="GLES\TextureScalerGLES.h">
<Filter>GLES</Filter>
</ClInclude>
<ClInclude Include="GLES\FragmentShaderGeneratorGLES.h">
<Filter>GLES</Filter>
</ClInclude>
<ClInclude Include="GLES\DepalettizeShaderGLES.h">
<Filter>GLES</Filter>
</ClInclude>
<ClInclude Include="GLES\VertexShaderGeneratorGLES.h">
<Filter>GLES</Filter>
</ClInclude>
<ClInclude Include="GLES\FramebufferManagerGLES.h">
<Filter>GLES</Filter>
</ClInclude>
<ClInclude Include="GLES\FragmentTestCacheGLES.h">
<Filter>GLES</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Math3D.cpp">
@ -272,27 +272,9 @@
<ClCompile Include="Common\VertexDecoderCommon.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="GLES\TextureCache.cpp">
<Filter>GLES</Filter>
</ClCompile>
<ClCompile Include="GLES\DrawEngineGLES.cpp">
<Filter>GLES</Filter>
</ClCompile>
<ClCompile Include="GLES\VertexShaderGenerator.cpp">
<Filter>GLES</Filter>
</ClCompile>
<ClCompile Include="GLES\StateMapping.cpp">
<Filter>GLES</Filter>
</ClCompile>
<ClCompile Include="GLES\FragmentShaderGenerator.cpp">
<Filter>GLES</Filter>
</ClCompile>
<ClCompile Include="GLES\Framebuffer.cpp">
<Filter>GLES</Filter>
</ClCompile>
<ClCompile Include="GLES\ShaderManager.cpp">
<Filter>GLES</Filter>
</ClCompile>
<ClCompile Include="Directx9\GPU_DX9.cpp">
<Filter>DirectX9</Filter>
</ClCompile>
@ -320,9 +302,6 @@
<ClCompile Include="Directx9\TextureScalerDX9.cpp">
<Filter>DirectX9</Filter>
</ClCompile>
<ClCompile Include="GLES\TextureScaler.cpp">
<Filter>GLES</Filter>
</ClCompile>
<ClCompile Include="Common\IndexGenerator.cpp">
<Filter>Common</Filter>
</ClCompile>
@ -362,15 +341,6 @@
<ClCompile Include="Common\TransformCommon.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="GLES\DepalettizeShader.cpp">
<Filter>GLES</Filter>
</ClCompile>
<ClCompile Include="GLES\StencilBuffer.cpp">
<Filter>GLES</Filter>
</ClCompile>
<ClCompile Include="GLES\FragmentTestCache.cpp">
<Filter>GLES</Filter>
</ClCompile>
<ClCompile Include="Common\FramebufferCommon.cpp">
<Filter>Common</Filter>
</ClCompile>
@ -461,5 +431,35 @@
<ClCompile Include="Vulkan\VulkanUtil.cpp">
<Filter>Vulkan</Filter>
</ClCompile>
<ClCompile Include="GLES\TextureCacheGLES.cpp">
<Filter>GLES</Filter>
</ClCompile>
<ClCompile Include="GLES\ShaderManagerGLES.cpp">
<Filter>GLES</Filter>
</ClCompile>
<ClCompile Include="GLES\StateMappingGLES.cpp">
<Filter>GLES</Filter>
</ClCompile>
<ClCompile Include="GLES\TextureScalerGLES.cpp">
<Filter>GLES</Filter>
</ClCompile>
<ClCompile Include="GLES\StencilBufferGLES.cpp">
<Filter>GLES</Filter>
</ClCompile>
<ClCompile Include="GLES\FragmentShaderGeneratorGLES.cpp">
<Filter>GLES</Filter>
</ClCompile>
<ClCompile Include="GLES\DepalettizeShaderGLES.cpp">
<Filter>GLES</Filter>
</ClCompile>
<ClCompile Include="GLES\VertexShaderGeneratorGLES.cpp">
<Filter>GLES</Filter>
</ClCompile>
<ClCompile Include="GLES\FramebufferManagerGLES.cpp">
<Filter>GLES</Filter>
</ClCompile>
<ClCompile Include="GLES\FragmentTestCacheGLES.cpp">
<Filter>GLES</Filter>
</ClCompile>
</ItemGroup>
</Project>
</Project>

View File

@ -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"

View File

@ -20,7 +20,7 @@
#include "GPU/GPUState.h"
#include "GPU/GPUCommon.h"
class ShaderManager;
class ShaderManagerGLES;
class NullGPU : public GPUCommon {
public:

View File

@ -45,7 +45,7 @@ typedef struct {
}
} FormatBuffer;
class ShaderManager;
class ShaderManagerGLES;
class SoftGPU : public GPUCommon {
public:

View File

@ -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;

View File

@ -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;

View File

@ -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"

View File

@ -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

View File

@ -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));

View File

@ -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 \