mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-02-17 22:05:56 -05:00
render: unify getter for texture formats
Instead of having separate getters for shm formats and DMA-BUF formats, use the same pattern as wlr_output_impl.get_primary_formats with a single function which takes buffer caps as input.
This commit is contained in:
parent
c63275d75e
commit
85c1eda721
12 changed files with 78 additions and 67 deletions
|
|
@ -623,9 +623,8 @@ struct wlr_vk_device *vulkan_device_create(struct wlr_vk_instance *ini,
|
|||
|
||||
size_t max_fmts;
|
||||
const struct wlr_vk_format *fmts = vulkan_get_format_list(&max_fmts);
|
||||
dev->shm_formats = calloc(max_fmts, sizeof(*dev->shm_formats));
|
||||
dev->format_props = calloc(max_fmts, sizeof(*dev->format_props));
|
||||
if (!dev->shm_formats || !dev->format_props) {
|
||||
if (!dev->format_props) {
|
||||
wlr_log_errno(WLR_ERROR, "allocation failed");
|
||||
goto error;
|
||||
}
|
||||
|
|
@ -657,12 +656,12 @@ void vulkan_device_destroy(struct wlr_vk_device *dev) {
|
|||
|
||||
wlr_drm_format_set_finish(&dev->dmabuf_render_formats);
|
||||
wlr_drm_format_set_finish(&dev->dmabuf_texture_formats);
|
||||
wlr_drm_format_set_finish(&dev->shm_texture_formats);
|
||||
|
||||
for (unsigned i = 0u; i < dev->format_prop_count; ++i) {
|
||||
vulkan_format_props_finish(&dev->format_props[i]);
|
||||
}
|
||||
|
||||
free(dev->shm_formats);
|
||||
free(dev->format_props);
|
||||
free(dev);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue