vk: create staging buffer for texture if null
Fixes SF3 double impact crash better texture cache cleanup
This commit is contained in:
parent
bb5b5d4512
commit
190ab6690a
|
@ -254,7 +254,12 @@ void Texture::SetImage(u32 srcSize, void *srcData, bool isNew, bool genMipmaps)
|
|||
|
||||
void* data;
|
||||
if (needsStaging)
|
||||
{
|
||||
if (!stagingBufferData)
|
||||
// This can happen if a texture is first created for RTT, then later updated
|
||||
stagingBufferData = std::unique_ptr<BufferData>(new BufferData(srcSize, vk::BufferUsageFlagBits::eTransferSrc));
|
||||
data = stagingBufferData->MapMemory();
|
||||
}
|
||||
else
|
||||
data = allocation.MapMemory();
|
||||
verify(data != nullptr);
|
||||
|
|
|
@ -180,6 +180,14 @@ public:
|
|||
BaseTextureCache::Clear();
|
||||
for (auto& set : inFlightTextures)
|
||||
set.clear();
|
||||
for (auto& v : trashedImageViews)
|
||||
v.clear();
|
||||
for (auto& v : trashedImages)
|
||||
v.clear();
|
||||
for (auto& v : trashedMem)
|
||||
v.clear();
|
||||
for (auto& v : trashedBuffers)
|
||||
v.clear();
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in New Issue