mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
vulkan: create validation function for dmabuf properties
Validation of properties is moved from the import and allocation functions into a separate function. This allows later separation of modifier informations from the base struct.
This commit is contained in:
parent
08216be3b1
commit
02779fe28b
3 changed files with 18 additions and 15 deletions
|
|
@ -495,6 +495,8 @@ int spa_vulkan_compute_use_buffers(struct vulkan_compute_state *s, struct vulkan
|
|||
: VK_IMAGE_USAGE_SAMPLED_BIT,
|
||||
.spa_buf = buffers[i],
|
||||
};
|
||||
struct vulkan_modifier_info *modifierInfo = vulkan_modifierInfo_find(&s->base, format, dsp_info->modifier);
|
||||
CHECK(vulkan_validate_dmabuf_properties(modifierInfo, &dmabufInfo.spa_buf->n_datas, &dmabufInfo.size));
|
||||
ret = vulkan_create_dmabuf(&s->base, &dmabufInfo, &p->buffers[i]);
|
||||
} else {
|
||||
spa_log_error(s->log, "Unsupported buffer type mask %d", buffers[i]->datas[0].type);
|
||||
|
|
@ -513,6 +515,8 @@ int spa_vulkan_compute_use_buffers(struct vulkan_compute_state *s, struct vulkan
|
|||
: VK_IMAGE_USAGE_SAMPLED_BIT,
|
||||
.spa_buf = buffers[i],
|
||||
};
|
||||
struct vulkan_modifier_info *modifierInfo = vulkan_modifierInfo_find(&s->base, format, dsp_info->modifier);
|
||||
CHECK(vulkan_validate_dmabuf_properties(modifierInfo, &dmabufInfo.spa_buf->n_datas, &dmabufInfo.size));
|
||||
ret = vulkan_import_dmabuf(&s->base, &dmabufInfo, &p->buffers[i]);
|
||||
break;
|
||||
case SPA_DATA_MemPtr:;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue