Strange sorting of EGLConfigs

Bug #736924 reported by Alexandros Frantzis
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Genesi EfikaMX Support Project
Fix Released
Undecided
Unassigned

Bug Description

When using the gles2draw sample application (http://people.linaro.org/~afrantzis/gles2draw.tar.gz) the sorting of the returned EGL configs is:

Requesting EGL config with: R=1 G=1 B=1 A=1 SIZE=0
EGL config 0: CAVEAT=0x3038 COLBUF=0x308E R=5 G=5 B=5 A=1 SIZE=16 TYPE=0x427
EGL config 1: CAVEAT=0x3038 COLBUF=0x308E R=5 G=5 B=5 A=1 SIZE=16 TYPE=0x427
EGL config 2: CAVEAT=0x3038 COLBUF=0x308E R=5 G=5 B=5 A=1 SIZE=16 TYPE=0x427
EGL config 3: CAVEAT=0x3038 COLBUF=0x308E R=8 G=8 B=8 A=8 SIZE=32 TYPE=0x467
EGL config 4: CAVEAT=0x3038 COLBUF=0x308E R=8 G=8 B=8 A=8 SIZE=32 TYPE=0x467
EGL config 5: CAVEAT=0x3038 COLBUF=0x308E R=8 G=8 B=8 A=8 SIZE=32 TYPE=0x467
EGL config 6: CAVEAT=0x3051 COLBUF=0x308E R=5 G=5 B=5 A=1 SIZE=16 TYPE=0x427
EGL config 7: CAVEAT=0x3051 COLBUF=0x308E R=5 G=5 B=5 A=1 SIZE=16 TYPE=0x427
EGL config 8: CAVEAT=0x3051 COLBUF=0x308E R=5 G=5 B=5 A=1 SIZE=16 TYPE=0x427
EGL config 9: CAVEAT=0x3051 COLBUF=0x308E R=8 G=8 B=8 A=8 SIZE=32 TYPE=0x467

According to the EGL spec (at least as I understand it), when requesting R,G,B,A,Size = 1,1,1,1,0 the configs with the largest sum of bits in the components should be presented first (EGL_CONFIG_CAVEAT and EGL_COLOR_BUFFER_TYPE being equal). So, in this case I would expect the RGBA=8,8,8,8 configs (3,4,5) to be placed before configs (0,1,2) and config 9 before config 6.

This could be just a coincidence, but I noticed that, within their group, configs with smaller EGL_SURFACE_TYPE values are placed first (EGL_SURFACE_TYPE shouldn't participate in the sorting according to the spec).

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

The sorting order is specified in the EGL 1.4 spec, section 3.4.1, subsection "Sorting of EGLConfigs" (at page 24).

(You can get the spec at: http://www.khronos.org/registry/egl/)

Revision history for this message
Jammy Zhou (jammy-zhou) wrote :

Hmm, I agree. According to the spec, configs with deeper color buffers should be returned first.

"6This rule places configs with deeper color buffers first in the list returned by eglChooseConfig.
Applications may find this counterintuitive, and need to perform additional processing on the list of
configs to find one best matching their requirements. For example, specifying RGBA depths of 5651
could return a list whose first config has a depth of 8888" (end of page 24, eglspec.1.4.20100512.pdf)

Revision history for this message
Matt Sealey (mwsealey) wrote :

fix released upstream (Freescale) and integrated into 2.0.0 driver set

Changed in efikamx:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.