aboutsummaryrefslogtreecommitdiff
path: root/render/vulkan
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-05-24 19:43:39 +0200
committerAlexander Orzechowski <alex@ozal.ski>2023-06-07 10:06:27 +0000
commitcebe991e953bfe0dd38e4f6efdbb7d56bc1dcde0 (patch)
treec436a7e7a7e387335375b4abe50455c2f92f8ac0 /render/vulkan
parentfdb199a43c447f36079dab9b2bc53056addadcb0 (diff)
render/vulkan: split off YCbCr texture features
Avoids repeating the common bits between dma_tex_features and dma_tex_ycbcr_features, and we will need just the YCbCr-related flags for shm YCbCr support soon.
Diffstat (limited to 'render/vulkan')
-rw-r--r--render/vulkan/pixel_format.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/render/vulkan/pixel_format.c b/render/vulkan/pixel_format.c
index 7d89f81a..3915075e 100644
--- a/render/vulkan/pixel_format.c
+++ b/render/vulkan/pixel_format.c
@@ -253,10 +253,8 @@ static const VkFormatFeatureFlags dma_tex_features =
// 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 dma_tex_ycbcr_features =
- VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT |
+static const VkFormatFeatureFlags ycbcr_tex_features =
VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT |
- VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT |
VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT;
static bool query_modifier_usage_support(struct wlr_vk_device *dev, VkFormat vk_format,
@@ -375,7 +373,10 @@ static bool query_modifier_support(struct wlr_vk_device *dev,
// check that specific modifier for texture usage
errmsg = "unknown error";
- VkFormatFeatureFlags features = props->format.is_ycbcr ? dma_tex_ycbcr_features : dma_tex_features;
+ VkFormatFeatureFlags features = dma_tex_features;
+ if (props->format.is_ycbcr) {
+ features |= ycbcr_tex_features;
+ }
if ((m.drmFormatModifierTilingFeatures & features) == features) {
struct wlr_vk_format_modifier_props p = {0};
if (query_modifier_usage_support(dev, props->format.vk, dma_tex_usage, &m, &p, &errmsg)) {