mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-10 01:28:44 +02:00
fix(agc): release pooled buffers and image mirrors before the device
This commit is contained in:
@@ -510,8 +510,11 @@ struct VulkanDevice::State {
|
||||
}
|
||||
// Every ShaderResources (kept by the recorder or the resource cache) is gone now, so the
|
||||
// sets and samplers they borrowed can go.
|
||||
copiedWriters->clear();
|
||||
resourceCache.Clear();
|
||||
Graphics::ClearCachedTextures(device);
|
||||
Graphics::ClearImageMirrors(device);
|
||||
patternBuffers.clear();
|
||||
descriptorCache.reset();
|
||||
emptyBuffer.reset();
|
||||
samplerCache.reset();
|
||||
|
||||
@@ -148,6 +148,7 @@ struct MirrorStats {
|
||||
std::uint64_t heapRefills = 0;
|
||||
};
|
||||
MirrorStats MirrorCounters();
|
||||
void ClearImageMirrors(VkDevice device);
|
||||
|
||||
struct AddressCopy {
|
||||
std::uint64_t begin;
|
||||
|
||||
@@ -1002,6 +1002,19 @@ MirrorStats MirrorCounters() {
|
||||
return stats;
|
||||
}
|
||||
|
||||
void ClearImageMirrors(VkDevice device) {
|
||||
auto& state = Mirrors();
|
||||
std::map<std::uint64_t, std::shared_ptr<ImageMirror>> entries;
|
||||
{
|
||||
std::lock_guard lock(state.mutex);
|
||||
if (state.device != device) return;
|
||||
entries.swap(state.entries);
|
||||
state.failed.clear();
|
||||
state.heapBytes = 0;
|
||||
state.device = VK_NULL_HANDLE;
|
||||
}
|
||||
}
|
||||
|
||||
ImportProbe ProbeImportWriteProtection(const Context& context) {
|
||||
ImportProbe probe;
|
||||
#ifdef _WIN32
|
||||
|
||||
Reference in New Issue
Block a user