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

@ -13,33 +13,40 @@ import :WindowWayland;
import Crafter.Component;
namespace Crafter {
struct SwapchainElement
{
VkCommandBuffer commandBuffer;
struct DepthStencil {
VkImage image;
VkImageView imageView;
VkFramebuffer framebuffer;
VkSemaphore startSemaphore;
VkSemaphore endSemaphore;
VkFence fence;
VkFence lastFence;
VkDeviceMemory memory;
VkImageView view;
};
struct Semaphores {
// Swap chain image presentation
VkSemaphore presentComplete;
// Command buffer submission and execution
VkSemaphore renderComplete;
};
export class WindowWaylandVulkan : public WindowWayland {
public:
WindowWaylandVulkan(std::string name, std::uint32_t width, std::uint32_t height);
~WindowWaylandVulkan();
void Start();
inline static VkRenderPass renderPass = VK_NULL_HANDLE;
private:
void CreateSwapchain();
void DestroySwapchain();
VkSurfaceKHR vulkanSurface = VK_NULL_HANDLE;
VkSwapchainKHR swapchain = VK_NULL_HANDLE;
std::vector<SwapchainElement> swapchainElements;
std::uint32_t imageCount;
std::uint32_t currentFrame = 0;
std::uint32_t imageIndex = 0;
VkFormat format = VK_FORMAT_UNDEFINED;
VkSwapchainKHR swapChain = VK_NULL_HANDLE;
VkFormat colorFormat;
VkColorSpaceKHR colorSpace;
std::vector<VkImage> images;
std::vector<VkImageView> imageViews;
std::thread thread;
std::vector<VkCommandBuffer> drawCmdBuffers;
std::vector<VkFramebuffer> frameBuffers;
VkSubmitInfo submitInfo;
DepthStencil depthStencil;
Semaphores semaphores;
uint32_t currentBuffer = 0;
VkPipelineStageFlags submitPipelineStages = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
VkRenderPass renderPass = VK_NULL_HANDLE;
};
}