Add get_surface_extension to WaylandSystemDriver
This commit is contained in:
@@ -8,6 +8,11 @@
|
||||
|
||||
#include "drivers/linux/wayland/system_driver.h"
|
||||
|
||||
#ifdef NOVA_VULKAN
|
||||
#include <vulkan/vulkan.h>
|
||||
#include <vulkan/vulkan_wayland.h>
|
||||
#endif
|
||||
|
||||
#include <nova/core/debug.h>
|
||||
|
||||
using namespace Nova;
|
||||
@@ -20,4 +25,12 @@ WaylandSystemDriver::~WaylandSystemDriver() {
|
||||
NOVA_AUTO_TRACE();
|
||||
}
|
||||
|
||||
const char* WaylandSystemDriver::get_surface_extension() const {
|
||||
#ifdef NOVA_VULKAN
|
||||
return VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME;
|
||||
#else
|
||||
return nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // NOVA_WAYLAND
|
||||
|
||||
@@ -15,6 +15,8 @@ namespace Nova {
|
||||
public:
|
||||
WaylandSystemDriver();
|
||||
~WaylandSystemDriver() override;
|
||||
|
||||
[[nodiscard]] const char* get_surface_extension() const override;
|
||||
};
|
||||
} // namespace Nova
|
||||
|
||||
|
||||
@@ -118,8 +118,13 @@ void VulkanRenderDriver::_check_extensions() {
|
||||
u32 count;
|
||||
std::unordered_map<std::string_view, bool> requested; // <extension, required>
|
||||
|
||||
const auto surface_extension = System::get_driver()->get_surface_extension();
|
||||
if (!surface_extension) {
|
||||
throw std::runtime_error("Could not determine required surface extension");
|
||||
}
|
||||
|
||||
requested[VK_KHR_SURFACE_EXTENSION_NAME] = true;
|
||||
requested[System::get_driver()->get_surface_extension()] = true;
|
||||
requested[surface_extension] = true;
|
||||
|
||||
// Add optional extensions
|
||||
requested[VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME] = false;
|
||||
|
||||
Reference in New Issue
Block a user