From 7af42b9bad92b91993808ee05456a6bef41d63ea Mon Sep 17 00:00:00 2001 From: Dynamitos Date: Mon, 6 Apr 2026 20:35:02 +0200 Subject: [PATCH] I dont know anymore --- src/Engine/Graphics/Vulkan/Graphics.cpp | 28 +++++-------------------- src/Engine/Graphics/Vulkan/Window.cpp | 1 + vcpkg.json | 3 --- 3 files changed, 6 insertions(+), 26 deletions(-) diff --git a/src/Engine/Graphics/Vulkan/Graphics.cpp b/src/Engine/Graphics/Vulkan/Graphics.cpp index b074c8b..ea118a1 100644 --- a/src/Engine/Graphics/Vulkan/Graphics.cpp +++ b/src/Engine/Graphics/Vulkan/Graphics.cpp @@ -17,6 +17,8 @@ #include "Shader.h" #include "Window.h" #include +#include +#include #include #include @@ -142,9 +144,7 @@ Graphics::~Graphics() { void Graphics::init(GraphicsInitializer initInfo) { initInstance(initInfo); -#ifdef ENABLE_VALIDATION setupDebugCallback(); -#endif pickPhysicalDevice(); createDevice(initInfo); VmaAllocatorCreateInfo createInfo = { @@ -675,7 +675,9 @@ Array Graphics::getRequiredExtensions() { message += ": "; message += glfwError; } - throw std::runtime_error(message); + extensions.add(VK_KHR_SURFACE_EXTENSION_NAME); + extensions.add(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME); + std::cerr << "Warning: " << message << ". Falling back to a default set of extensions." << std::endl; } for (unsigned int i = 0; i < glfwExtensionCount; i++) { @@ -692,7 +694,6 @@ void Graphics::initInstance(GraphicsInitializer initInfo) { // Work around libdecor runtime regressions on some Wayland stacks. glfwInitHint(GLFW_WAYLAND_LIBDECOR, GLFW_WAYLAND_DISABLE_LIBDECOR); #endif - if (!glfwInit()) { throw std::runtime_error("Failed to initialize GLFW"); } @@ -717,25 +718,6 @@ void Graphics::initInstance(GraphicsInitializer initInfo) { extensions.add("VK_KHR_portability_enumeration"); #endif Array layers = initInfo.layers; -#ifdef ENABLE_VALIDATION - bool hasValidationLayer = false; - uint32 layerCount = 0; - vkEnumerateInstanceLayerProperties(&layerCount, nullptr); - Array availableLayers(layerCount); - vkEnumerateInstanceLayerProperties(&layerCount, availableLayers.data()); - for (const auto& layer : availableLayers) { - if (std::strcmp(layer.layerName, "VK_LAYER_KHRONOS_validation") == 0) { - hasValidationLayer = true; - break; - } - } - if (hasValidationLayer) { - layers.add("VK_LAYER_KHRONOS_validation"); - std::cerr << "Enabled Vulkan validation layer: VK_LAYER_KHRONOS_validation" << std::endl; - } else { - std::cerr << "ENABLE_VALIDATION is set, but VK_LAYER_KHRONOS_validation is unavailable on this system." << std::endl; - } -#endif VkInstanceCreateInfo info = { .sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, .pNext = nullptr, diff --git a/src/Engine/Graphics/Vulkan/Window.cpp b/src/Engine/Graphics/Vulkan/Window.cpp index 03bf805..8c5b9ee 100644 --- a/src/Engine/Graphics/Vulkan/Window.cpp +++ b/src/Engine/Graphics/Vulkan/Window.cpp @@ -9,6 +9,7 @@ using namespace Seele; using namespace Seele::Vulkan; + double currentFrameDelta = 0; double Gfx::getCurrentFrameDelta() { return currentFrameDelta; } diff --git a/vcpkg.json b/vcpkg.json index 8a4e3e0..e44e6aa 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,8 +1,5 @@ { "dependencies": [ - { - "name": "vulkan" - }, { "name": "vulkan-memory-allocator" },