user4081361
user4081361

Reputation:

how to purge opengl shader cache

current opengl drivers use compiled shader cache located in c:/users/name/appdata/roaming/amd|nvidia/glcache/...

unfortunately, it causes program crashes almost every time i change some of the shaders, which i currently fix by manually deleting the shader cache.

the question is, is there any good way of purging the cache when i ship new version of the program? any opengl extension to control the caching? or some magical api from the operating system? or, at least, a proper way to find the folder?

another question: what keys do the drivers use to identify individual shaders? so that i can somehow change the key every time i change a shader.

Upvotes: 0

Views: 3100

Answers (1)

datenwolf
datenwolf

Reputation: 162164

unfortunately, it causes program crashes almost every time i change some of the shaders, which i currently fix by manually deleting the shader cache.

If that is happening there's something seriously broken with your system and/or your drivers' installation. This must not happen and if it does then it's not something a OpenGL program should have to concern itself with.

another question: what keys do the drivers use to identify individual shaders?

Usually some hash derived from the shader source AST (i.e. just adding a whitespace or renaming a symbol will not do the trick).

the question is, is there any good way of purging the cache when i ship new version of the program?

Not that I know of. Shaders are a "black box" in the OpenGL specification. You send in GLSL source text, it gets compiled and linked and that's it. Things like a shader cache or the internal representation are not specified by OpenGL.

any opengl extension to control the caching?

Nope. Technically vendors could add a vendor specific extension for that, but none did.

or some magical api from the operating system?

Nothing officially specified for that.

or, at least, a proper way to find the folder?

Again nothing about this is properly specified.

Upvotes: 3

Related Questions