Skip to content

Commit

Permalink
updater: Clear shader cache after updating
Browse files Browse the repository at this point in the history
  • Loading branch information
derrod authored and Lain-B committed Nov 20, 2023
1 parent 1641812 commit cfd8d4c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions UI/win-update/updater/updater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,16 @@ static void UpdateRegistryVersion(const Manifest &manifest)
RegCloseKey(key);
}

static void ClearShaderCache()
{
wchar_t shader_path[MAX_PATH];
SHGetFolderPathW(NULL, CSIDL_COMMON_APPDATA, NULL, SHGFP_TYPE_CURRENT,
shader_path);
StringCbCatW(shader_path, sizeof(shader_path),
L"\\obs-studio\\shader-cache");
filesystem::remove_all(shader_path);
}

extern "C" void UpdateHookFiles(void);

static bool Update(wchar_t *cmdLine)
Expand Down Expand Up @@ -1700,6 +1710,12 @@ static bool Update(wchar_t *cmdLine)
Status(L"Updating Game Capture hooks...");
UpdateHookFiles();

/* ------------------------------------- *
* Clear shader cache */

Status(L"Clearing shader cache...");
ClearShaderCache();

/* ------------------------------------- *
* Update installed version in registry */

Expand Down

0 comments on commit cfd8d4c

Please sign in to comment.