summaryrefslogtreecommitdiff
blob: 9bdf231c3f0b19018be01c05e783a95d2efe3a07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
From 9cd13ca5b5a6a90c21abf1f41725e52efe4774c0 Mon Sep 17 00:00:00 2001
From: nE0sIghT <ykonotopov@gmail.com>
Date: Mon, 10 Aug 2015 19:11:00 +0300
Subject: [PATCH 1/3] gsdx-linux: Don't enable EGL by default

I was hoping that EGL become a standard much more faster. Currently it is an useless dep
so let's disable it by default.

Only check for EGL if using EGL_API.
---
 cmake/SearchForStuff.cmake     |  5 +++--
 cmake/SelectPcsx2Plugins.cmake |  2 +-
 plugins/GSdx/CMakeLists.txt    | 27 ++++++++++-----------------
 plugins/GSdx/GS.cpp            |  8 ++++----
 plugins/GSdx/GSWndEGL.cpp      |  2 +-
 plugins/GSdx/GSWndEGL.h        | 21 +--------------------
 6 files changed, 20 insertions(+), 45 deletions(-)

diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake
index 8c8918e..b43a547 100644
--- a/cmake/SearchForStuff.cmake
+++ b/cmake/SearchForStuff.cmake
@@ -69,8 +69,9 @@ include(CheckLib)
 if(Linux)
     check_lib(AIO aio libaio.h)
 endif()
-check_lib(EGL EGL EGL/egl.h)
-check_lib(GLESV2 GLESv2 GLES3/gl3ext.h) # NOTE: looking for GLESv3, not GLESv2
+if(EGL_API)
+    check_lib(EGL EGL EGL/egl.h)
+endif()
 check_lib(PORTAUDIO portaudio portaudio.h pa_linux_alsa.h)
 check_lib(SOUNDTOUCH SoundTouch soundtouch/SoundTouch.h)
 
diff --git a/cmake/SelectPcsx2Plugins.cmake b/cmake/SelectPcsx2Plugins.cmake
index 726dc2d..ee8138b 100644
--- a/cmake/SelectPcsx2Plugins.cmake
+++ b/cmake/SelectPcsx2Plugins.cmake
@@ -144,7 +144,7 @@ endif()
 # requires: -OpenGL
 #			-X11
 #---------------------------------------
-if(OPENGL_FOUND AND X11_FOUND AND EGL_FOUND AND GTKn_FOUND)
+if(OPENGL_FOUND AND X11_FOUND AND GTKn_FOUND AND (EGL_FOUND OR NOT EGL_API))
     set(GSdx TRUE)
 elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/GSdx")
 	set(GSdx FALSE)
diff --git a/plugins/GSdx/CMakeLists.txt b/plugins/GSdx/CMakeLists.txt
index 8859044..13b30c7 100644
--- a/plugins/GSdx/CMakeLists.txt
+++ b/plugins/GSdx/CMakeLists.txt
@@ -38,8 +38,8 @@ if(XDG_STD)
     set(GSdxFinalFlags ${GSdxFinalFlags} -DXDG_STD)
 endif()
 
-if(GLES_API AND GLESV2_FOUND)
-    set(GSdxFinalFlags ${GSdxFinalFlags} -DENABLE_GLES)
+if(EGL_API AND EGL_FOUND)
+    set(GSdxFinalFlags ${GSdxFinalFlags} -DEGL_SUPPORTED)
 endif()
 
 #Clang doesn't support a few common flags that GCC does.
@@ -198,25 +198,18 @@ set(GSdxFinalLibs
     ${X11_LIBRARIES}
 )
 
-if(GLES_API AND GLESV2_FOUND)
-    set(GSdxFinalLibs
-        ${GSdxFinalLibs}
-        ${GLESV2_LIBRARIES}
-    )
-else()
-    set(GSdxFinalLibs
-        ${GSdxFinalLibs}
-        ${OPENGL_LIBRARIES}
-    )
-endif()
-
-set(GSdxFinalLibs
-    ${GSdxFinalLibs}
-    ${EGL_LIBRARIES}
+set(GSdxFinalLibs ${GSdxFinalLibs}
+	${OPENGL_LIBRARIES}
     ${GTK2_LIBRARIES}
     ${LIBC_LIBRARIES}
 )
 
+if(EGL_API AND EGL_FOUND)
+    set(GSdxFinalLibs ${GSdxFinalLibs}
+        ${EGL_LIBRARIES}
+        )
+endif()
+
 # Generate Glsl header file. Protect with REBUILD_SHADER to avoid build-dependency on PERL
 if (REBUILD_SHADER)
     add_custom_command(OUTPUT res/glsl_source.h COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/glsl2h.pl)
diff --git a/plugins/GSdx/GS.cpp b/plugins/GSdx/GS.cpp
index 3ffb5e8..4836192 100644
--- a/plugins/GSdx/GS.cpp
+++ b/plugins/GSdx/GS.cpp
@@ -291,12 +291,12 @@ static int _GSopen(void** dsp, char* title, int renderer, int threads = -1)
 				break;
 			}
 #else
-#ifdef ENABLE_GLES
-			wnd[0] = NULL;
-#else
 			wnd[0] = new GSWndOGL();
-#endif
+#ifdef EGL_SUPPORTED
 			wnd[1] = new GSWndEGL();
+#else
+			wnd[1] = NULL;
+#endif
 #endif
 		}
 	}
diff --git a/plugins/GSdx/GSWndEGL.cpp b/plugins/GSdx/GSWndEGL.cpp
index 491f34f..f69ff0c 100644
--- a/plugins/GSdx/GSWndEGL.cpp
+++ b/plugins/GSdx/GSWndEGL.cpp
@@ -22,7 +22,7 @@
 #include "stdafx.h"
 #include "GSWndEGL.h"
 
-#if defined(__linux__)
+#if defined(__linux__) && defined(EGL_SUPPORTED)
 
 GSWndEGL::GSWndEGL()
 	: m_NativeWindow(0), m_NativeDisplay(NULL)
diff --git a/plugins/GSdx/GSWndEGL.h b/plugins/GSdx/GSWndEGL.h
index c5a2573..17804bb 100644
--- a/plugins/GSdx/GSWndEGL.h
+++ b/plugins/GSdx/GSWndEGL.h
@@ -21,30 +21,11 @@
 
 #include "GSWnd.h"
 
-#if defined(__linux__)
+#if defined(__linux__) && defined(EGL_SUPPORTED)
 #include <X11/Xlib.h>
 #include <EGL/egl.h>
 #include <EGL/eglext.h>
 
-// Need at least MESA 9.0 (plan for october/november 2012)
-// So force the destiny to at least check the compilation
-#ifndef EGL_KHR_create_context
-#define EGL_KHR_create_context 1
-#define EGL_CONTEXT_MAJOR_VERSION_KHR			    EGL_CONTEXT_CLIENT_VERSION
-#define EGL_CONTEXT_MINOR_VERSION_KHR			    0x30FB
-#define EGL_CONTEXT_FLAGS_KHR				    0x30FC
-#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR		    0x30FD
-#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR  0x31BD
-#define EGL_NO_RESET_NOTIFICATION_KHR			    0x31BE
-#define EGL_LOSE_CONTEXT_ON_RESET_KHR			    0x31BF
-#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR		    0x00000001
-#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR	    0x00000002
-#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR	    0x00000004
-#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR		    0x00000001
-#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR    0x00000002
-#endif
-
-
 class GSWndEGL : public GSWndGL
 {
 	EGLNativeWindowType    m_NativeWindow;
-- 
2.4.6