mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-02-08 10:06:28 -05:00
render/vulkan: add Vulkan allocator
This commit is contained in:
parent
f52482d23a
commit
80d870ae52
6 changed files with 543 additions and 1 deletions
37
include/render/allocator/vulkan.h
Normal file
37
include/render/allocator/vulkan.h
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#ifndef RENDER_ALLOCATOR_VULKAN_H
|
||||
#define RENDER_ALLOCATOR_VULKAN_H
|
||||
|
||||
#include <vulkan/vulkan.h>
|
||||
#include <wlr/types/wlr_buffer.h>
|
||||
#include <wlr/render/allocator.h>
|
||||
|
||||
struct wlr_vulkan_buffer {
|
||||
struct wlr_buffer base;
|
||||
struct wlr_vulkan_allocator *alloc;
|
||||
|
||||
VkImage image;
|
||||
VkDeviceMemory memory;
|
||||
|
||||
struct wlr_dmabuf_attributes dmabuf;
|
||||
};
|
||||
|
||||
struct wlr_vulkan_allocator {
|
||||
struct wlr_allocator base;
|
||||
|
||||
VkInstance instance;
|
||||
VkPhysicalDevice phy_device;
|
||||
|
||||
size_t mods_len;
|
||||
struct wlr_vulkan_allocator_modifier *mods;
|
||||
|
||||
VkDevice device;
|
||||
};
|
||||
|
||||
struct wlr_vulkan_allocator_modifier {
|
||||
VkDrmFormatModifierPropertiesEXT props;
|
||||
VkExtent2D max_extent;
|
||||
};
|
||||
|
||||
struct wlr_allocator *wlr_vulkan_allocator_create(int drm_fd);
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue