From e9bd321c8bd6bdb6aa7305c6da8b33e8cac462f7 Mon Sep 17 00:00:00 2001 From: kartofen Date: Sun, 22 Oct 2023 21:18:13 +0300 Subject: renamed device.c/.h to graphics --- src/device.h | 73 ------------------------------------------------------------ 1 file changed, 73 deletions(-) delete mode 100644 src/device.h (limited to 'src/device.h') diff --git a/src/device.h b/src/device.h deleted file mode 100644 index b28c806..0000000 --- a/src/device.h +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef DEVICE_H -#define DEVICE_H - -#include -#include -#include - -#include "common.h" - -// from vulkan source -#define MAKE_VERSION(major, minor, patch) \ - ((((u32)(major)) << 22U) | (((u32)(minor)) << 12U) | ((u32)(patch))) - -typedef uint32_t u32; - -typedef struct device { - VkInstance instance; - VkDebugUtilsMessengerEXT debug_messenger; - - VkPhysicalDevice physical_device; - VkDevice logical_device; - - VkQueue graphics_queue; - VkQueue present_queue; - - VkSurfaceKHR surface; - - struct pipeline { - VkRenderPass render_pass; - VkPipelineLayout layout; - VkPipeline pipeline; - } pipeline; - - struct swap_chain { - VkSwapchainKHR swap_chain; - - VkImage *images; - VkImageView *image_views; - VkFramebuffer *framebuffers; - u32 nimages; - - VkFormat image_format; - VkExtent2D extent; - } swap_chain; - - struct command { - VkCommandPool pool; - VkCommandBuffer buffer; - } command; - - struct sync { - VkSemaphore semph_image_available; - VkSemaphore semph_render_finished; - VkFence fence_inflight; - } sync; - -} * device_t; - -struct device_info { - char *name; - u32 version; - - const char* const* extensions; - u32 ext_count; - - int (*surface_func)(VkInstance instance, VkSurfaceKHR *surface); -}; - -device_t device_create(struct device_info *info); -void device_destroy(device_t device); -int device_draw_frame(device_t device); - -#endif -- cgit v1.2.3