mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-18 11:52:12 +01:00
[dxvk] Allow resetting the state cache using the DXVK_STATE_CACHE env var
This commit is contained in:
parent
75d0b1af96
commit
16eae7adde
@ -106,7 +106,9 @@ Some applications do not provide a method to select a different GPU. In that cas
|
||||
DXVK caches pipeline state by default, so that shaders can be recompiled ahead of time on subsequent runs of an application, even if the driver's own shader cache got invalidated in the meantime. This cache is enabled by default, and generally reduces stuttering.
|
||||
|
||||
The following environment variables can be used to control the cache:
|
||||
- `DXVK_STATE_CACHE=0` Disables the state cache.
|
||||
- `DXVK_STATE_CACHE`: Controls the state cache. The following values are supported:
|
||||
- `disable`: Disables the cache entirely.
|
||||
- `reset`: Clears the cache file.
|
||||
- `DXVK_STATE_CACHE_PATH=/some/directory` Specifies a directory where to put the cache files. Defaults to the current working directory of the application.
|
||||
|
||||
### Debugging
|
||||
|
@ -238,12 +238,13 @@ namespace dxvk {
|
||||
m_pipeManager (pipeManager),
|
||||
m_pipeWorkers (pipeWorkers) {
|
||||
std::string useStateCache = env::getEnvVar("DXVK_STATE_CACHE");
|
||||
m_enable = useStateCache != "0" && device->config().enableStateCache;
|
||||
m_enable = useStateCache != "0" && useStateCache != "disable" &&
|
||||
device->config().enableStateCache;
|
||||
|
||||
if (!m_enable)
|
||||
return;
|
||||
|
||||
bool newFile = !readCacheFile();
|
||||
bool newFile = (useStateCache == "reset") || (!readCacheFile());
|
||||
|
||||
if (newFile) {
|
||||
Logger::warn("DXVK: Creating new state cache file");
|
||||
|
Loading…
x
Reference in New Issue
Block a user