Add RenderDevice struct and driver accessor functions
This commit is contained in:
25
engine/include/nova/render/render_device.h
Normal file
25
engine/include/nova/render/render_device.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Copyright (c) 2025, Jayden Grubb <contact@jaydengrubb.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <nova/api.h>
|
||||
#include <nova/types.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace Nova {
|
||||
struct NOVA_API RenderDevice {
|
||||
enum class Vendor { UNKNOWN = 0, INTEL = 0x8086, AMD = 0x1002, NVIDIA = 0x10de };
|
||||
enum class Type { OTHER = 0, INTEGRATED = 1, DISCRETE = 2, VIRTUAL = 3, CPU = 4 };
|
||||
|
||||
std::string name;
|
||||
Vendor vendor;
|
||||
Type type;
|
||||
u32 deviceID;
|
||||
void* handle;
|
||||
};
|
||||
} // namespace Nova
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <nova/api.h>
|
||||
#include <nova/render/render_api.h>
|
||||
#include <nova/render/render_device.h>
|
||||
#include <nova/types.h>
|
||||
|
||||
namespace Nova {
|
||||
@@ -17,5 +18,8 @@ namespace Nova {
|
||||
|
||||
[[nodiscard]] virtual RenderAPI get_api() const = 0;
|
||||
[[nodiscard]] virtual u32 get_api_version() const = 0;
|
||||
|
||||
[[nodiscard]] virtual u32 get_device_count() const = 0;
|
||||
[[nodiscard]] virtual const RenderDevice& get_device(u32 index) const = 0;
|
||||
};
|
||||
} // namespace Nova
|
||||
|
||||
Reference in New Issue
Block a user