mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-26 23:10:38 +00:00
Delete dead code path (initialize EGL from C++ on Android)
This commit is contained in:
parent
1fa2f7a971
commit
e209227be1
@ -1105,8 +1105,6 @@ if(ANDROID)
|
||||
|
||||
set(NativeAppSource ${NativeAppSource}
|
||||
android/jni/app-android.cpp
|
||||
android/jni/AndroidEGLContext.cpp
|
||||
android/jni/AndroidEGLContext.h
|
||||
android/jni/AndroidJavaGLContext.cpp
|
||||
android/jni/AndroidJavaGLContext.h
|
||||
android/jni/AndroidVulkanContext.cpp
|
||||
|
@ -764,7 +764,6 @@ OpenGLContext::OpenGLContext() {
|
||||
}
|
||||
|
||||
OpenGLContext::~OpenGLContext() {
|
||||
DestroyPresets();
|
||||
for (int i = 0; i < GLRenderManager::MAX_INFLIGHT_FRAMES; i++) {
|
||||
renderManager_.DeletePushBuffer(frameData_[i].push);
|
||||
}
|
||||
|
@ -252,13 +252,6 @@ std::string NativeQueryConfig(std::string query) {
|
||||
int max_res = std::max(System_GetPropertyInt(SYSPROP_DISPLAY_XRES), System_GetPropertyInt(SYSPROP_DISPLAY_YRES)) / 480 + 1;
|
||||
snprintf(temp, sizeof(temp), "%d", std::min(scale, max_res));
|
||||
return std::string(temp);
|
||||
} else if (query == "androidJavaGL") {
|
||||
// If we're using Vulkan, we say no... need C++ to use Vulkan.
|
||||
if (GetGPUBackend() == GPUBackend::VULKAN) {
|
||||
return "false";
|
||||
}
|
||||
// Otherwise, some devices prefer the Java init so play it safe.
|
||||
return "true";
|
||||
} else if (query == "sustainedPerformanceMode") {
|
||||
return std::string(g_Config.bSustainedPerformanceMode ? "1" : "0");
|
||||
} else {
|
||||
|
@ -540,16 +540,6 @@
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\android\jni\AndroidEGLContext.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\android\jni\AndroidJavaGLContext.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@ -966,16 +956,6 @@
|
||||
<ClCompile Include="XinputDevice.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\android\jni\AndroidEGLContext.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\android\jni\AndroidGraphicsContext.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
|
@ -196,9 +196,6 @@
|
||||
<ClCompile Include="GPU\WindowsVulkanContext.cpp">
|
||||
<Filter>Windows\System</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\android\jni\AndroidEGLContext.cpp">
|
||||
<Filter>Other Platforms\Android</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\android\jni\AndroidJavaGLContext.cpp">
|
||||
<Filter>Other Platforms\Android</Filter>
|
||||
</ClCompile>
|
||||
@ -415,9 +412,6 @@
|
||||
<ClInclude Include="GPU\WindowsVulkanContext.h">
|
||||
<Filter>Windows\System</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\android\jni\AndroidEGLContext.h">
|
||||
<Filter>Other Platforms\Android</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\android\jni\AndroidGraphicsContext.h">
|
||||
<Filter>Other Platforms\Android</Filter>
|
||||
</ClInclude>
|
||||
|
@ -681,7 +681,6 @@ LOCAL_STATIC_LIBRARIES += ppsspp_common ppsspp_core libarmips libzstd
|
||||
LOCAL_MODULE := ppsspp_jni
|
||||
LOCAL_SRC_FILES := \
|
||||
$(SRC)/android/jni/app-android.cpp \
|
||||
$(SRC)/android/jni/AndroidEGLContext.cpp \
|
||||
$(SRC)/android/jni/AndroidJavaGLContext.cpp \
|
||||
$(SRC)/android/jni/AndroidVulkanContext.cpp \
|
||||
$(SRC)/android/jni/AndroidAudio.cpp \
|
||||
|
@ -1,78 +0,0 @@
|
||||
#include "Common/GPU/OpenGL/GLFeatures.h"
|
||||
#include "Common/GPU/thin3d_create.h"
|
||||
|
||||
#include "Common/Log.h"
|
||||
#include "Common/System/System.h"
|
||||
#include "Common/VR/PPSSPPVR.h"
|
||||
#include "AndroidEGLContext.h"
|
||||
#include "GL/GLInterface/EGLAndroid.h"
|
||||
#include "Core/Config.h"
|
||||
#include "Core/ConfigValues.h"
|
||||
#include "Core/System.h"
|
||||
|
||||
bool AndroidEGLGraphicsContext::InitFromRenderThread(ANativeWindow *wnd, int desiredBackbufferSizeX, int desiredBackbufferSizeY, int backbufferFormat, int androidVersion) {
|
||||
INFO_LOG(G3D, "AndroidEGLGraphicsContext::Init()");
|
||||
wnd_ = wnd;
|
||||
gl = HostGL_CreateGLInterface();
|
||||
if (!gl) {
|
||||
ERROR_LOG(G3D, "ERROR: Failed to create GL interface");
|
||||
return false;
|
||||
}
|
||||
int backbufferWidth = desiredBackbufferSizeX;
|
||||
int backbufferHeight = desiredBackbufferSizeY;
|
||||
INFO_LOG(G3D, "EGL interface created. Desired backbuffer size: %dx%d", backbufferWidth, backbufferHeight);
|
||||
|
||||
// Apparently we still have to set this through Java through setFixedSize on the bufferHolder for it to take effect...
|
||||
gl->SetBackBufferDimensions(backbufferWidth, backbufferHeight);
|
||||
gl->SetMode(MODE_DETECT);
|
||||
|
||||
bool use565 = false;
|
||||
|
||||
// This workaround seems only be needed on some really old devices.
|
||||
if (androidVersion < ANDROID_VERSION_ICS) {
|
||||
switch (backbufferFormat) {
|
||||
case 4: // PixelFormat.RGB_565
|
||||
use565 = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!gl->Create(wnd, false, use565)) {
|
||||
ERROR_LOG(G3D, "EGL creation failed! (use565=%d)", (int)use565);
|
||||
// TODO: What do we do now?
|
||||
delete gl;
|
||||
return false;
|
||||
}
|
||||
gl->MakeCurrent();
|
||||
if (gl->GetMode() == GLInterfaceMode::MODE_OPENGL)
|
||||
SetGLCoreContext(!IsVREnabled());
|
||||
CheckGLExtensions();
|
||||
draw_ = Draw::T3DCreateGLContext();
|
||||
SetGPUBackend(GPUBackend::OPENGL);
|
||||
renderManager_ = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
|
||||
renderManager_->SetInflightFrames(g_Config.iInflightFrames);
|
||||
bool success = draw_->CreatePresets(); // There will always be a GLSL compiler capable of compiling these.
|
||||
_assert_msg_(success, "Failed to compile preset shaders");
|
||||
return true;
|
||||
}
|
||||
|
||||
void AndroidEGLGraphicsContext::ShutdownFromRenderThread() {
|
||||
INFO_LOG(G3D, "AndroidEGLGraphicsContext::Shutdown");
|
||||
renderManager_->WaitUntilQueueIdle();
|
||||
renderManager_ = nullptr; // owned by draw_.
|
||||
delete draw_;
|
||||
draw_ = nullptr;
|
||||
}
|
||||
|
||||
void AndroidEGLGraphicsContext::Shutdown() {
|
||||
gl->ClearCurrent();
|
||||
gl->Shutdown();
|
||||
delete gl;
|
||||
ANativeWindow_release(wnd_);
|
||||
}
|
||||
|
||||
void AndroidEGLGraphicsContext::SwapBuffers() {
|
||||
gl->Swap();
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Common/GPU/OpenGL/GLRenderManager.h"
|
||||
#include "AndroidGraphicsContext.h"
|
||||
#include "Common/GL/GLInterfaceBase.h"
|
||||
|
||||
class AndroidEGLGraphicsContext : public AndroidGraphicsContext {
|
||||
public:
|
||||
AndroidEGLGraphicsContext() : draw_(nullptr), wnd_(nullptr), gl(nullptr) {}
|
||||
bool InitFromRenderThread(ANativeWindow *wnd, int desiredBackbufferSizeX, int desiredBackbufferSizeY, int backbufferFormat, int androidVersion) override;
|
||||
void ShutdownFromRenderThread() override;
|
||||
void Shutdown() override;
|
||||
void SwapBuffers() override;
|
||||
void SwapInterval(int interval) override {}
|
||||
void Resize() override {}
|
||||
Draw::DrawContext *GetDrawContext() override {
|
||||
return draw_;
|
||||
}
|
||||
bool Initialized() override {
|
||||
return draw_ != nullptr;
|
||||
}
|
||||
|
||||
void ThreadStart() override {
|
||||
renderManager_->ThreadStart(draw_);
|
||||
}
|
||||
|
||||
bool ThreadFrame() override {
|
||||
return renderManager_->ThreadFrame();
|
||||
}
|
||||
|
||||
void ThreadEnd() override {
|
||||
renderManager_->ThreadEnd();
|
||||
}
|
||||
|
||||
void StopThread() override {
|
||||
renderManager_->WaitUntilQueueIdle();
|
||||
renderManager_->StopThread();
|
||||
}
|
||||
|
||||
private:
|
||||
Draw::DrawContext *draw_;
|
||||
ANativeWindow *wnd_;
|
||||
cInterfaceBase *gl;
|
||||
GLRenderManager *renderManager_ = nullptr;
|
||||
};
|
@ -78,7 +78,6 @@ struct JNIEnv {};
|
||||
|
||||
#include "AndroidGraphicsContext.h"
|
||||
#include "AndroidVulkanContext.h"
|
||||
#include "AndroidEGLContext.h"
|
||||
#include "AndroidJavaGLContext.h"
|
||||
|
||||
#include "Core/Config.h"
|
||||
@ -736,21 +735,16 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeApp_init
|
||||
// No need to use EARLY_LOG anymore.
|
||||
|
||||
retry:
|
||||
// Now that we've loaded config, set javaGL.
|
||||
javaGL = NativeQueryConfig("androidJavaGL") == "true";
|
||||
|
||||
switch (g_Config.iGPUBackend) {
|
||||
case (int)GPUBackend::OPENGL:
|
||||
javaGL = true;
|
||||
useCPUThread = true;
|
||||
if (javaGL) {
|
||||
INFO_LOG(SYSTEM, "NativeApp.init() -- creating OpenGL context (JavaGL)");
|
||||
graphicsContext = new AndroidJavaEGLGraphicsContext();
|
||||
} else {
|
||||
graphicsContext = new AndroidEGLGraphicsContext();
|
||||
}
|
||||
INFO_LOG(SYSTEM, "NativeApp.init() -- creating OpenGL context (JavaGL)");
|
||||
graphicsContext = new AndroidJavaEGLGraphicsContext();
|
||||
break;
|
||||
case (int)GPUBackend::VULKAN:
|
||||
{
|
||||
javaGL = false;
|
||||
INFO_LOG(SYSTEM, "NativeApp.init() -- creating Vulkan context");
|
||||
useCPUThread = false; // The Vulkan render manager manages its own thread.
|
||||
// We create and destroy the Vulkan graphics context in the "EGL" thread.
|
||||
|
Loading…
Reference in New Issue
Block a user