My board's config:
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:
Inside my code, the EGL config is:
static const EGLint s_configAttribs =
The Shaders code are:
const char* g_strVertexShader =
"uniform mat4 g_matModelView; \n"
"uniform mat4 g_matProj; \n"
"attribute vec4 g_vPosition; \n"
"void main() \n"
" vec4 vPositionES = g_matModelView * g_vPosition; \n"
" gl_Position = g_matProj * vPositionES; \n"
const char* g_strFragmentShader =
"#ifdef GL_FRAGMENT_PRECISION_HIGH \n"
" precision highp float; \n"
" precision mediump float; \n"
"void main() \n"
" gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); \n" /******** Fix RED color *********/
The output should be a RED Triangle. But both the foreground and background are all incorrect!!!
I saw similar problem.
The problem was gone when I changed format of fb in DTS file from 24 bit to 16 or 32 bit. Even string format wasn't changed. Just
default_bpp = <24>;
was changed to:
default_bpp = <32>;
By the way, I found that you pre-build demo in /opt/fsl-gpu-sdk/ run abnormal if --Window [x,y,w,h] para is not specified.
WARNING: Window Size/Position not defined, setting them to MAX Display Resolution
ERROR: demo setup failed with: eglCreateWindowSurface(m_hDisplay, m_hConfig, hWindow, nullptr) failed with error code 12291 at source/FslDemoHostEGL/EGLDemoHost.cpp(473)
If I specify the para --Window [0,0,400,320], it works. But the output is wrong as the picture above.
After the render process finish, I dump fb data to a file and find the the data format is RGBA, 32-bit for each pixel!!!
I think this is the reason. The A, alpha value, shoud not be stored to framebuffer.
Both your demo in /opt/fsl-gpu-sdk/ and my app have the same result.
But I've config the attribute "EGL_ALPHA_SIZE, EGL_DONT_CARE", Why?