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.

Cache shaders #588

Closed
Closed

Description

@kkaefer

We should use GL_ARB_get_program_binary and GL_OES_get_program_binary if available to cache the compiled shaders so a subsequent launch is a lot faster.

Activity

  1. added
    performance
    on Nov 11, 2014
  2. ljbade commented on Nov 11, 2014

    @ljbade
    Contributor

    Good idea.

  3. ljbade commented on Nov 17, 2014

    @ljbade
    Contributor

    On Android we can save this to the cache dir, or on API 21+ we can use the code cache dir.

  4. ljbade commented on Nov 21, 2014

    @ljbade
    Contributor
  5. ljbade commented on Nov 23, 2014

    @ljbade
    Contributor

    I have added shader binary saving and loading to Shader

    It runs on my machine, but unfortunately my GL driver (Intel Haswell) uses Mesa which does not support program binaries yet. It always returns 0 binary length.

    So can someone with a Linux machine and either an ATI or NVIDIA driver test this branch?

    @incanus can you check my branch works on iOS and OSX. You will need to load the program binary extensions in your iOS code, same place as vertex array objects are loaded.

  6. ljbade commented on Nov 23, 2014

    @ljbade
    Contributor

    Once this gets merged into master I then need to add the extension loading to android-mason.

  7. ljbade commented on Nov 23, 2014

    @ljbade
    Contributor

    @kkaefer I just remembered that you are supposed to render some stuff before you retrieve the program binary so the compiler actually compiles all variants of the shader that are needed.

    Is it possible to save the binary to disk during the Shader's destructor? That way we know we have done rendering with it.

  8. kkaefer commented on Nov 24, 2014

    @kkaefer
    MemberAuthor

    Yeah, we could do the save on destruct method, so it's completely transparent to the application.

  9. ljbade commented on Nov 24, 2014

    @ljbade
    Contributor

    I had a problem when I experimented with save on destruct, is that it hanged on Linux for some reason. Haven't got to the bottom of the hang yet.

    Plus have the problem that on Android where GL context is deleted before Map gets destroyed, so wouldn't be able to call the GL methods to save the shader.

  10. ljbade commented on Dec 1, 2014

    @ljbade
    Contributor

    OK, just got a NVIDIA GPU, will be able to test Linux now.

  11. ljbade commented on Dec 1, 2014

    @ljbade
    Contributor

    Seems to work fine on my NVIDIA GPU, except for the crash from #659

  12. ljbade commented on Dec 1, 2014

    @ljbade
    Contributor

    Do we have someone with an ATI GPU with support for GL_ARB_get_program_binary to test?

    Also can someone implement needed code for iOS and OSX so this can be merged into master?

  13. ljbade commented on Dec 5, 2014

    @ljbade
    Contributor

    I am just going to merge instead of waiting.

    Can someone hook up OSX and iOS please.

  14. ljbade commented on Dec 9, 2014

    @ljbade
    Contributor

    @incanus did you manage to hook up iOS?

  15. ljbade commented on Dec 22, 2014

    @ljbade
    Contributor
  16. ljbade commented on Jan 27, 2015

    @ljbade
    Contributor

    We decided to remove this due to many issues with it. #778

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

    performance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions