-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Add shader cache to GLES3 #76092
Add shader cache to GLES3 #76092
Conversation
a0cfb04
to
a491a8d
Compare
a491a8d
to
4adbfcf
Compare
For reference, here's the 3.x implementation of shader caching: #53411 Note that the OpenGL program binary extension is poorly supported on HTML5/WebGL, so this will likely have to be disabled there. |
Thanks for the reference. As far as I can see, async shader compilation is not supported for gles3 on godot 4 right now. |
We don't need to implement async shader compilation right away. We don't actually need OpenGL 4.1 on Desktop, we just need support for the godot/drivers/gles3/rasterizer_storage_gles3.cpp Line 8111 in 17e0a02
We need to do this anyway for Web support as you can't cache shader binaries in WebGL2. The extension is very well supported on Desktop. GPUInfo only has 24 reports of OpenGL 3.3 capable devices not supporting it and in all those cases it looks like out of date drivers are responsible (they are all on Windows 7, Windows XP, or using Parellels to run Windows 10 on macOS). So all that is to say, please go ahead and add support for Desktop as well I think it is best to do in this PR. But I don't think it will be very much additional work for you. |
46b6f75
to
6da979d
Compare
I think this is still going to fail on Web exports as the GLES_OVER_GL section won't be included but glGetProgramBinary will still be null. edit: running locally it seems that WebGL is choking on |
6da979d
to
979af3b
Compare
I removed the ifdef GLES_OVER_GL hoping this would solve the WebGL issue. Edit: |
2a3fc12
to
4c4b3e0
Compare
4c4b3e0
to
6441210
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to me now!
I tested locally on my linux device with an intel integrated GPU and on my Android phone. On the phone the improvement is substantial with my test scene (which has a couple of really heavy shaders loaded at the same time). On Desktop it compiles so fast in either case that you can't really notice any improvement.
Thanks! |
Implement shader cache read/write in the gles3 rendering pipeline
This is only supported on mobile platforms as desktop platforms are using gles over gl version 3.3, and 4.1 is needed.
Upgrading glad to 4.1 could be done in a separate PR.