From c8f86def97e1c772d2e06bcabb490d0042a2defa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 19 Dec 2018 22:39:37 +0100 Subject: [PATCH] Android EGL: Add logging of depth and stencil bits --- .../src/org/ppsspp/ppsspp/NativeRenderer.java | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/android/src/org/ppsspp/ppsspp/NativeRenderer.java b/android/src/org/ppsspp/ppsspp/NativeRenderer.java index 2433b2b637..31df096943 100644 --- a/android/src/org/ppsspp/ppsspp/NativeRenderer.java +++ b/android/src/org/ppsspp/ppsspp/NativeRenderer.java @@ -2,7 +2,11 @@ package org.ppsspp.ppsspp; import android.opengl.GLSurfaceView; import android.util.Log; + +import javax.microedition.khronos.egl.EGL10; import javax.microedition.khronos.egl.EGLConfig; +import javax.microedition.khronos.egl.EGLContext; +import javax.microedition.khronos.egl.EGLDisplay; import javax.microedition.khronos.opengles.GL10; public class NativeRenderer implements GLSurfaceView.Renderer { @@ -24,8 +28,25 @@ public class NativeRenderer implements GLSurfaceView.Renderer { inFrame = false; } - public void onSurfaceCreated(GL10 unused, EGLConfig config) { + public void onSurfaceCreated(GL10 gl, EGLConfig config) { Log.i(TAG, "NativeRenderer: onSurfaceCreated"); + + EGL10 egl = (EGL10)EGLContext.getEGL(); + if (egl != null) { + EGLDisplay dpy = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY); + if (dpy != null) { + int[] val = new int[1]; + egl.eglGetConfigAttrib(dpy, config, EGL10.EGL_DEPTH_SIZE, val); + int depthBits = val[0]; + egl.eglGetConfigAttrib(dpy, config, EGL10.EGL_STENCIL_SIZE, val); + int stencilBits = val[0]; + Log.i(TAG, "EGL reports " + depthBits + " bits of depth and " + stencilBits + " bits of stencil."); + } else { + Log.e(TAG, "dpy == null"); + } + } else { + Log.e(TAG, "egl == null"); + } // Log.i(TAG, "onSurfaceCreated - EGL context is new or was lost"); // Actually, it seems that it is here we should recreate lost GL objects. displayInit();