Refactor various headers
This commit is contained in:
@@ -7,10 +7,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace Nova {
|
||||
enum class WindowAPI { WAYLAND, WINDOWS, X11 };
|
||||
|
||||
class WindowDriver;
|
||||
|
||||
struct Window;
|
||||
using WindowID = Window*;
|
||||
} // namespace Nova
|
||||
@@ -7,13 +7,17 @@
|
||||
#pragma once
|
||||
|
||||
#include <nova/api.h>
|
||||
#include <nova/platform/window_fwd.h>
|
||||
#include <nova/render/render_fwd.h>
|
||||
#include <nova/platform/platform_structs.h>
|
||||
#include <nova/render/render_structs.h>
|
||||
#include <nova/types.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
namespace Nova {
|
||||
class RenderDriver;
|
||||
|
||||
enum class WindowAPI { WAYLAND, WINDOWS, X11 };
|
||||
|
||||
class NOVA_API WindowDriver {
|
||||
public:
|
||||
static WindowDriver* create();
|
||||
|
||||
@@ -7,15 +7,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace Nova {
|
||||
enum class CullMode { NONE, FRONT, BACK };
|
||||
enum class FrontFace { CLOCKWISE, COUNTER_CLOCKWISE };
|
||||
enum class InputRate { VERTEX, INSTANCE };
|
||||
enum class PipelineType { GRAPHICS, COMPUTE };
|
||||
enum class PrimitiveTopology { POINT_LIST, LINE_LIST, LINE_STRIP, TRIANGLE_LIST, TRIANGLE_STRIP };
|
||||
enum class QueueType { UNDEFINED, GRAPHICS, COMPUTE, TRANSFER };
|
||||
enum class RenderAPI { DX12, VULKAN };
|
||||
enum class ShaderStage { VERTEX, FRAGMENT, GEOMETRY, TESS_CONTROL, TESS_EVAL, COMPUTE, MESH, TASK };
|
||||
|
||||
enum class DataFormat {
|
||||
UNDEFINED,
|
||||
R4G4_UNORM_PACK8,
|
||||
@@ -237,31 +228,4 @@ namespace Nova {
|
||||
G16_B16R16_2PLANE_422_UNORM,
|
||||
G16_B16_R16_3PLANE_444_UNORM,
|
||||
};
|
||||
|
||||
class RenderDriver;
|
||||
struct RenderDevice;
|
||||
|
||||
struct VertexAttribute;
|
||||
struct VertexBinding;
|
||||
struct RenderPassParams;
|
||||
struct GraphicsPipelineParams;
|
||||
struct ComputePipelineParams;
|
||||
|
||||
struct CommandBuffer;
|
||||
struct CommandPool;
|
||||
struct Pipeline;
|
||||
struct Queue;
|
||||
struct RenderPass;
|
||||
struct Shader;
|
||||
struct Surface;
|
||||
struct Swapchain;
|
||||
|
||||
using CommandBufferID = CommandBuffer*;
|
||||
using CommandPoolID = CommandPool*;
|
||||
using PipelineID = Pipeline*;
|
||||
using QueueID = Queue*;
|
||||
using RenderPassID = RenderPass*;
|
||||
using ShaderID = Shader*;
|
||||
using SurfaceID = Surface*;
|
||||
using SwapchainID = Swapchain*;
|
||||
} // namespace Nova
|
||||
13
engine/include/nova/render/params/compute_pipeline.h
Normal file
13
engine/include/nova/render/params/compute_pipeline.h
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Copyright (c) 2025, Jayden Grubb <contact@jaydengrubb.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace Nova {
|
||||
struct ComputePipelineParams {
|
||||
// TODO
|
||||
};
|
||||
} // namespace Nova
|
||||
@@ -6,12 +6,18 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <nova/render/render_fwd.h>
|
||||
#include <nova/render/data_format.h>
|
||||
#include <nova/render/render_structs.h>
|
||||
#include <nova/types.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace Nova {
|
||||
enum class CullMode { NONE, FRONT, BACK };
|
||||
enum class FrontFace { CLOCKWISE, COUNTER_CLOCKWISE };
|
||||
enum class InputRate { VERTEX, INSTANCE };
|
||||
enum class PrimitiveTopology { POINT_LIST, LINE_LIST, LINE_STRIP, TRIANGLE_LIST, TRIANGLE_STRIP };
|
||||
|
||||
struct VertexAttribute {
|
||||
u32 binding = 0;
|
||||
u32 location = 0;
|
||||
@@ -25,8 +31,6 @@ namespace Nova {
|
||||
InputRate rate = InputRate::VERTEX;
|
||||
};
|
||||
|
||||
struct RenderPassParams {};
|
||||
|
||||
struct GraphicsPipelineParams {
|
||||
std::vector<ShaderID> shaders;
|
||||
std::vector<VertexBinding> bindings;
|
||||
@@ -54,6 +58,4 @@ namespace Nova {
|
||||
RenderPassID render_pass = nullptr;
|
||||
u32 subpass = 0;
|
||||
};
|
||||
|
||||
struct ComputePipelineParams {};
|
||||
} // namespace Nova
|
||||
13
engine/include/nova/render/params/render_pass.h
Normal file
13
engine/include/nova/render/params/render_pass.h
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Copyright (c) 2025, Jayden Grubb <contact@jaydengrubb.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace Nova {
|
||||
struct RenderPassParams {
|
||||
// TODO
|
||||
};
|
||||
} // namespace Nova
|
||||
@@ -7,7 +7,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <nova/api.h>
|
||||
#include <nova/render/render_fwd.h>
|
||||
#include <nova/render/render_structs.h>
|
||||
#include <nova/types.h>
|
||||
|
||||
#include <initializer_list>
|
||||
@@ -15,13 +15,15 @@
|
||||
#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 };
|
||||
class RenderDriver;
|
||||
|
||||
enum class DeviceVendor { UNKNOWN = 0, INTEL = 0x8086, AMD = 0x1002, NVIDIA = 0x10de };
|
||||
enum class DeviceType { OTHER = 0, INTEGRATED = 1, DISCRETE = 2, VIRTUAL = 3, CPU = 4 };
|
||||
|
||||
struct NOVA_API RenderDevice {
|
||||
std::string name;
|
||||
Vendor vendor;
|
||||
Type type;
|
||||
DeviceVendor vendor;
|
||||
DeviceType type;
|
||||
u32 deviceID;
|
||||
void* handle;
|
||||
|
||||
|
||||
@@ -7,14 +7,25 @@
|
||||
#pragma once
|
||||
|
||||
#include <nova/api.h>
|
||||
#include <nova/platform/window_fwd.h>
|
||||
#include <nova/render/render_fwd.h>
|
||||
#include <nova/platform/platform_structs.h>
|
||||
#include <nova/render/params/compute_pipeline.h>
|
||||
#include <nova/render/params/graphics_pipeline.h>
|
||||
#include <nova/render/params/render_pass.h>
|
||||
#include <nova/render/render_device.h>
|
||||
#include <nova/render/render_structs.h>
|
||||
#include <nova/types.h>
|
||||
|
||||
#include <span>
|
||||
#include <string>
|
||||
|
||||
namespace Nova {
|
||||
class WindowDriver;
|
||||
|
||||
enum class PipelineType { GRAPHICS, COMPUTE };
|
||||
enum class QueueType { UNDEFINED, GRAPHICS, COMPUTE, TRANSFER };
|
||||
enum class RenderAPI { DX12, VULKAN };
|
||||
enum class ShaderStage { VERTEX, FRAGMENT, GEOMETRY, TESS_CONTROL, TESS_EVAL, COMPUTE, MESH, TASK };
|
||||
|
||||
class NOVA_API RenderDriver {
|
||||
public:
|
||||
static RenderDriver* create(RenderAPI api, WindowDriver* window_driver = nullptr);
|
||||
@@ -31,7 +42,7 @@ namespace Nova {
|
||||
virtual void select_device(u32 index) = 0;
|
||||
|
||||
virtual u32 choose_queue_family(QueueType type, SurfaceID surface) = 0;
|
||||
|
||||
|
||||
[[nodiscard]] virtual QueueID get_queue(u32 queue_family) = 0;
|
||||
virtual void free_queue(QueueID queue) = 0;
|
||||
|
||||
|
||||
27
engine/include/nova/render/render_structs.h
Normal file
27
engine/include/nova/render/render_structs.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Copyright (c) 2025, Jayden Grubb <contact@jaydengrubb.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace Nova {
|
||||
struct CommandBuffer;
|
||||
struct CommandPool;
|
||||
struct Pipeline;
|
||||
struct Queue;
|
||||
struct RenderPass;
|
||||
struct Shader;
|
||||
struct Surface;
|
||||
struct Swapchain;
|
||||
|
||||
using CommandBufferID = CommandBuffer*;
|
||||
using CommandPoolID = CommandPool*;
|
||||
using PipelineID = Pipeline*;
|
||||
using QueueID = Queue*;
|
||||
using RenderPassID = RenderPass*;
|
||||
using ShaderID = Shader*;
|
||||
using SurfaceID = Surface*;
|
||||
using SwapchainID = Swapchain*;
|
||||
} // namespace Nova
|
||||
@@ -1,19 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2025, Jayden Grubb <contact@jaydengrubb.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <nova/api.h>
|
||||
#include <nova/render/render_fwd.h>
|
||||
|
||||
namespace Nova {
|
||||
class NOVA_API Renderer {
|
||||
public:
|
||||
static void init(RenderAPI api);
|
||||
static void shutdown();
|
||||
static RenderDriver* get_driver();
|
||||
};
|
||||
} // namespace Nova
|
||||
Reference in New Issue
Block a user