mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 21:05:58 +01:00
5b34fe5513
Allow to get whether has alpha channel of the VkImage, it can help an optimization to disable blending when the texture doesn't have alpha. Because the VkFormat isn't enough because it's always set to VK_FORMAT_B8G8R8A8_SRGB or VK_FORMAT_R8G8B8A8_SRGB.
38 lines
1.2 KiB
C
38 lines
1.2 KiB
C
/*
|
|
* This an unstable interface of wlroots. No guarantees are made regarding the
|
|
* future consistency of this API.
|
|
*/
|
|
#ifndef WLR_USE_UNSTABLE
|
|
#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features"
|
|
#endif
|
|
|
|
#ifndef WLR_RENDER_VULKAN_H
|
|
#define WLR_RENDER_VULKAN_H
|
|
|
|
#include <vulkan/vulkan_core.h>
|
|
#include <wlr/render/wlr_renderer.h>
|
|
|
|
struct wlr_vk_image_attribs {
|
|
VkImage image;
|
|
VkImageLayout layout;
|
|
VkFormat format;
|
|
};
|
|
|
|
struct wlr_renderer *wlr_vk_renderer_create_with_drm_fd(int drm_fd);
|
|
|
|
VkInstance wlr_vk_renderer_get_instance(struct wlr_renderer *renderer);
|
|
VkPhysicalDevice wlr_vk_renderer_get_physical_device(struct wlr_renderer *renderer);
|
|
VkDevice wlr_vk_renderer_get_device(struct wlr_renderer *renderer);
|
|
uint32_t wlr_vk_renderer_get_queue_family(struct wlr_renderer *renderer);
|
|
void wlr_vk_renderer_get_current_image_attribs(struct wlr_renderer *renderer,
|
|
struct wlr_vk_image_attribs *attribs);
|
|
|
|
bool wlr_renderer_is_vk(struct wlr_renderer *wlr_renderer);
|
|
bool wlr_texture_is_vk(struct wlr_texture *texture);
|
|
|
|
void wlr_vk_texture_get_image_attribs(struct wlr_texture *texture,
|
|
struct wlr_vk_image_attribs *attribs);
|
|
bool wlr_vk_texture_has_alpha(struct wlr_texture *texture);
|
|
|
|
#endif
|
|
|