Skip to content

Commit

Permalink
Fix an issue where GpuBuffers with valid UniqueKeys are mistakenly pu…
Browse files Browse the repository at this point in the history
…rged from cache. (#376)
  • Loading branch information
domchen committed Dec 13, 2024
1 parent 279fa22 commit 53eeb42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gpu/ResourceCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ void ResourceCache::processUnreferencedResources() {
auto currentTime = std::chrono::steady_clock::now();
for (auto& resource : needToPurge) {
RemoveFromList(nonpurgeableResources, resource);
if (!resource->scratchKey.empty()) {
if (!resource->scratchKey.empty() || resource->hasExternalReferences()) {
AddToList(purgeableResources, resource);
purgeableBytes += resource->memoryUsage();
resource->lastUsedTime = currentTime;
Expand Down

0 comments on commit 53eeb42

Please sign in to comment.