Fix infinite GEVulkanTexture::waitImageView if createImageView failed

This commit is contained in:
Benau 2022-08-31 11:20:04 +08:00
parent 38b995bf61
commit 4ceec85edc

View File

@ -444,7 +444,11 @@ bool GEVulkanTexture::createImageView(VkImageAspectFlags aspect_flags)
m_ondemand_loading.store(false);
return true;
}
return false;
else
{
m_ondemand_loading.store(false);
return false;
}
} // createImageView
// ----------------------------------------------------------------------------
@ -514,7 +518,10 @@ void GEVulkanTexture::reloadInternal()
void GEVulkanTexture::upload(uint8_t* data, bool generate_hq_mipmap)
{
if (!createTextureImage(data, generate_hq_mipmap))
{
m_ondemand_loading.store(false);
return;
}
if (!createImageView(VK_IMAGE_ASPECT_COLOR_BIT))
return;
m_texture_size = m_size.Width * m_size.Height * (isSingleChannel() ? 1 : 4);