Geometry rendering issue on Android Adreno GPUs

I am currently porting a rendering engine over to Android. I get the correct rendering results on IOS using OpenGL ES 2.0 and Kindle Fire devices. The Kindle Fire is loading PVRTC format texture files, both compressed and uncompressed so this is to be expected.

I am now trying to implement support for other GPU formats available on Android starting with Adreno GPU devices. I have managed to load compressed (ATITC) and non-compressed format textures from .DDS files. The texture seems to be loading somewhat correctly but the fullscreen geometry is only being rendered in the top right quadrant of the screen. I can move it to other positions on the screen but these positions reside outside of the normalized device coordinates yet somehow the geometry remains onscreen. This is clearly not working properly.

So far this is only happening on Adreno devices. I have experienced it on both a Xperia Z2 Tablet and a Samsung Galaxy S5.

Here is the texture being loaded.

[ATTACH=CONFIG]62[/ATTACH]

A screenshot of the first rendered frame.

[ATTACH=CONFIG]63[/ATTACH]

Here is the OpenGL tracer log from Eclipse for the first frame.

[ATTACH]64[/ATTACH]

Here is the vertex buffer data that shows that the quad being rendered should indeed be fullscreen.

-1.0000, // X
1.0000,  // Y
0.0000,  // Z
0.0000,  // UV X
0.0000,  // UV Y
NaN,     // COLOUR and repeat
-1.0000,
-1.0000,
0.0000,
0.0000,
1.0000,
NaN,
1.0000,
1.0000,
0.0000,
1.0000,
0.0000,
NaN,
1.0000,
-1.0000,
0.0000,
1.0000,
1.0000,
NaN

This is the EGL creation code. No errors are detected.

EGLDisplay eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
EGL_CHECK_ERROR;

eglInitialize(eglDisplay, 0, 0);
EGL_CHECK_ERROR;

const EGLint configAttributes[] =
    {
        EGL_SURFACE_TYPE,       EGL_WINDOW_BIT,
        EGL_RED_SIZE,           8,
        EGL_GREEN_SIZE,         8,
        EGL_BLUE_SIZE,          8,
        EGL_DEPTH_SIZE,         16,
        EGL_RENDERABLE_TYPE,    EGL_OPENGL_ES2_BIT,
        EGL_NONE
    };

EGLConfig eglConfig;
EGLint eglNumConfig;

eglChooseConfig(eglDisplay, configAttributes, &eglConfig, 1, &eglNumConfig);
EGL_CHECK_ERROR;

const EGLint contextAttrs[] =
{
     EGL_CONTEXT_CLIENT_VERSION, 2,
     EGL_NONE
};

EGLContext eglContext= eglCreateContext(eglDisplay, config, 0, contextAttrs);
EGL_CHECK_ERROR;

eglBindAPI(EGL_OPENGL_ES_API);
EGL_CHECK_ERROR;

EGLint visualID;
eglGetConfigAttrib(eglDisplay, config, EGL_NATIVE_VISUAL_ID, &visualID);
EGL_CHECK_ERROR;

ANativeWindow_setBuffersGeometry(getNativeWindow(), 0, 0, visualID);

const EGLint eglSurfaceAttrs[] =
{
    EGL_RENDER_BUFFER,    EGL_BACK_BUFFER,
    EGL_NONE
};

EGLSurface eglSurface = eglCreateWindowSurface(eglDisplay, eglConfig, getNativeWindow(), eglSurfaceAttrs);
EGL_CHECK_ERROR;

eglMakeCurrent(eglDisplay, eglSurface , eglSurface , eglContext);
EGL_CHECK_ERROR;

Has anyone experienced this issue before? It seems to be a platform specific issue but I haven’t had much luck searching for a solution.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.