diff options
author | Simon Ser <contact@emersion.fr> | 2023-05-24 19:40:47 +0200 |
---|---|---|
committer | Alexander Orzechowski <alex@ozal.ski> | 2023-06-07 10:06:27 +0000 |
commit | fdb199a43c447f36079dab9b2bc53056addadcb0 (patch) | |
tree | 67950596129c408bd7fbd94984cf65f577b0b2aa /render | |
parent | 31d958f70afa0a375d990f34cc3875e44fe7a2c7 (diff) |
render/vulkan: rename tex_features to shm_tex_features
These features are required for shm only: the TRANSFER stuff is
for texture upload. We don't need these for DMA-BUFs. Make this
clearer by changing the name.
Also re-order the definitions to group all texture-related features
together.
Diffstat (limited to 'render')
-rw-r--r-- | render/vulkan/pixel_format.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/render/vulkan/pixel_format.c b/render/vulkan/pixel_format.c index 8ac7d5bb..7d89f81a 100644 --- a/render/vulkan/pixel_format.c +++ b/render/vulkan/pixel_format.c @@ -238,16 +238,16 @@ static const VkImageUsageFlags tex_usage = static const VkImageUsageFlags dma_tex_usage = VK_IMAGE_USAGE_SAMPLED_BIT; -static const VkFormatFeatureFlags tex_features = +static const VkFormatFeatureFlags render_features = + VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT | + VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT; +static const VkFormatFeatureFlags shm_tex_features = VK_FORMAT_FEATURE_TRANSFER_SRC_BIT | VK_FORMAT_FEATURE_TRANSFER_DST_BIT | VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | // NOTE: we don't strictly require this, we could create a NEAREST // sampler for formats that need it, in case this ever makes problems. VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT; -static const VkFormatFeatureFlags render_features = - VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT | - VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT; static const VkFormatFeatureFlags dma_tex_features = VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT | // NOTE: we don't strictly require this, we could create a NEAREST @@ -434,7 +434,7 @@ void vulkan_format_props_query(struct wlr_vk_device *dev, // non-dmabuf texture properties const char *shm_texture_status; - if ((fmtp.formatProperties.optimalTilingFeatures & tex_features) == tex_features && + if ((fmtp.formatProperties.optimalTilingFeatures & shm_tex_features) == shm_tex_features && !format->is_ycbcr) { VkPhysicalDeviceImageFormatInfo2 fmti = { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2, |