Skip to content

Commit 35f5e95

Browse files
committed
Update MobileGLUES and remove the pbuffer
1 parent c378385 commit 35f5e95

File tree

5 files changed

+17
-34
lines changed

5 files changed

+17
-34
lines changed

src/main/jni/egl_bridge.c

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@ typedef EGLBoolean eglInitialize_t (EGLDisplay dpy, EGLint *major, EGLint *minor
2929
typedef EGLBoolean eglChooseConfig_t (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
3030
typedef EGLBoolean eglGetConfigAttrib_t (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
3131
typedef EGLBoolean eglBindAPI_t (EGLenum api);
32-
typedef EGLSurface eglCreatePbufferSurface_t (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
3332
typedef EGLContext eglCreateContext_t (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list);
3433
typedef EGLBoolean eglMakeCurrent_t (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
3534
typedef EGLint eglGetError_t (void);
36-
typedef EGLBoolean eglSwapBuffers_t (EGLDisplay dpy, EGLSurface surface);
3735
typedef EGLBoolean eglSwapInterval_t (EGLDisplay dpy, EGLint interval);
3836
typedef __eglMustCastToProperFunctionPointerType eglGetProcAddress_t (const char *procname);
3937

@@ -42,17 +40,14 @@ eglInitialize_t* eglInitialize_p;
4240
eglChooseConfig_t* eglChooseConfig_p;
4341
eglGetConfigAttrib_t* eglGetConfigAttrib_p;
4442
eglBindAPI_t* eglBindAPI_p;
45-
eglCreatePbufferSurface_t* eglCreatePbufferSurface_p;
4643
eglCreateContext_t* eglCreateContext_p;
4744
eglMakeCurrent_t* eglMakeCurrent_p;
4845
eglGetError_t* eglGetError_p;
49-
eglSwapBuffers_t* eglSwapBuffers_p;
5046
eglSwapInterval_t* eglSwapInterval_p;
5147
eglGetProcAddress_t* eglGetProcAddress_p;
5248

5349
EGLContext xrEglContext;
5450
EGLDisplay xrEglDisplay;
55-
EGLSurface xrEglSurface;
5651
EGLConfig xrConfig;
5752

5853
void* gbuffer;
@@ -74,11 +69,9 @@ void dlsym_egl() {
7469
eglChooseConfig_p = (eglChooseConfig_t*) eglGetProcAddress_p("eglChooseConfig");
7570
eglGetConfigAttrib_p = (eglGetConfigAttrib_t*) eglGetProcAddress_p("eglGetConfigAttrib");
7671
eglBindAPI_p = (eglBindAPI_t*) eglGetProcAddress_p("eglBindAPI");
77-
eglCreatePbufferSurface_p = (eglCreatePbufferSurface_t*) eglGetProcAddress_p("eglCreatePbufferSurface");
7872
eglCreateContext_p = (eglCreateContext_t*) eglGetProcAddress_p("eglCreateContext");
7973
eglMakeCurrent_p = (eglMakeCurrent_t*) eglGetProcAddress_p("eglMakeCurrent");
8074
eglGetError_p = (eglGetError_t*) eglGetProcAddress_p("eglGetError");
81-
eglSwapBuffers_p = (eglSwapBuffers_t*) eglGetProcAddress_p("eglSwapBuffers");
8275
eglSwapInterval_p = (eglSwapInterval_t*) eglGetProcAddress_p("eglSwapInterval");
8376
}
8477

@@ -101,11 +94,11 @@ int xrEglInit() {
10194
// printf("EGLBridge: ANativeWindow pointer = %p\n", androidWindow);
10295
//(*env)->ThrowNew(env,(*env)->FindClass(env,"java/lang/Exception"),"Trace exception");
10396
if (!eglInitialize_p(xrEglDisplay, NULL, NULL)) {
104-
printf("EGLBridge: Error eglInitialize() failed: %s\n", eglGetError_p());
97+
printf("EGLBridge: Error eglInitialize() failed: %d\n", eglGetError_p());
10598
return 0;
10699
}
107100

108-
static const EGLint attribs[] = {
101+
EGLint attribs[] = {
109102
EGL_RED_SIZE, 8,
110103
EGL_GREEN_SIZE, 8,
111104
EGL_BLUE_SIZE, 8,
@@ -121,43 +114,33 @@ int xrEglInit() {
121114
EGLint vid;
122115

123116
if (!eglChooseConfig_p(xrEglDisplay, attribs, &xrConfig, 1, &num_configs)) {
124-
printf("EGLBridge: Error couldn't get an EGL visual config: %s\n", eglGetError_p());
117+
printf("EGLBridge: Error couldn't get an EGL visual config: %d\n", eglGetError_p());
125118
return 0;
126119
}
127120

128121
assert(xrConfig);
129122
assert(num_configs > 0);
130123

131124
if (!eglGetConfigAttrib_p(xrEglDisplay, xrConfig, EGL_NATIVE_VISUAL_ID, &vid)) {
132-
printf("EGLBridge: Error eglGetConfigAttrib() failed: %s\n", eglGetError_p());
125+
printf("EGLBridge: Error eglGetConfigAttrib() failed: %d\n", eglGetError_p());
133126
return 0;
134127
}
135128

136129
eglBindAPI_p(EGL_OPENGL_ES_API);
137130

138-
xrEglSurface = eglCreatePbufferSurface_p(xrEglDisplay, xrConfig,
139-
NULL);
140-
if (!xrEglSurface) {
141-
printf("EGLBridge: Error eglCreatePbufferSurface failed: %d\n", eglGetError_p());
142-
return 0;
143-
}
144-
145-
printf("Created pbuffersurface\n");
146-
147131
printf("XREGLBridge: Initialized!\n");
148132
printf("XREGLBridge: ThreadID=%d\n", gettid());
149-
printf("XREGLBridge: XREGLDisplay=%p, XREGLSurface=%p\n",
133+
printf("XREGLBridge: XREGLDisplay=%p\n",
150134
/* window==0 ? EGL_NO_CONTEXT : */
151-
xrEglDisplay,
152-
xrEglSurface
135+
xrEglDisplay
153136
);
154137

155138
return 1;
156139
}
157140

158141
int pojavInit() {
159-
savedWidth = 1;
160-
savedHeight = 1;
142+
savedWidth = 1080;
143+
savedHeight = 720;
161144
printf("XREGLBridge: Thread name is %d\n", gettid());
162145

163146
return xrEglInit();
@@ -170,15 +153,15 @@ void pojavSetWindowHint(int hint, int value) {
170153

171154
int32_t stride;
172155
void pojavSwapBuffers() {
173-
eglSwapBuffers_p(xrEglDisplay, xrEglSurface);
156+
//eglSwapBuffers_p(xrEglDisplay, xrEglSurface);
174157
}
175158

176159
bool locked = false;
177160
void pojavMakeCurrent(void* window) {
178161
EGLBoolean success = eglMakeCurrent_p(
179162
xrEglDisplay,
180-
xrEglSurface,
181-
xrEglSurface,
163+
EGL_NO_SURFACE,
164+
EGL_NO_SURFACE,
182165
window
183166
);
184167

src/main/jni/vloader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
#include <thread>
55
#include <string>
6-
#include <errno.h>
6+
#include <cerrno>
77
#include <android/hardware_buffer.h>
88
#include <fcntl.h>
99
#include <unistd.h>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:abc26e994517bcaa3309acdb0a27373864086c7569c89d3087b8626fada9ef06
3+
size 176520
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:f0eb42c38d20b617254227836de340f2b8087d9303aff3bb33c2cadd7ca485b8
3-
size 8755664
2+
oid sha256:102ae47afffdac96b15538448ea3611f1d10d2f17065d8353d51b12c1cdfc045
3+
size 8764056

src/main/jniLibs/arm64-v8a/libshaderconv.so

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)