Implement vulkan backend

This commit is contained in:
2026-07-05 22:11:05 +01:00
parent a073dec6a0
commit 5a26bf54c8
5 changed files with 2045 additions and 2 deletions
File diff suppressed because it is too large Load Diff
+7
View File
@@ -27,6 +27,8 @@ struct PrRhiDevice {
void *handle; // VkDevice
void *queue; // VkQueue
u32 queue_family_index;
u32 present_mode; // VkPresentModeKHR
void *physical_device; // VkPhysicalDevice
void *allocator; // VmaAllocator
};
@@ -37,12 +39,14 @@ struct PrRhiSurface {
struct PrRhiSwapchain {
PrRhiDevice *device;
void *handle; // VkSwapchainKHR
void *surface; // PrRhiSurface *
u32 image_count;
PrRhiTexture **images;
PrRhiTexture *depth;
u32 format; // VkFormat
u32 width;
u32 height;
u32 current_image_index;
};
struct PrRhiBuffer {
@@ -57,6 +61,9 @@ struct PrRhiTexture {
void *image; // VkImage
void *view; // VkImageView
void *allocation; // VmaAllocation
u32 width;
u32 height;
u32 format; // VkFormat
};
struct PrRhiSampler {
+1
View File
@@ -12,6 +12,7 @@
#define prRhiGetPhysicalDeviceDriverInfo prRhiGetPhysicalDeviceDriverInfoVk
#define prRhiCreateSurface prRhiCreateSurfaceVk
#define prRhiDestroySurface prRhiDestroySurfaceVk
#define prRhiGetSurfaceCapabilities prRhiGetSurfaceCapabilitiesVk
#define prRhiCreateDevice prRhiCreateDeviceVk
#define prRhiDestroyDevice prRhiDestroyDeviceVk
#define prRhiDeviceWaitIdle prRhiDeviceWaitIdleVk
+2
View File
@@ -0,0 +1,2 @@
#define VMA_IMPLEMENTATION
#include <vk_mem_alloc.h>