initial commit-moved from vulkan_guide

This commit is contained in:
2025-10-10 22:53:54 +09:00
commit 8853429937
2484 changed files with 973414 additions and 0 deletions

33
src/core/vk_device.h Normal file
View File

@@ -0,0 +1,33 @@
#pragma once
#include <core/vk_types.h>
#include "VkBootstrap.h"
class DeviceManager
{
public:
void init_vulkan(struct SDL_Window *window);
void cleanup();
VkDevice device() const { return _device; }
VkInstance instance() const { return _instance; }
VkPhysicalDevice physicalDevice() const { return _chosenGPU; }
VkSurfaceKHR surface() const { return _surface; }
VkQueue graphicsQueue() const { return _graphicsQueue; }
uint32_t graphicsQueueFamily() const { return _graphicsQueueFamily; }
VmaAllocator allocator() const { return _allocator; }
VkDebugUtilsMessengerEXT debugMessenger() { return _debug_messenger; }
private:
VkInstance _instance = nullptr;
VkDebugUtilsMessengerEXT _debug_messenger = nullptr;
VkPhysicalDevice _chosenGPU = nullptr;
VkDevice _device = nullptr;
VkSurfaceKHR _surface = nullptr;
VkQueue _graphicsQueue = nullptr;
uint32_t _graphicsQueueFamily = 0;
VmaAllocator _allocator = nullptr;
DeletionQueue _deletionQueue;
};