简体   繁体   English

如何清除opengl着色器缓存

[英]how to purge opengl shader cache

current opengl drivers use compiled shader cache located in c:/users/name/appdata/roaming/amd|nvidia/glcache/... 当前的opengl驱动程序使用位于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? 任何opengl扩展来控制缓存? or some magical api from the operating system? 或操作系统中的一些神奇API? 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. 这样我每次更改着色器时都可以通过某种方式更改关键点。

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. 这一定不能发生,如果是的话,那就不是OpenGL程序必须考虑的问题了。

another question: what keys do the drivers use to identify individual shaders? 另一个问题:驱动程序使用哪些键来标识单个着色器?

Usually some hash derived from the shader source AST (ie just adding a whitespace or renaming a symbol will not do the trick). 通常,一些从着色器源AST派生的哈希(即,仅添加空白或重命名符号将无法解决问题)。

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. 着色器是OpenGL规范中的“黑匣子”。 You send in GLSL source text, it gets compiled and linked and that's it. 您发送GLSL源文本,它会被编译和链接,仅此而已。 Things like a shader cache or the internal representation are not specified by OpenGL. 诸如着色器缓存或内部表示之类的内容未由OpenGL指定。

any opengl extension to control the caching? 任何opengl扩展来控制缓存?

Nope. 不。 Technically vendors could add a vendor specific extension for that, but none did. 从技术上讲,供应商可以为此添加一个特定于供应商的扩展,但是没有一个。

or some magical api from the operating system? 或操作系统中的一些神奇API?

Nothing officially specified for that. 对此没有正式规定。

or, at least, a proper way to find the folder? 或者至少是找到文件夹的正确方法?

Again nothing about this is properly specified. 再次没有适当地指定有关此的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM