Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenGL shader caching #61

Open
BearishSun opened this issue Mar 27, 2018 · 0 comments
Open

OpenGL shader caching #61

BearishSun opened this issue Mar 27, 2018 · 0 comments
Labels
OFFICIAL type: enhancement [MINOR] Feature that doesn't take more than a few days to implement
Milestone

Comments

@BearishSun
Copy link
Member

BearishSun commented Mar 27, 2018

Both DirectX and Vulkan backends have a bytecode caching system for shaders, allowing the shaders to be quickly loaded without requiring compilation. OpenGL has no such system at the moment. This primarily impacts engine load and start-up times.

The options are:

  • Use SPIR-V for bytecode caching, same as for Vulkan. Although this requires an OpenGL extension that might not be available on all platforms, especially macOS and mobiles.

  • Use the binary program caching available with OpenGL 4.1. This requires a different form of cache than the current system, as the cached bytecode is not machine independant and is only guaranteed to work on the specific machine it was compiled on.

    This cache would need to be generated on-the-fly, from the core thread, as the shaders are compiled. Additionally, individual GPU programs cannot be cached, but rather an entire linked program (i.e. a pipeline state). Parent Shader would need to provide child Techniques/Passes/*PipelineStates with unique identifiers so they can locate their data in the cache. OpenGL would require its own implementation of GraphicsPipelineState and ComputePipelineState that internally deals with the cache.

@BearishSun BearishSun added OFFICIAL type: enhancement [MINOR] Feature that doesn't take more than a few days to implement labels Mar 27, 2018
@BearishSun BearishSun added this to the Longterm milestone Mar 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OFFICIAL type: enhancement [MINOR] Feature that doesn't take more than a few days to implement
Projects
None yet
Development

No branches or pull requests

1 participant