more misc fixes
continuous-integration/drone/push Build is passing Details

pull/51/head
cosmonaut 2024-02-28 22:16:08 -08:00
parent 75128355ec
commit d568810fa0
1 changed files with 4 additions and 7 deletions

View File

@ -3482,11 +3482,8 @@ static void VULKAN_INTERNAL_DestroyTexture(
VulkanTexture* texture VulkanTexture* texture
) { ) {
uint32_t i, j, k, rtIndex; uint32_t i, j, k, rtIndex;
uint8_t isRenderTarget =
((texture->usageFlags & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) != 0) ||
((texture->usageFlags & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) != 0);
if (isRenderTarget) if (texture->renderTargets != NULL)
{ {
rtIndex = 0; rtIndex = 0;
@ -5432,7 +5429,7 @@ static VulkanTexture* VULKAN_INTERNAL_CreateTexture(
imageCreateInfo.extent.depth = depth; imageCreateInfo.extent.depth = depth;
imageCreateInfo.mipLevels = levelCount; imageCreateInfo.mipLevels = levelCount;
imageCreateInfo.arrayLayers = layerCount; imageCreateInfo.arrayLayers = layerCount;
imageCreateInfo.samples = isMsaaTexture ? sampleCount : VK_SAMPLE_COUNT_1_BIT; imageCreateInfo.samples = isMsaaTexture || IsDepthFormat(format) ? sampleCount : VK_SAMPLE_COUNT_1_BIT;
imageCreateInfo.tiling = VK_IMAGE_TILING_OPTIMAL; imageCreateInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
imageCreateInfo.usage = imageUsageFlags; imageCreateInfo.usage = imageUsageFlags;
imageCreateInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE; imageCreateInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
@ -8867,7 +8864,7 @@ static void VULKAN_CopyTextureToTexture(
VulkanTextureContainer *dstContainer = (VulkanTextureContainer*) destination->texture; VulkanTextureContainer *dstContainer = (VulkanTextureContainer*) destination->texture;
VkImageCopy imageCopy; VkImageCopy imageCopy;
if (option == REFRESH_COPYOPTIONS_SAFEDISCARD && SDL_AtomicGet(&dstContainer->activeTextureHandle->vulkanTexture->referenceCount) > 0) if (option == REFRESH_COPYOPTIONS_SAFEDISCARD && dstContainer->canBeDiscarded && SDL_AtomicGet(&dstContainer->activeTextureHandle->vulkanTexture->referenceCount) > 0)
{ {
VULKAN_INTERNAL_DiscardActiveTexture( VULKAN_INTERNAL_DiscardActiveTexture(
renderer, renderer,
@ -9023,7 +9020,7 @@ static void VULKAN_CopyBufferToTexture(
VulkanTextureContainer *textureContainer = (VulkanTextureContainer*) textureSlice->texture; VulkanTextureContainer *textureContainer = (VulkanTextureContainer*) textureSlice->texture;
VkBufferImageCopy imageCopy; VkBufferImageCopy imageCopy;
if (option == REFRESH_COPYOPTIONS_SAFEDISCARD && SDL_AtomicGet(&textureContainer->activeTextureHandle->vulkanTexture->referenceCount) > 0) if (option == REFRESH_COPYOPTIONS_SAFEDISCARD && textureContainer->canBeDiscarded && SDL_AtomicGet(&textureContainer->activeTextureHandle->vulkanTexture->referenceCount) > 0)
{ {
VULKAN_INTERNAL_DiscardActiveTexture( VULKAN_INTERNAL_DiscardActiveTexture(
renderer, renderer,