working mesh shader

This commit is contained in:
Jorijn van der Graaf 2025-04-19 23:59:27 +02:00
commit 97ca634108
18 changed files with 2591 additions and 340 deletions

View file

@ -3,14 +3,13 @@ module;
#include <cstdint>
#include <vulkan/vulkan.h>
#include <vulkan/vulkan_wayland.h>
#include "VulkanBuffer.h"
export module Crafter.Graphics:VulkanDevice;
export namespace Crafter {
class VulkanDevice {
public:
static void CreateDevice();
static void CHECK_VK_RESULT(VkResult result);
inline static VkInstance instance = VK_NULL_HANDLE;
inline static VkDebugUtilsMessengerEXT debugMessenger = VK_NULL_HANDLE;
inline static VkPhysicalDevice physDevice = VK_NULL_HANDLE;
@ -19,6 +18,15 @@ export namespace Crafter {
inline static VkQueue queue = VK_NULL_HANDLE;
inline static VkCommandPool commandPool = VK_NULL_HANDLE;
inline static VkSwapchainKHR swapchain = VK_NULL_HANDLE;
inline static VkRenderPass renderPass = VK_NULL_HANDLE;
inline static PFN_vkCmdDrawMeshTasksEXT vkCmdDrawMeshTasksEXTProc;
inline static PFN_vkCmdBeginRenderingKHR vkCmdBeginRenderingKHRProc;
inline static PFN_vkCmdEndRenderingKHR vkCmdEndRenderingKHRProc;
inline static VkPhysicalDeviceMemoryProperties memoryProperties;
inline static VkFormat depthFormat = VK_FORMAT_UNDEFINED;
static void CreateDevice();
static void CHECK_VK_RESULT(VkResult result);
static void CreateBuffer(VkBufferUsageFlags usageFlags, VkMemoryPropertyFlags memoryPropertyFlags, VkDeviceSize size, VkBuffer *buffer, VkDeviceMemory *memory, void *data = nullptr);
static void CreateBuffer(VkBufferUsageFlags usageFlags, VkMemoryPropertyFlags memoryPropertyFlags, vks::Buffer *buffer, VkDeviceSize size, void *data = nullptr);
static std::uint32_t GetMemoryType(std::uint32_t typeBits, VkMemoryPropertyFlags properties);
};
}