Repository navigation
Fix poisonous GLSL cache when running different architecture binaries - #2047
Merged
Merged
Conversation
Note: this uses a C++20 thing from <algorithm> to check for the matching shader program descriptor.
LoadShaderBinary already checked the GL_LINK_STATUS which indicates the error. But it failed to dispose of the program handle upon error. Then BuildShaderProgram decides not to build anything because there is already a program. This means we attempt to render using the program that failed to load. Fixes DaemonEngine#1604.
Make sure the current CPU architecture matches the one a GLSL cache file was written with, as an additional protection against the scenario of DaemonEngine#1604 (comment) where the cache is poisined by changing between 32- and 64-bit binaries. With the previous commit alone, the error is detected, but with this commit we can avoid asking the GL driver to load the binary and avoid warning spew.
illwieckz
reviewed
Nov 22, 2026
illwieckz
left a comment
Member
There was a problem hiding this comment.
“poisined” (not blocking)
LGTM.
Thanks a lot for taking care of that, I faced these annoyances these days.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1604