Add volk for function loading (required on platforms such as Android)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user