aboutsummaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-05-05 14:29:39 +0200
committerSimon Ser <contact@emersion.fr>2023-05-24 08:58:59 +0000
commit91d469d8c09bbe28d86d15f9039939f1a307714b (patch)
tree673e1dd2a08ad796b1a9103aeabf593dd03bb3b4 /render
parentc7ae9dfaf8642119e363d1719facdfdd7c510044 (diff)
render/vulkan: check format support before creating YCbCr sampler
We need to check whether the format supports dma_tex_ycbcr_features before creating the YCbCr sampler.
Diffstat (limited to 'render')
-rw-r--r--render/vulkan/renderer.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/render/vulkan/renderer.c b/render/vulkan/renderer.c
index bbba97f8..ceb67e7a 100644
--- a/render/vulkan/renderer.c
+++ b/render/vulkan/renderer.c
@@ -2465,12 +2465,10 @@ static bool init_static_render_data(struct wlr_vk_renderer *renderer) {
return false;
}
- size_t formats_len;
- const struct wlr_vk_format *formats = vulkan_get_format_list(&formats_len);
-
size_t ycbcr_formats_len = 0;
- for (size_t i = 0; i < formats_len; i++) {
- if (renderer->dev->sampler_ycbcr_conversion && formats[i].is_ycbcr) {
+ for (size_t i = 0; i < renderer->dev->format_prop_count; i++) {
+ struct wlr_vk_format_props *props = &renderer->dev->format_props[i];
+ if (renderer->dev->sampler_ycbcr_conversion && props->format.is_ycbcr) {
ycbcr_formats_len++;
}
}
@@ -2482,8 +2480,8 @@ static bool init_static_render_data(struct wlr_vk_renderer *renderer) {
return false;
}
- for (size_t i = 0; i < formats_len; i++) {
- const struct wlr_vk_format *format = &formats[i];
+ for (size_t i = 0; i < renderer->dev->format_prop_count; i++) {
+ const struct wlr_vk_format *format = &renderer->dev->format_props[i].format;
if (!format->is_ycbcr) {
continue;
}