Add volk for function loading (required on platforms such as Android)

This commit is contained in:
2025-11-26 00:10:58 +10:00
parent 952efa784b
commit cfcc0478dc
4 changed files with 33 additions and 1 deletions

View File

@@ -4,6 +4,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#if defined(NOVA_USE_VOLK)
#include <volk.h>
#endif
#include <vulkan/vulkan.h>
#include <format>
@@ -13,6 +17,14 @@
namespace nova::gfx {
VulkanContext::VulkanContext() {
#if defined(NOVA_USE_VOLK)
if (volkInitialize() != VK_SUCCESS) {
throw std::runtime_error("Failed to initialize volk");
}
#endif
}
API VulkanContext::get_api() const {
return API::VULKAN;
}

View File

@@ -14,6 +14,8 @@ namespace nova::gfx {
class VulkanContext final : public IContext {
public:
VulkanContext();
API get_api() const override;
std::string get_api_name() const override;