2012-11-01 16:19:01 +01:00
|
|
|
// Copyright (c) 2012- PPSSPP Project.
|
|
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
2012-11-04 23:01:49 +01:00
|
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
2012-11-01 16:19:01 +01:00
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
|
|
// Official git repository and contact information can be found at
|
|
|
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2020-09-13 23:34:00 +02:00
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
2012-11-19 21:23:29 +01:00
|
|
|
|
2021-05-06 01:31:38 +02:00
|
|
|
#include "Common/File/Path.h"
|
|
|
|
|
|
2023-02-25 14:24:59 +01:00
|
|
|
#include "GPU/GPUCommonHW.h"
|
2022-08-22 12:20:21 +02:00
|
|
|
#include "GPU/Common/TextureShaderCommon.h"
|
2017-01-21 22:16:30 +01:00
|
|
|
#include "GPU/GLES/FramebufferManagerGLES.h"
|
2016-04-10 10:27:28 +02:00
|
|
|
#include "GPU/GLES/DrawEngineGLES.h"
|
2017-01-21 22:16:30 +01:00
|
|
|
#include "GPU/GLES/FragmentTestCacheGLES.h"
|
2013-08-20 22:34:47 +02:00
|
|
|
|
2017-01-21 22:16:30 +01:00
|
|
|
class ShaderManagerGLES;
|
2020-09-13 23:34:00 +02:00
|
|
|
class TextureCacheGLES;
|
2012-12-21 16:49:42 +01:00
|
|
|
class LinkedShader;
|
2012-11-01 16:19:01 +01:00
|
|
|
|
2023-02-25 14:24:59 +01:00
|
|
|
class GPU_GLES : public GPUCommonHW {
|
2012-11-01 16:19:01 +01:00
|
|
|
public:
|
2017-01-30 16:50:35 +01:00
|
|
|
GPU_GLES(GraphicsContext *gfxCtx, Draw::DrawContext *draw);
|
2016-04-10 10:21:48 +02:00
|
|
|
~GPU_GLES();
|
2015-09-05 19:58:47 +02:00
|
|
|
|
2015-09-05 21:23:58 +02:00
|
|
|
// This gets called on startup and when we get back from settings.
|
2022-09-20 10:02:15 +02:00
|
|
|
u32 CheckGPUFeatures() const override;
|
2015-09-05 19:58:47 +02:00
|
|
|
|
2017-12-03 11:30:00 -08:00
|
|
|
bool IsReady() override;
|
2018-10-30 20:32:12 -07:00
|
|
|
void CancelReady() override;
|
2017-12-03 11:30:00 -08:00
|
|
|
|
2016-03-31 10:17:02 +02:00
|
|
|
void GetStats(char *buffer, size_t bufsize) override;
|
2016-12-21 18:33:08 +01:00
|
|
|
|
2015-07-25 14:22:43 +02:00
|
|
|
void DeviceLost() override; // Only happens on Android. Drop all textures and shaders.
|
2023-02-25 23:04:27 +01:00
|
|
|
void DeviceRestore(Draw::DrawContext *draw) override;
|
2012-11-19 21:23:29 +01:00
|
|
|
|
2017-03-17 10:48:43 +01:00
|
|
|
void BeginHostFrame() override;
|
2017-11-19 12:25:57 +01:00
|
|
|
void EndHostFrame() override;
|
2017-03-17 10:48:43 +01:00
|
|
|
|
2013-04-28 14:23:30 -07:00
|
|
|
protected:
|
2015-03-14 18:11:00 -07:00
|
|
|
void FinishDeferred() override;
|
2013-04-28 14:23:30 -07:00
|
|
|
|
2012-11-06 17:05:27 +01:00
|
|
|
private:
|
2022-11-20 12:57:32 +01:00
|
|
|
void BuildReportingInfo() override;
|
2016-12-21 19:58:10 +01:00
|
|
|
|
2017-11-05 20:33:28 +01:00
|
|
|
void BeginFrame() override;
|
2016-12-21 19:58:10 +01:00
|
|
|
|
2017-01-21 22:16:30 +01:00
|
|
|
FramebufferManagerGLES *framebufferManagerGL_;
|
|
|
|
|
TextureCacheGLES *textureCacheGL_;
|
2016-04-10 10:21:48 +02:00
|
|
|
DrawEngineGLES drawEngine_;
|
2017-01-21 22:16:30 +01:00
|
|
|
FragmentTestCacheGLES fragmentTestCache_;
|
2017-01-23 20:48:23 +01:00
|
|
|
ShaderManagerGLES *shaderManagerGL_;
|
2013-01-30 20:40:26 +01:00
|
|
|
|
2021-05-06 01:31:38 +02:00
|
|
|
Path shaderCachePath_;
|
2012-11-01 16:19:01 +01:00
|
|
|
};
|