imx6q OpenGL ES 2.0 Lib Bug?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx6q OpenGL ES 2.0 Lib Bug?

1,536 Views
garyyin
Contributor III

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!!!

303749628342956880.jpg

Labels (4)
0 Kudos
4 Replies

1,044 Views
sergkot
Contributor II

Hi there.

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>;

0 Kudos

1,044 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hi

It looks like a display issue, memory or something in your hardware, on Sabre SD, GPU OpenGL samples run as expected.

regards

0 Kudos

1,044 Views
garyyin
Contributor III

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.

For example:

root@imx6qsabresd:/opt/fsl-gpu-sdk/GLES2/S01_SimpleTriangle#./S01_SimpleTriangle

 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.

0 Kudos

1,044 Views
garyyin
Contributor III

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?

0 Kudos