SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
VulkanDevice.h
1#pragma once
2
3#include "spark/render/DeviceState.h"
4#include "spark/render/GraphicsDevice.h"
5#include "spark/render/Image.h"
6#include "spark/render/Resource.h"
7#include "spark/render/vk/Export.h"
8#include "spark/render/vk/Helpers.h"
9#include "spark/render/vk/VulkanFactory.h"
10#include "spark/render/vk/VulkanGraphicsAdapter.h"
11#include "spark/render/vk/VulkanQueue.h"
12#include "spark/render/vk/VulkanRenderPass.h"
13#include "spark/render/vk/VulkanSurface.h"
14#include "spark/render/vk/VulkanSwapChain.h"
15
16SPARK_FWD_DECLARE_VK_HANDLE(VkDevice)
17
18namespace spark::render::vk
19{
23 class SPARK_RENDER_VK_EXPORT VulkanDevice final : public GraphicsDevice<VulkanFactory, VulkanSurface, VulkanGraphicsAdapter, VulkanSwapChain, VulkanQueue, VulkanRenderPass>,
24 public Resource<VkDevice>
25 {
26 public:
33 explicit VulkanDevice(const VulkanGraphicsAdapter& adapter, std::unique_ptr<VulkanSurface>&& surface, std::span<std::string> extensions = {});
34
44 explicit VulkanDevice(const VulkanGraphicsAdapter& adapter,
45 std::unique_ptr<VulkanSurface>&& surface,
46 Format format,
47 const math::Vector2<unsigned>& frame_buffer_size,
48 unsigned frame_buffers,
49 std::span<std::string> extensions = {});
50 ~VulkanDevice() override;
51
52 VulkanDevice(const VulkanDevice& other) = delete;
53 VulkanDevice(VulkanDevice&& other) noexcept = delete;
54 VulkanDevice& operator=(const VulkanDevice& other) = delete;
55 VulkanDevice& operator=(VulkanDevice&& other) noexcept = delete;
56
61 [[nodiscard]] std::span<std::string> enabledExtensions() const noexcept;
62
64 [[nodiscard]] MultiSamplingLevel maximumMultiSamplingLevel(Format format) const noexcept override;
65
67 [[nodiscard]] double ticksPerMillisecond() const noexcept override;
68
70 void wait() const override;
71
73 [[nodiscard]] DeviceState& state() noexcept override;
74
76 [[nodiscard]] const VulkanSurface& surface() const noexcept override;
77
79 [[nodiscard]] const VulkanGraphicsAdapter& graphicsAdapter() const noexcept override;
80
82 [[nodiscard]] const VulkanFactory& factory() const noexcept override;
83
85 [[nodiscard]] const VulkanSwapChain& swapChain() const noexcept override;
86
88 [[nodiscard]] VulkanSwapChain& swapChain() noexcept override;
89
91 [[nodiscard]] const VulkanQueue& graphicsQueue() const noexcept override;
92
94 [[nodiscard]] const VulkanQueue& transferQueue() const noexcept override;
95
97 [[nodiscard]] const VulkanQueue& bufferQueue() const noexcept override;
98
100 [[nodiscard]] const VulkanQueue& computeQueue() const noexcept override;
101
102 private:
103 struct Impl;
104 std::unique_ptr<Impl> m_impl;
105 };
106}
A vector with two components.
Definition Vector2.h:13
A class used to manage the state of a IGraphicsDevice.
Definition DeviceState.h:27
Represents the graphics device that a rendering back-end is doing work on.
Definition GraphicsDevice.h:121
Definition Resource.h:34
Vulkan implementation of IGraphicsDevice.
Definition VulkanDevice.h:25
Vulkan implementation of IGraphicsFactory.
Definition VulkanFactory.h:18
Implementation of IGraphicsAdapter for Vulkan.
Definition VulkanGraphicsAdapter.h:21
Vulkan implementation of ICommandQueue.
Definition VulkanQueue.h:23
Implementation of ISurface for Vulkan.
Definition VulkanSurface.h:19
Vulkan implementation of ISwapChain.
Definition VulkanSwapChain.h:22
Definition VulkanDevice.cpp:88