You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
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.
@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.
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.
Activity
ljbade commentedon Nov 11, 2014
Good idea.
ljbade commentedon Nov 17, 2014
On Android we can save this to the cache dir, or on API 21+ we can use the code cache dir.
ljbade commentedon Nov 21, 2014
Will have a go at this on Linux tomorrow: https://github.com/mapbox/mapbox-gl-native/tree/cache-shaders
ljbade commentedon Nov 23, 2014
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.
ljbade commentedon Nov 23, 2014
Once this gets merged into master I then need to add the extension loading to android-mason.
ljbade commentedon Nov 23, 2014
@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.
kkaefer commentedon Nov 24, 2014
Yeah, we could do the save on destruct method, so it's completely transparent to the application.
ljbade commentedon Nov 24, 2014
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.
ljbade commentedon Dec 1, 2014
OK, just got a NVIDIA GPU, will be able to test Linux now.
ljbade commentedon Dec 1, 2014
Seems to work fine on my NVIDIA GPU, except for the crash from #659
ljbade commentedon Dec 1, 2014
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?
ljbade commentedon Dec 5, 2014
I am just going to merge instead of waiting.
Can someone hook up OSX and iOS please.
ljbade commentedon Dec 9, 2014
@incanus did you manage to hook up iOS?
ljbade commentedon Dec 22, 2014
Moving to cutting-room-floor/mapbox-gl-cocoa#76
ljbade commentedon Jan 27, 2015
We decided to remove this due to many issues with it. #778