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:58:25 +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/.
|
|
|
|
|
2020-10-04 10:04:01 +02:00
|
|
|
#include "Common/Profiler/Profiler.h"
|
2020-10-01 13:05:04 +02:00
|
|
|
#include "Common/Data/Text/I18n.h"
|
2013-07-27 00:44:16 +02:00
|
|
|
|
2020-08-15 12:25:39 +02:00
|
|
|
#include "Common/Log.h"
|
2020-08-10 00:12:51 -07:00
|
|
|
#include "Common/Serialize/Serializer.h"
|
2020-10-04 20:48:47 +02:00
|
|
|
#include "Common/File/FileUtil.h"
|
2015-12-31 16:59:40 +01:00
|
|
|
#include "Common/GraphicsContext.h"
|
2023-03-25 10:29:18 +01:00
|
|
|
#include "Common/System/System.h"
|
2022-10-17 18:36:54 +02:00
|
|
|
#include "Common/VR/PPSSPPVR.h"
|
2013-12-29 23:28:31 +01:00
|
|
|
|
2015-09-05 21:23:58 +02:00
|
|
|
#include "Core/Config.h"
|
2013-12-14 14:54:05 -08:00
|
|
|
#include "Core/Debugger/Breakpoints.h"
|
2015-04-05 18:03:50 -07:00
|
|
|
#include "Core/MemMapHelpers.h"
|
2013-01-30 21:09:53 +01:00
|
|
|
#include "Core/Config.h"
|
2013-05-10 22:51:23 -07:00
|
|
|
#include "Core/Reporting.h"
|
2013-01-30 21:09:53 +01:00
|
|
|
#include "Core/System.h"
|
2016-01-17 20:29:34 +01:00
|
|
|
#include "Core/ELF/ParamSFO.h"
|
2012-11-01 16:19:01 +01:00
|
|
|
|
2013-08-20 22:34:47 +02:00
|
|
|
#include "GPU/GPUState.h"
|
|
|
|
#include "GPU/ge_constants.h"
|
|
|
|
#include "GPU/GeDisasm.h"
|
2020-08-03 23:17:22 +02:00
|
|
|
#include "GPU/Common/FramebufferManagerCommon.h"
|
2017-01-21 22:16:30 +01:00
|
|
|
#include "GPU/GLES/ShaderManagerGLES.h"
|
2016-04-10 10:27:28 +02:00
|
|
|
#include "GPU/GLES/GPU_GLES.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/TextureCacheGLES.h"
|
2012-11-01 16:19:01 +01:00
|
|
|
|
2015-09-06 13:36:33 +02:00
|
|
|
#ifdef _WIN32
|
2015-11-03 23:22:09 +01:00
|
|
|
#include "Windows/GPU/WindowsGLContext.h"
|
2015-09-06 13:36:33 +02:00
|
|
|
#endif
|
|
|
|
|
2017-01-30 16:50:35 +01:00
|
|
|
GPU_GLES::GPU_GLES(GraphicsContext *gfxCtx, Draw::DrawContext *draw)
|
2023-02-25 14:24:59 +01:00
|
|
|
: GPUCommonHW(gfxCtx, draw), drawEngine_(draw), fragmentTestCache_(draw) {
|
2014-06-15 15:19:49 -07:00
|
|
|
UpdateVsyncInterval(true);
|
2022-12-13 16:53:53 +01:00
|
|
|
gstate_c.SetUseFlags(CheckGPUFeatures());
|
2013-10-09 10:44:12 +02:00
|
|
|
|
2018-05-29 23:07:22 +02:00
|
|
|
shaderManagerGL_ = new ShaderManagerGLES(draw);
|
2022-08-16 21:38:09 +02:00
|
|
|
framebufferManagerGL_ = new FramebufferManagerGLES(draw);
|
2016-12-21 18:07:17 +01:00
|
|
|
framebufferManager_ = framebufferManagerGL_;
|
2022-08-23 11:11:04 +02:00
|
|
|
textureCacheGL_ = new TextureCacheGLES(draw, framebufferManager_->GetDraw2D());
|
2016-12-21 18:07:17 +01:00
|
|
|
textureCache_ = textureCacheGL_;
|
2017-01-23 21:08:16 +01:00
|
|
|
drawEngineCommon_ = &drawEngine_;
|
2017-01-23 20:48:23 +01:00
|
|
|
shaderManager_ = shaderManagerGL_;
|
2017-01-23 21:08:16 +01:00
|
|
|
drawEngineCommon_ = &drawEngine_;
|
2016-12-21 18:07:17 +01:00
|
|
|
|
2017-01-23 20:48:23 +01:00
|
|
|
drawEngine_.SetShaderManager(shaderManagerGL_);
|
2016-12-21 18:07:17 +01:00
|
|
|
drawEngine_.SetTextureCache(textureCacheGL_);
|
|
|
|
drawEngine_.SetFramebufferManager(framebufferManagerGL_);
|
2016-04-10 10:21:48 +02:00
|
|
|
drawEngine_.SetFragmentTestCache(&fragmentTestCache_);
|
2021-05-08 09:10:23 -07:00
|
|
|
drawEngine_.Init();
|
2016-12-21 18:07:17 +01:00
|
|
|
framebufferManagerGL_->SetTextureCache(textureCacheGL_);
|
2017-01-23 20:48:23 +01:00
|
|
|
framebufferManagerGL_->SetShaderManager(shaderManagerGL_);
|
2017-02-04 11:47:19 +01:00
|
|
|
framebufferManagerGL_->SetDrawEngine(&drawEngine_);
|
2022-12-14 15:15:31 +01:00
|
|
|
framebufferManagerGL_->Init(msaaLevel_);
|
2016-12-21 18:07:17 +01:00
|
|
|
textureCacheGL_->SetFramebufferManager(framebufferManagerGL_);
|
2017-01-23 20:48:23 +01:00
|
|
|
textureCacheGL_->SetShaderManager(shaderManagerGL_);
|
2017-02-04 11:47:19 +01:00
|
|
|
textureCacheGL_->SetDrawEngine(&drawEngine_);
|
2016-12-21 18:07:17 +01:00
|
|
|
fragmentTestCache_.SetTextureCache(textureCacheGL_);
|
2013-01-30 20:40:26 +01:00
|
|
|
|
2012-11-22 20:57:41 +01:00
|
|
|
// Sanity check gstate
|
|
|
|
if ((int *)&gstate.transferstart - (int *)&gstate != 0xEA) {
|
|
|
|
ERROR_LOG(G3D, "gstate has drifted out of sync!");
|
|
|
|
}
|
2012-12-21 21:49:09 +01:00
|
|
|
|
2013-10-09 10:44:12 +02:00
|
|
|
// No need to flush before the tex scale/offset commands if we are baking
|
|
|
|
// the tex scale/offset into the vertices anyway.
|
2013-10-09 23:09:16 +02:00
|
|
|
|
2018-04-10 12:22:02 +02:00
|
|
|
UpdateCmdInfo();
|
|
|
|
|
2013-04-28 17:49:17 -07:00
|
|
|
BuildReportingInfo();
|
2014-06-15 15:19:49 -07:00
|
|
|
// Update again after init to be sure of any silly driver problems.
|
|
|
|
UpdateVsyncInterval(true);
|
2014-12-30 15:26:16 -08:00
|
|
|
|
2022-09-07 23:41:00 -07:00
|
|
|
textureCache_->NotifyConfigChanged();
|
2016-01-17 17:11:51 +01:00
|
|
|
|
|
|
|
// Load shader cache.
|
2017-06-02 20:54:28 -07:00
|
|
|
std::string discID = g_paramSFO.GetDiscID();
|
2016-01-17 21:35:24 +01:00
|
|
|
if (discID.size()) {
|
2021-11-21 21:23:15 +01:00
|
|
|
if (g_Config.bShaderCache) {
|
|
|
|
File::CreateFullPath(GetSysDirectory(DIRECTORY_APP_CACHE));
|
|
|
|
shaderCachePath_ = GetSysDirectory(DIRECTORY_APP_CACHE) / (discID + ".glshadercache");
|
|
|
|
// Actually precompiled by IsReady() since we're single-threaded.
|
2022-12-13 22:26:46 -08:00
|
|
|
File::IOFile f(shaderCachePath_, "rb");
|
|
|
|
if (f.IsOpen()) {
|
|
|
|
if (shaderManagerGL_->LoadCacheFlags(f, &drawEngine_)) {
|
|
|
|
if (drawEngineCommon_->EverUsedExactEqualDepth()) {
|
|
|
|
sawExactEqualDepth_ = true;
|
|
|
|
}
|
|
|
|
gstate_c.SetUseFlags(CheckGPUFeatures());
|
|
|
|
// We're compiling now, clear if they changed.
|
|
|
|
gstate_c.useFlagsChanged = false;
|
|
|
|
|
|
|
|
if (shaderManagerGL_->LoadCache(f))
|
|
|
|
NOTICE_LOG(G3D, "Precompiling the shader cache from '%s'", shaderCachePath_.c_str());
|
|
|
|
}
|
|
|
|
}
|
2021-11-21 21:23:15 +01:00
|
|
|
} else {
|
|
|
|
INFO_LOG(G3D, "Shader cache disabled. Not loading.");
|
|
|
|
}
|
2016-01-17 21:35:24 +01:00
|
|
|
}
|
2017-01-31 23:29:13 +09:00
|
|
|
|
|
|
|
if (g_Config.bHardwareTessellation) {
|
|
|
|
// Disable hardware tessellation if device is unsupported.
|
2020-04-04 11:52:32 -07:00
|
|
|
if (!drawEngine_.SupportsHWTessellation()) {
|
2017-01-31 23:29:13 +09:00
|
|
|
ERROR_LOG(G3D, "Hardware Tessellation is unsupported, falling back to software tessellation");
|
2023-04-06 00:34:50 +02:00
|
|
|
auto gr = GetI18NCategory(I18NCat::GRAPHICS);
|
2023-03-25 10:29:18 +01:00
|
|
|
System_NotifyUserMessage(gr->T("Turn off Hardware Tessellation - unsupported"), 2.5f, 0xFF3030FF);
|
2017-01-31 23:29:13 +09:00
|
|
|
}
|
|
|
|
}
|
2012-11-20 10:59:23 +01:00
|
|
|
}
|
|
|
|
|
2016-04-10 10:21:48 +02:00
|
|
|
GPU_GLES::~GPU_GLES() {
|
2018-02-27 20:40:44 +01:00
|
|
|
// If we're here during app shutdown (exiting the Windows app in-game, for example)
|
|
|
|
// everything should already be cleared since DeviceLost has been run.
|
|
|
|
|
2021-05-06 01:31:38 +02:00
|
|
|
if (shaderCachePath_.Valid() && draw_) {
|
2021-11-21 21:23:15 +01:00
|
|
|
if (g_Config.bShaderCache) {
|
2022-12-13 22:26:46 -08:00
|
|
|
shaderManagerGL_->SaveCache(shaderCachePath_, &drawEngine_);
|
2021-11-21 21:23:15 +01:00
|
|
|
} else {
|
|
|
|
INFO_LOG(G3D, "Shader cache disabled. Not saving.");
|
|
|
|
}
|
2018-06-04 22:00:29 +08:00
|
|
|
}
|
2014-08-24 15:26:38 -07:00
|
|
|
fragmentTestCache_.Clear();
|
2012-11-19 23:29:14 +01:00
|
|
|
}
|
|
|
|
|
2015-09-05 19:58:47 +02:00
|
|
|
// Take the raw GL extension and versioning data and turn into feature flags.
|
2022-08-07 11:09:34 +02:00
|
|
|
// TODO: This should use DrawContext::GetDeviceCaps() more and more, and eventually
|
|
|
|
// this can be shared between all the backends.
|
2022-09-20 10:02:15 +02:00
|
|
|
u32 GPU_GLES::CheckGPUFeatures() const {
|
2023-02-25 16:12:24 +01:00
|
|
|
u32 features = GPUCommonHW::CheckGPUFeatures();
|
2017-02-18 01:35:34 +01:00
|
|
|
|
2022-10-17 08:30:27 +02:00
|
|
|
features |= GPU_USE_16BIT_FORMATS;
|
2019-01-03 12:43:00 +01:00
|
|
|
|
2015-09-26 16:01:16 +02:00
|
|
|
if (gl_extensions.GLES3 || !gl_extensions.IsGLES)
|
2022-10-17 08:30:27 +02:00
|
|
|
features |= GPU_USE_TEXTURE_LOD_CONTROL;
|
2015-09-26 16:01:16 +02:00
|
|
|
|
2017-03-26 19:00:20 +09:00
|
|
|
bool canUseInstanceID = gl_extensions.EXT_draw_instanced || gl_extensions.ARB_draw_instanced;
|
2017-09-21 20:20:17 -07:00
|
|
|
bool canDefInstanceID = gl_extensions.IsGLES || gl_extensions.EXT_gpu_shader4 || gl_extensions.VersionGEThan(3, 1);
|
2017-03-28 19:49:37 +09:00
|
|
|
bool instanceRendering = gl_extensions.GLES3 || (canUseInstanceID && canDefInstanceID);
|
2017-12-08 14:30:03 +01:00
|
|
|
if (instanceRendering)
|
2022-10-17 08:30:27 +02:00
|
|
|
features |= GPU_USE_INSTANCE_RENDERING;
|
2017-01-31 23:21:22 +09:00
|
|
|
|
2018-01-20 00:05:59 +01:00
|
|
|
int maxVertexTextureImageUnits = gl_extensions.maxVertexTextureUnits;
|
2017-01-31 23:21:22 +09:00
|
|
|
if (maxVertexTextureImageUnits >= 3) // At least 3 for hardware tessellation
|
2022-10-17 08:30:27 +02:00
|
|
|
features |= GPU_USE_VERTEX_TEXTURE_FETCH;
|
2017-01-31 23:21:22 +09:00
|
|
|
|
2017-03-13 00:41:28 +09:00
|
|
|
if (gl_extensions.ARB_texture_float || gl_extensions.OES_texture_float)
|
2022-10-17 08:30:27 +02:00
|
|
|
features |= GPU_USE_TEXTURE_FLOAT;
|
2017-01-31 23:21:22 +09:00
|
|
|
|
2023-01-02 14:32:44 -08:00
|
|
|
if (!draw_->GetShaderLanguageDesc().bitwiseOps) {
|
2022-10-11 16:09:57 +02:00
|
|
|
features |= GPU_USE_FRAGMENT_TEST_CACHE;
|
|
|
|
}
|
|
|
|
|
2023-01-02 14:57:06 -08:00
|
|
|
// Can't use switch-case in older glsl.
|
|
|
|
if ((gl_extensions.IsGLES && !gl_extensions.GLES3) || (!gl_extensions.IsGLES && !gl_extensions.VersionGEThan(1, 3)))
|
|
|
|
features &= ~GPU_USE_LIGHT_UBERSHADER;
|
|
|
|
|
2022-11-06 14:36:51 +01:00
|
|
|
if (IsVREnabled()) {
|
2022-10-17 18:36:54 +02:00
|
|
|
features |= GPU_USE_VIRTUAL_REALITY;
|
|
|
|
}
|
|
|
|
if (IsMultiviewSupported()) {
|
|
|
|
features |= GPU_USE_SINGLE_PASS_STEREO;
|
|
|
|
}
|
|
|
|
|
2022-11-24 10:09:47 +01:00
|
|
|
features = CheckGPUFeaturesLate(features);
|
|
|
|
|
|
|
|
if (draw_->GetBugs().Has(Draw::Bugs::ADRENO_RESOURCE_DEADLOCK) && g_Config.bVendorBugChecksEnabled) {
|
2022-11-23 17:32:32 +01:00
|
|
|
if (PSP_CoreParameter().compat.flags().OldAdrenoPixelDepthRoundingGL) {
|
|
|
|
features |= GPU_ROUND_FRAGMENT_DEPTH_TO_16BIT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-13 08:04:47 -08:00
|
|
|
// This is a bit ugly, but lets us reuse most of the depth logic in GPUCommon.
|
|
|
|
if (features & GPU_ROUND_FRAGMENT_DEPTH_TO_16BIT) {
|
|
|
|
if (gl_extensions.IsGLES && !gl_extensions.GLES3) {
|
|
|
|
// Unsupported, switch to GPU_ROUND_DEPTH_TO_16BIT instead.
|
|
|
|
features &= ~GPU_ROUND_FRAGMENT_DEPTH_TO_16BIT;
|
|
|
|
features |= GPU_ROUND_DEPTH_TO_16BIT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-10 16:14:33 +02:00
|
|
|
if (gl_extensions.GLES3) {
|
|
|
|
features |= GPU_USE_FRAGMENT_UBERSHADER;
|
|
|
|
}
|
|
|
|
|
2022-09-20 10:02:15 +02:00
|
|
|
return features;
|
2015-09-05 19:58:47 +02:00
|
|
|
}
|
|
|
|
|
2017-12-03 11:30:00 -08:00
|
|
|
bool GPU_GLES::IsReady() {
|
|
|
|
return shaderManagerGL_->ContinuePrecompile();
|
|
|
|
}
|
|
|
|
|
2018-10-30 20:32:12 -07:00
|
|
|
void GPU_GLES::CancelReady() {
|
|
|
|
shaderManagerGL_->CancelPrecompile();
|
|
|
|
}
|
|
|
|
|
2016-04-10 10:21:48 +02:00
|
|
|
void GPU_GLES::BuildReportingInfo() {
|
2018-01-21 08:49:34 -08:00
|
|
|
GLRenderManager *render = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
|
|
|
|
|
|
|
|
std::string glVendor = render->GetGLString(GL_VENDOR);
|
|
|
|
std::string glRenderer = render->GetGLString(GL_RENDERER);
|
|
|
|
std::string glVersion = render->GetGLString(GL_VERSION);
|
|
|
|
std::string glSlVersion = render->GetGLString(GL_SHADING_LANGUAGE_VERSION);
|
|
|
|
std::string glExtensions;
|
2015-12-23 15:30:08 -08:00
|
|
|
|
|
|
|
if (gl_extensions.VersionGEThan(3, 0)) {
|
2018-01-21 08:49:34 -08:00
|
|
|
glExtensions = g_all_gl_extensions;
|
2015-12-23 15:30:08 -08:00
|
|
|
} else {
|
2018-01-21 08:49:34 -08:00
|
|
|
glExtensions = render->GetGLString(GL_EXTENSIONS);
|
2015-12-23 15:30:08 -08:00
|
|
|
}
|
2013-04-28 17:49:17 -07:00
|
|
|
|
2013-05-12 01:38:42 -07:00
|
|
|
char temp[16384];
|
2018-01-21 08:49:34 -08:00
|
|
|
snprintf(temp, sizeof(temp), "%s (%s %s), %s (extensions: %s)", glVersion.c_str(), glVendor.c_str(), glRenderer.c_str(), glSlVersion.c_str(), glExtensions.c_str());
|
2013-04-29 00:30:54 -07:00
|
|
|
reportingPrimaryInfo_ = glVendor;
|
|
|
|
reportingFullInfo_ = temp;
|
2014-02-15 15:18:01 -08:00
|
|
|
|
|
|
|
Reporting::UpdateConfig();
|
2013-04-28 17:49:17 -07:00
|
|
|
}
|
|
|
|
|
2016-04-10 10:21:48 +02:00
|
|
|
void GPU_GLES::DeviceLost() {
|
2020-08-15 16:13:24 +02:00
|
|
|
INFO_LOG(G3D, "GPU_GLES: DeviceLost");
|
2013-08-07 23:27:29 -07:00
|
|
|
|
2017-11-19 12:25:57 +01:00
|
|
|
// Simply drop all caches and textures.
|
|
|
|
// FBOs appear to survive? Or no?
|
|
|
|
// TransformDraw has registered as a GfxResourceHolder.
|
2018-10-30 20:32:12 -07:00
|
|
|
CancelReady();
|
2018-05-29 23:07:22 +02:00
|
|
|
fragmentTestCache_.DeviceLost();
|
2020-11-07 00:56:48 +01:00
|
|
|
|
2023-02-25 16:12:24 +01:00
|
|
|
GPUCommonHW::DeviceLost();
|
2016-09-10 20:29:58 -07:00
|
|
|
}
|
|
|
|
|
2023-02-25 23:04:27 +01:00
|
|
|
void GPU_GLES::DeviceRestore(Draw::DrawContext *draw) {
|
|
|
|
GPUCommonHW::DeviceRestore(draw);
|
2014-06-15 15:19:49 -07:00
|
|
|
|
2018-05-29 23:07:22 +02:00
|
|
|
fragmentTestCache_.DeviceRestore(draw_);
|
2023-02-26 11:05:52 +01:00
|
|
|
UpdateVsyncInterval(true);
|
2012-12-25 15:28:34 +01:00
|
|
|
}
|
|
|
|
|
2017-03-17 10:48:43 +01:00
|
|
|
void GPU_GLES::BeginHostFrame() {
|
2023-02-25 16:12:24 +01:00
|
|
|
GPUCommonHW::BeginHostFrame();
|
2017-11-19 12:25:57 +01:00
|
|
|
drawEngine_.BeginFrame();
|
2022-12-13 22:04:00 -08:00
|
|
|
|
|
|
|
if (gstate_c.useFlagsChanged) {
|
|
|
|
// TODO: It'd be better to recompile them in the background, probably?
|
|
|
|
// This most likely means that saw equal depth changed.
|
2023-02-10 00:42:46 +01:00
|
|
|
WARN_LOG(G3D, "Shader use flags changed, clearing all shaders and depth buffers");
|
2023-02-25 15:59:35 +01:00
|
|
|
shaderManager_->ClearShaders();
|
2023-02-10 00:42:46 +01:00
|
|
|
framebufferManager_->ClearAllDepthBuffers();
|
2022-12-13 22:04:00 -08:00
|
|
|
gstate_c.useFlagsChanged = false;
|
|
|
|
}
|
2017-11-19 12:25:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void GPU_GLES::EndHostFrame() {
|
|
|
|
drawEngine_.EndFrame();
|
2017-03-17 10:48:43 +01:00
|
|
|
}
|
|
|
|
|
2017-11-05 20:33:28 +01:00
|
|
|
void GPU_GLES::BeginFrame() {
|
2023-02-25 16:12:24 +01:00
|
|
|
GPUCommonHW::BeginFrame();
|
2016-01-17 20:29:34 +01:00
|
|
|
|
2023-02-25 15:59:35 +01:00
|
|
|
textureCache_->StartFrame();
|
|
|
|
|
2018-03-13 23:22:21 +01:00
|
|
|
// Save the cache from time to time. TODO: How often? We save on exit, so shouldn't need to do this all that often.
|
2021-05-06 01:31:38 +02:00
|
|
|
if (shaderCachePath_.Valid() && (gpuStats.numFlips & 4095) == 0) {
|
2022-12-13 22:26:46 -08:00
|
|
|
shaderManagerGL_->SaveCache(shaderCachePath_, &drawEngine_);
|
2016-01-17 21:35:24 +01:00
|
|
|
}
|
2017-01-23 20:48:23 +01:00
|
|
|
shaderManagerGL_->DirtyShader();
|
2012-12-25 15:28:34 +01:00
|
|
|
|
|
|
|
// Not sure if this is really needed.
|
2017-01-24 09:41:38 +01:00
|
|
|
gstate_c.Dirty(DIRTY_ALL_UNIFORMS);
|
2012-12-25 15:28:34 +01:00
|
|
|
|
2023-02-25 15:59:35 +01:00
|
|
|
framebufferManager_->BeginFrame();
|
|
|
|
|
|
|
|
fragmentTestCache_.Decimate();
|
2012-11-19 21:23:29 +01:00
|
|
|
}
|
2012-11-01 16:19:01 +01:00
|
|
|
|
2016-04-10 10:21:48 +02:00
|
|
|
void GPU_GLES::FinishDeferred() {
|
2015-03-14 18:11:00 -07:00
|
|
|
// This finishes reading any vertex data that is pending.
|
2016-04-10 10:21:48 +02:00
|
|
|
drawEngine_.FinishDeferred();
|
2015-03-14 18:11:00 -07:00
|
|
|
}
|
2014-12-06 11:21:07 +01:00
|
|
|
|
2016-04-10 10:21:48 +02:00
|
|
|
void GPU_GLES::GetStats(char *buffer, size_t bufsize) {
|
2020-09-20 21:33:06 +02:00
|
|
|
size_t offset = FormatGPUStatsCommon(buffer, bufsize);
|
|
|
|
buffer += offset;
|
|
|
|
bufsize -= offset;
|
|
|
|
if ((int)bufsize < 0)
|
|
|
|
return;
|
|
|
|
snprintf(buffer, bufsize,
|
|
|
|
"Vertex, Fragment, Programs loaded: %d, %d, %d\n",
|
2017-02-08 18:07:34 +01:00
|
|
|
shaderManagerGL_->GetNumVertexShaders(),
|
|
|
|
shaderManagerGL_->GetNumFragmentShaders(),
|
2020-09-20 21:33:06 +02:00
|
|
|
shaderManagerGL_->GetNumPrograms()
|
|
|
|
);
|
2012-11-26 17:35:08 +01:00
|
|
|
}
|
2023-05-17 14:38:11 +02:00
|
|
|
|
|
|
|
std::string GPU_GLES::GetGpuProfileString() {
|
|
|
|
GLRenderManager *rm = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
|
|
|
|
return rm->GetGpuProfileString();
|
|
|
|
}
|