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

gl_shader: also checksum engine constants to invalidate the shader on cvar change #211

Merged
merged 1 commit into from Jul 7, 2019

Conversation

Projects
None yet
2 participants
@illwieckz
Copy link
Member

commented Jul 6, 2019

That's an issue I'm facing since a long time, with problems appearing randomly… Last time I got it was when I was working on #193 and this time it was fully reproducible.

The cached binary shader is expected to be invalidated (then rebuilt) when the content of the shader source change. This is done by computing a checksum at shader compile time and comparing it lately.

Unfortunately, the checksum operation was not checksuming against the header that defines constants like r_normalMapping, only the content of the .glsl file and some macro. Because of that the shaders where not recompiled when such cvar were modified.

This fixes the issue by concatenating the constant header to the text that is sent to the checksum operation.

@illwieckz illwieckz changed the title gl_shader: also checksum engine constants to invalide the shader on cvar change gl_shader: also checksum engine constants to invalidate the shader on cvar change Jul 6, 2019

@slipher

This comment has been minimized.

Copy link
Member

commented Jul 7, 2019

LGTM

@illwieckz illwieckz merged commit a74f1c6 into DaemonEngine:master Jul 7, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.