vk: crash when loading custom texture

Regression due to 939e2bc68f
Issue #1351
This commit is contained in:
Flyinghead 2023-12-21 10:04:35 +01:00
parent e057370e97
commit 449b871e0c
1 changed files with 2 additions and 1 deletions

View File

@ -180,7 +180,8 @@ void Texture::UploadToGPU(int width, int height, const u8 *data, bool mipmapped,
}
}
bool isNew = true;
if (width != (int)extent.width || height != (int)extent.height || format != this->format)
if (width != (int)extent.width || height != (int)extent.height
|| format != this->format || !this->image)
Init(width, height, format, dataSize, mipmapped, mipmapsIncluded);
else
isNew = false;