Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Rewrite EGL config choosing logic #574

Closed

Description

@ljbade

The logic EGL config choosing logic code is currently very messy. I want to simplify it to reduce bugs and make it more manageable.

I think we need this logic:

  • Need GL ES 2.0.
  • Prefer GL ES 2.0 conformant over non-conformant over software emulation.
  • Prefer 565, over 8880 over 8888 over 888 (RGBA)
  • Prefer 16 bit (565) over 32 bit (8888/8880) over 24 bit (888).
  • Prefer 16 bit depth over 24 bit.
  • Need 8 bit stencil.
  • Need no sample buffer.

Activity

  1. added
    Android
    on Nov 9, 2014
  2. ljbade commented on Nov 9, 2014

    @ljbade
    ContributorAuthor

    OK I am making note here of what order I believe the logic needs to evaluate available configs.

    Valid buffer configs in preferred order:

    RGBA D  S
    565  16 8
    565  24 8
    8880 16 8
    8880 24 8
    8888 16 8
    8888 24 8
    888  16 8
    888  24 8
    

    Preferred EGL context order:

    • Conformant and no caveat.
    • Non conformant and no caveat.
    • Conformant and slow caveat.
    • Non conformant and slow caveat.

    Basic logic:
    Try each context, if can't find buffer, try next context. Stop at first context with a buffer we want, selecting the best buffer in that context.

  3. ljbade commented on Nov 9, 2014

    @ljbade
    ContributorAuthor

    Some useful links:
    Notes from NVIDIA on choosing and EGL config

    We should pay attention to Android's EGLConfigChooser logic from GLSurfaceView

  4. kkaefer commented on Nov 10, 2014

    @kkaefer
    Member

    What is the reasoning behind preferring 565 over 8888? All other implementations are using 8888.

  5. ljbade commented on Nov 10, 2014

    @ljbade
    ContributorAuthor

    It was based on the recommendations from NVIDIA about mobile GL. It is supposed to be faster due to the smaller amount of memory touched etc.

    Also so far I have not noticed a drop in visual quality - at least for certain map styles e.g. street maps

    It may be that modern phones are so fast that I am wasting time worrying about 565 vs 8888. Are there performance figures to support for/against 565? Perhaps I should look into this myself.

    Please let me know if I should stop worrying about 565, and switch to 8888.

  6. added this to the Android merge milestone on Nov 13, 2014
  7. ljbade commented on Nov 22, 2014

    @ljbade
    ContributorAuthor

    I used std::list and std::tuple to sort the configs after filtering them.

    Done in a438459

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Androidrefactor

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions