fuck vk_enum_helper / fix device features

This commit is contained in:
2026-06-22 20:48:47 +02:00
parent 331a565cc9
commit 2d0e2abbae
2 changed files with 14 additions and 10 deletions
+6 -1
View File
@@ -65,7 +65,11 @@ void GfxDevice::init(SDL_Window* window, const std::string& appName, bool vSync)
.synchronization2 = true,
.dynamicRendering = true,
};
const auto extendedDynamicState3Features =
VkPhysicalDeviceExtendedDynamicState3FeaturesEXT{
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT,
.extendedDynamicState3PolygonMode = VK_TRUE,
};
physicalDevice = vkb::PhysicalDeviceSelector{instance}
.set_minimum_version(1, 3)
@@ -73,6 +77,7 @@ void GfxDevice::init(SDL_Window* window, const std::string& appName, bool vSync)
.set_required_features_12(features12)
.set_required_features_13(features13)
.add_required_extension(VK_EXT_EXTENDED_DYNAMIC_STATE_3_EXTENSION_NAME)
.add_required_extension_features(extendedDynamicState3Features)
.set_surface(surface)
.prefer_gpu_device_type(vkb::PreferredDeviceType::discrete)
.select()
+8 -9
View File
@@ -5,7 +5,6 @@
#include <destrum/Graphics/GfxDevice.h>
#include <destrum/Graphics/Init.h>
#include <vulkan/vk_enum_string_helper.h>
#include "volk.h"
@@ -39,10 +38,10 @@ void Swapchain::createSwapchain(GfxDevice* gfxDevice, VkFormat format, std::uint
.set_desired_extent(width, height)
.build();
if (!res.has_value()) {
throw std::runtime_error(std::format(
"failed to create swapchain: error = {}, vk result = {}",
res.full_error().type.message(),
string_VkResult(res.full_error().vk_result)));
// throw std::runtime_error(std::format(
// "failed to create swapchain: error = {}, vk result = {}",
// res.full_error().type.message(),
// string_VkResult(res.full_error().vk_result)));
}
m_swapchain = res.value();
@@ -96,10 +95,10 @@ void Swapchain::recreateSwapchain(
.build();
if (!res.has_value()) {
throw std::runtime_error(std::format(
"failed to create swapchain: error = {}, vk result = {}",
res.full_error().type.message(),
string_VkResult(res.full_error().vk_result)));
// throw std::runtime_error(std::format(
// "failed to create swapchain: error = {}, vk result = {}",
// res.full_error().type.message(),
// string_VkResult(res.full_error().vk_result)));
}
for (auto sem : imageRenderSemaphores) {