Add get_api_name() and get_api_version_string()
This commit is contained in:
@@ -12,8 +12,8 @@
|
||||
#include <nova/version.h>
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
#include <format>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
|
||||
#define VALIDATION_LAYER "VK_LAYER_KHRONOS_validation"
|
||||
|
||||
@@ -48,6 +48,21 @@ u32 VulkanRenderDriver::get_api_version() const {
|
||||
return version;
|
||||
}
|
||||
|
||||
std::string VulkanRenderDriver::get_api_name() const {
|
||||
return "Vulkan";
|
||||
}
|
||||
|
||||
std::string VulkanRenderDriver::get_api_version_string() const {
|
||||
const u32 version = get_api_version();
|
||||
return std::format(
|
||||
"{}.{}.{}-{}",
|
||||
VK_API_VERSION_MAJOR(version),
|
||||
VK_API_VERSION_MINOR(version),
|
||||
VK_API_VERSION_PATCH(version),
|
||||
VK_API_VERSION_VARIANT(version)
|
||||
);
|
||||
}
|
||||
|
||||
u32 VulkanRenderDriver::get_device_count() const {
|
||||
return m_devices.size();
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@ namespace Nova {
|
||||
|
||||
[[nodiscard]] RenderAPI get_api() const override;
|
||||
[[nodiscard]] u32 get_api_version() const override;
|
||||
[[nodiscard]] std::string get_api_name() const override;
|
||||
[[nodiscard]] std::string get_api_version_string() const override;
|
||||
|
||||
[[nodiscard]] u32 get_device_count() const override;
|
||||
[[nodiscard]] const RenderDevice& get_device(u32 index) const override;
|
||||
|
||||
Reference in New Issue
Block a user