mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-15 18:49:51 +01:00
Reuse the AndroidJavaGLContext as the new generic OpenGLGraphicsContext
This commit is contained in:
1 parent
23c3798253
commit
ccff34b431
10 files changed
+25
-40
No files matched your search
@@ -909,8 +909,6 @@ endif()
|
||||
if(ANDROID)
|
||||
list(APPEND AndroidJniSource
|
||||
android/jni/app-android.cpp
|
||||
android/jni/AndroidJavaGLContext.cpp
|
||||
android/jni/AndroidJavaGLContext.h
|
||||
android/jni/AndroidAudio.cpp
|
||||
android/jni/AndroidAudio.h
|
||||
android/jni/OpenSLContext.cpp
|
||||
|
||||
@@ -170,6 +170,8 @@ add_library(Common STATIC
|
||||
GPU/OpenGL/GLProfiler.h
|
||||
GPU/OpenGL/DataFormatGL.cpp
|
||||
GPU/OpenGL/DataFormatGL.h
|
||||
GPU/OpenGL/OpenGLGraphicsContext.cpp
|
||||
GPU/OpenGL/OpenGLGraphicsContext.h
|
||||
GPU/Vulkan/VulkanBarrier.cpp
|
||||
GPU/Vulkan/VulkanBarrier.h
|
||||
GPU/Vulkan/VulkanDebug.cpp
|
||||
|
||||
@@ -442,6 +442,7 @@
|
||||
<ClInclude Include="GPU\OpenGL\GLSLProgram.h" />
|
||||
<ClInclude Include="GPU\OpenGL\GLCommon.h" />
|
||||
<ClInclude Include="GPU\OpenGL\GLDebugLog.h" />
|
||||
<ClInclude Include="GPU\OpenGL\OpenGLGraphicsContext.h" />
|
||||
<ClInclude Include="GPU\Shader.h" />
|
||||
<ClInclude Include="GPU\ShaderTranslation.h" />
|
||||
<ClInclude Include="GPU\ShaderWriter.h" />
|
||||
@@ -924,6 +925,7 @@
|
||||
<ClCompile Include="GPU\OpenGL\GLRenderManager.cpp" />
|
||||
<ClCompile Include="GPU\OpenGL\GLSLProgram.cpp" />
|
||||
<ClCompile Include="GPU\OpenGL\GLDebugLog.cpp" />
|
||||
<ClCompile Include="GPU\OpenGL\OpenGLGraphicsContext.cpp" />
|
||||
<ClCompile Include="GPU\OpenGL\thin3d_gl.cpp" />
|
||||
<ClCompile Include="GPU\Shader.cpp" />
|
||||
<ClCompile Include="GPU\ShaderTranslation.cpp" />
|
||||
|
||||
@@ -792,6 +792,9 @@
|
||||
<ClInclude Include="GPU\Vulkan\VulkanGraphicsContext.h">
|
||||
<Filter>GPU\Vulkan</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GPU\OpenGL\OpenGLGraphicsContext.h">
|
||||
<Filter>GPU\OpenGL</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="ABI.cpp" />
|
||||
@@ -1463,6 +1466,9 @@
|
||||
<ClCompile Include="GPU\Vulkan\VulkanGraphicsContext.cpp">
|
||||
<Filter>GPU\Vulkan</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GPU\OpenGL\OpenGLGraphicsContext.cpp">
|
||||
<Filter>GPU\OpenGL</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="Crypto">
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
#include "AndroidJavaGLContext.h"
|
||||
#include "OpenGLGraphicsContext.h"
|
||||
#include "Common/System/Display.h"
|
||||
#include "Common/GPU/OpenGL/GLFeatures.h"
|
||||
#include "Common/Log.h"
|
||||
#include "Core/Config.h"
|
||||
#include "Core/ConfigValues.h"
|
||||
#include "Core/System.h"
|
||||
#include "Core/Config.h"
|
||||
|
||||
AndroidJavaEGLGraphicsContext::AndroidJavaEGLGraphicsContext() {
|
||||
OpenGLGraphicsContext::OpenGLGraphicsContext() {
|
||||
SetGPUBackend(GPUBackend::OPENGL);
|
||||
|
||||
// OpenGL handles rotated rendering in the driver.
|
||||
g_display.rotation = DisplayRotation::ROTATE_0;
|
||||
g_display.rot_matrix.setIdentity();
|
||||
}
|
||||
|
||||
bool AndroidJavaEGLGraphicsContext::InitSurface(WindowSystem winsys, void *data1, void *data2, std::string *errorMessage) {
|
||||
INFO_LOG(Log::G3D, "AndroidJavaEGLGraphicsContext::InitFromRenderThread");
|
||||
bool OpenGLGraphicsContext::InitSurface(WindowSystem winsys, void *data1, void *data2, std::string *errorMessage) {
|
||||
INFO_LOG(Log::G3D, "OpenGLGraphicsContext::InitSurface");
|
||||
if (!CheckGLExtensions()) {
|
||||
*errorMessage = "CheckExtensions failed";
|
||||
ERROR_LOG(Log::G3D, "CheckGLExtensions failed - not gonna attempt starting up.");
|
||||
return false;
|
||||
}
|
||||
|
||||
draw_ = Draw::T3DCreateGLContext(false); // Can't fail
|
||||
renderManager_ = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
|
||||
renderManager_->SetInflightFrames(g_Config.iInflightFrames);
|
||||
@@ -33,8 +33,8 @@ bool AndroidJavaEGLGraphicsContext::InitSurface(WindowSystem winsys, void *data1
|
||||
return true;
|
||||
}
|
||||
|
||||
void AndroidJavaEGLGraphicsContext::ShutdownSurface() {
|
||||
INFO_LOG(Log::G3D, "AndroidJavaEGLGraphicsContext::Shutdown");
|
||||
void OpenGLGraphicsContext::ShutdownSurface() {
|
||||
INFO_LOG(Log::G3D, "OpenGLGraphicsContext::Shutdown");
|
||||
renderManager_ = nullptr; // owned by draw_.
|
||||
delete draw_;
|
||||
draw_ = nullptr;
|
||||
@@ -4,10 +4,10 @@
|
||||
#include "Common/GPU/OpenGL/GLRenderManager.h"
|
||||
#include "Common/GPU/thin3d_create.h"
|
||||
|
||||
class AndroidJavaEGLGraphicsContext : public GraphicsContext {
|
||||
class OpenGLGraphicsContext : public GraphicsContext {
|
||||
public:
|
||||
AndroidJavaEGLGraphicsContext();
|
||||
~AndroidJavaEGLGraphicsContext() override { delete draw_; }
|
||||
OpenGLGraphicsContext();
|
||||
~OpenGLGraphicsContext() override { delete draw_; }
|
||||
|
||||
bool NeedsSeparateEmuThread() const override { return true; }
|
||||
|
||||
@@ -411,14 +411,6 @@
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\android\jni\AndroidJavaGLContext.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)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\android\jni\app-android.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
@@ -711,14 +703,6 @@
|
||||
<ClCompile Include="XinputDevice.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\android\jni\AndroidJavaGLContext.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)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\android\jni\AndroidContentURI.h" />
|
||||
<ClInclude Include="..\android\jni\app-android.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
|
||||
@@ -187,9 +187,6 @@
|
||||
<ClCompile Include="CaptureDevice.cpp">
|
||||
<Filter>Windows\Input</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\android\jni\AndroidJavaGLContext.cpp">
|
||||
<Filter>Other Platforms\Android</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\android\jni\app-android.cpp">
|
||||
<Filter>Other Platforms\Android</Filter>
|
||||
</ClCompile>
|
||||
@@ -397,9 +394,6 @@
|
||||
<ClInclude Include="BufferLock.h">
|
||||
<Filter>Windows\Input</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\android\jni\AndroidJavaGLContext.h">
|
||||
<Filter>Other Platforms\Android</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\android\jni\app-android.h">
|
||||
<Filter>Other Platforms\Android</Filter>
|
||||
</ClInclude>
|
||||
|
||||
@@ -127,7 +127,8 @@ NATIVE_FILES :=\
|
||||
$(SRC)/Common/GPU/OpenGL/GLRenderManager.cpp \
|
||||
$(SRC)/Common/GPU/OpenGL/GLQueueRunner.cpp \
|
||||
$(SRC)/Common/GPU/OpenGL/GLProfiler.cpp \
|
||||
$(SRC)/Common/GPU/OpenGL/DataFormatGL.cpp
|
||||
$(SRC)/Common/GPU/OpenGL/DataFormatGL.cpp \
|
||||
$(SRC)/Common/GPU/OpenGL/OpenGLGraphicsContext.cpp
|
||||
|
||||
VULKAN_FILES := \
|
||||
$(SRC)/Common/GPU/Vulkan/thin3d_vulkan.cpp \
|
||||
@@ -916,7 +917,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/AndroidJavaGLContext.cpp \
|
||||
$(SRC)/android/jni/AndroidAudio.cpp \
|
||||
$(SRC)/android/jni/OpenSLContext.cpp \
|
||||
$(SRC)/UI/ImDebugger/ImDebugger.cpp \
|
||||
|
||||
@@ -88,11 +88,10 @@ struct JNIEnv {};
|
||||
#include "Common/GPU/Vulkan/VulkanLoader.h"
|
||||
#include "Common/GPU/GraphicsContext.h"
|
||||
#include "Common/GPU/Vulkan/VulkanGraphicsContext.h"
|
||||
#include "Common/GPU/OpenGL/OpenGLGraphicsContext.h"
|
||||
#include "Common/StringUtils.h"
|
||||
#include "Common/TimeUtil.h"
|
||||
|
||||
#include "AndroidJavaGLContext.h"
|
||||
|
||||
#include "Core/CmdLine.h"
|
||||
#include "Core/Config.h"
|
||||
#include "Core/ConfigValues.h"
|
||||
@@ -779,7 +778,7 @@ retry:
|
||||
switch (g_Config.iGPUBackend) {
|
||||
case (int)GPUBackend::OPENGL:
|
||||
INFO_LOG(Log::System, "NativeApp.init() -- creating OpenGL context (JavaGL)");
|
||||
graphicsContext = new AndroidJavaEGLGraphicsContext();
|
||||
graphicsContext = new OpenGLGraphicsContext();
|
||||
INFO_LOG(Log::System, "NativeApp.init() - not yet launching emuthread, waiting to displayInit");
|
||||
break;
|
||||
case (int)GPUBackend::VULKAN:
|
||||
|
||||
Reference in new issue
Block a user