#ifndef _BUFFER_H_ #define _BUFFER_H_ #include #include struct vlkn_renderer; VkResult buffer_create(struct vlkn_renderer *ren, VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags props, struct vlkn_buffer *buffer); VkResult buffer_upload(struct vlkn_renderer *ren, struct vlkn_buffer *buffer, size_t offset, size_t size, uint8_t data[size]); void buffer_destroy(struct vlkn_renderer *ren, struct vlkn_buffer *buffer); struct buffer_view { struct vlkn_buffer *buffer; size_t offset, stride, count; }; struct vlkn_images { VkImage image; VkDeviceMemory memory; VkImageView view; }; struct image_opts { VkExtent2D extent; uint32_t mip_level; VkFormat format; VkImageTiling tiling; VkImageUsageFlags usage; VkMemoryPropertyFlags mem_props; VkImageAspectFlags aspect; }; VkResult image_view_create(struct vlkn_renderer *ren, VkFormat format, VkImageAspectFlags aspect, VkImage image, VkImageView *view); VkResult image_create(struct vlkn_renderer *ren, struct image_opts opts, struct vlkn_images *image); void image_destroy(struct vlkn_renderer *ren, struct vlkn_images *image); #endif