AnsweredAssumed Answered

imx6q OpenGL ES 2.0 Lib Bug?

Question asked by Gary Yin on Nov 11, 2016
Latest reply on Nov 17, 2016 by Gary Yin

My board's config:

iMX6Q

Linux 3.14.28  1GB DDR

LCD 800 x 480  RGB888

Several versions of rootfs

 

I am testing OpenGL ES API these days. I've tested the following version OpenGL ES lib(inside rootfs/usr/lib). My app just draws a RED triangle. The app running result is either color incorrect as the attached bmp OR API assert fail. 

The app code is from imx6 gpu sdk Samples/GLES2.0/01_SimpleTriangle.

The tested lib is extracted from following release, all based on FB, not X11:

L3.0.101

L3.10.53

L3.14.52

L3.14.28

L4.1.15_1.0.0

L4.1.15_2.0.0

 

Inside my code, the EGL config is:

static const EGLint s_configAttribs[] =
{
EGL_SAMPLES, 0,
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_ALPHA_SIZE, EGL_DONT_CARE,
EGL_DEPTH_SIZE, 0,
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_NONE
};

 

The Shaders code are:

const char* g_strVertexShader =
"uniform mat4 g_matModelView; \n"
"uniform mat4 g_matProj; \n"
" \n"
"attribute vec4 g_vPosition; \n"
" \n"
"void main() \n"
"{ \n"
" vec4 vPositionES = g_matModelView * g_vPosition; \n"
" gl_Position = g_matProj * vPositionES; \n"
"} \n";


const char* g_strFragmentShader =
"#ifdef GL_FRAGMENT_PRECISION_HIGH \n"
" precision highp float; \n"
"#else \n"
" precision mediump float; \n"
"#endif \n"
" \n"
"void main() \n"
"{ \n"
" gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); \n"  /******** Fix RED color *********/
"} \n";

 

The output should be a RED Triangle. But both the foreground and background are all incorrect!!!

 

Outcomes