mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-15 23:40:29 +02:00
The GL contexts' CreateDrawContext made the thin3d presets and ContextReset made them again, leaking the first set on every context reset. Only ContextReset makes them now. The software renderer draws the same frame dumps on arm64 as on x86-64, so the frametests run on the arm64 runner too. b.sh --aarch64 and setup-cross.sh aarch64 give a headless build to run them under qemu locally.
50 lines
1.6 KiB
C++
50 lines
1.6 KiB
C++
#include "ppsspp_config.h"
|
|
#include "Common/Log.h"
|
|
#include "Core/Config.h"
|
|
#include "Core/ConfigValues.h"
|
|
#include "Core/System.h"
|
|
#include "Common/GPU/OpenGL/GLFeatures.h"
|
|
|
|
#include "libretro/LibretroGLCoreContext.h"
|
|
|
|
bool LibretroGLCoreContext::InitAPI(void *wnd, std::string *deviceName, std::string *error_message) {
|
|
if (!LibretroHWRenderContext::InitHW(false))
|
|
return false;
|
|
|
|
g_Config.iGPUBackend = (int)GPUBackend::OPENGL;
|
|
return true;
|
|
}
|
|
|
|
void LibretroGLCoreContext::CreateDrawContext() {
|
|
if (!glewInitDone) {
|
|
#if !PPSSPP_PLATFORM(IOS) && !defined(USING_GLES2)
|
|
if (glewInit() != GLEW_OK) {
|
|
ERROR_LOG(Log::G3D, "glewInit() failed.\n");
|
|
return;
|
|
}
|
|
#endif
|
|
glewInitDone = true;
|
|
// We requested RETRO_HW_CONTEXT_OPENGL_CORE; tell GLFeatures so the
|
|
// Core-profile workaround in CheckGLExtensions (which force-enables
|
|
// ARB_framebuffer_object / ARB_vertex_array_object) fires. Apple's
|
|
// Core driver doesn't list these as extensions, so without this both
|
|
// stay false and glBindFramebuffer(default) silently no-ops in
|
|
// GLQueueRunner::fbo_unbind on macOS → black screen.
|
|
SetGLCoreContext(true);
|
|
CheckGLExtensions();
|
|
}
|
|
draw_ = Draw::T3DCreateGLContext(false);
|
|
renderManager_ = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
|
|
renderManager_->SetInflightFrames(g_Config.iInflightFrames);
|
|
SetGPUBackend(GPUBackend::OPENGL);
|
|
}
|
|
|
|
void LibretroGLCoreContext::DestroyDrawContext() {
|
|
LibretroHWRenderContext::DestroyDrawContext();
|
|
renderManager_ = nullptr;
|
|
}
|
|
|
|
void LibretroGLCoreContext::NotifyEmuThreadExit() {
|
|
renderManager_->NotifyEmuThreadExit();
|
|
}
|