1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-07-11 14:30:22 +02:00

vulkan_filter: don't require the storage flag for the base frames format

We check for whether subformats support storage immediately below.
Those are the ones we require storage for, rather than the base format
itself.

This permits better reuse of AVHWFrame contexts.

The patch also removes an always-false check in the subformat check.
This commit is contained in:
Lynne
2024-08-16 01:12:16 +02:00
parent b165f144e7
commit a797317ab1

View File

@ -68,8 +68,7 @@ int ff_vk_filter_init_context(AVFilterContext *avctx, FFVulkanContext *s,
vk = &s->vkfn; vk = &s->vkfn;
/* Usage mismatch */ /* Usage mismatch */
usage_req = VK_IMAGE_USAGE_SAMPLED_BIT | usage_req = VK_IMAGE_USAGE_SAMPLED_BIT;
VK_IMAGE_USAGE_STORAGE_BIT;
/* If format supports hardware encoding, make sure /* If format supports hardware encoding, make sure
* the context includes it. */ * the context includes it. */
@ -100,14 +99,8 @@ int ff_vk_filter_init_context(AVFilterContext *avctx, FFVulkanContext *s,
}; };
vk->GetPhysicalDeviceFormatProperties2(vk_dev->phys_dev, sub[i], vk->GetPhysicalDeviceFormatProperties2(vk_dev->phys_dev, sub[i],
&prop); &prop);
no_storage |= !(prop.formatProperties.optimalTilingFeatures &
if (vk_frames->tiling == VK_IMAGE_TILING_LINEAR) { VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT);
no_storage |= !(prop.formatProperties.linearTilingFeatures &
VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT);
} else {
no_storage |= !(prop.formatProperties.optimalTilingFeatures &
VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT);
}
} }
/* Check if it's usable */ /* Check if it's usable */