SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
VulkanIndexBuffer.h
1#pragma once
2
3#include "spark/render/IndexBuffer.h"
4#include "spark/render/vk/Export.h"
5#include "spark/render/vk/VulkanBuffer.h"
6#include "spark/render/vk/VulkanIndexBufferLayout.h"
7
8namespace spark::render::vk
9{
13 class SPARK_RENDER_VK_EXPORT IVulkanIndexBuffer : public virtual IVulkanBuffer, public virtual IIndexBuffer
14 {
15 public:
17 };
18
19 SPARK_WARNING_PUSH
20 SPARK_DISABLE_MSVC_WARNING(4250) // 'VulkanIndexBuffer' : inherits 'StateResource::name' via dominance
21
22
25 class SPARK_RENDER_VK_EXPORT VulkanIndexBuffer final : public VulkanBuffer, public IVulkanIndexBuffer
26 {
27 public:
37 explicit VulkanIndexBuffer(VkBuffer buffer,
38 const VulkanIndexBufferLayout& layout,
39 unsigned elements,
40 const VmaAllocator& allocator,
41 const VmaAllocation& allocation,
42 const std::string& name = "");
43 ~VulkanIndexBuffer() override;
44
45 VulkanIndexBuffer(const VulkanIndexBuffer& other) = delete;
46 VulkanIndexBuffer(VulkanIndexBuffer&& other) noexcept = delete;
47 VulkanIndexBuffer& operator=(const VulkanIndexBuffer& other) = delete;
48 VulkanIndexBuffer& operator=(VulkanIndexBuffer&& other) noexcept = delete;
49
60 static std::unique_ptr<IVulkanIndexBuffer> Allocate(const VulkanIndexBufferLayout& layout,
61 unsigned elements,
62 const VmaAllocator& allocator,
63 const VkBufferCreateInfo& create_info,
64 const VmaAllocationCreateInfo& allocation_info,
65 VmaAllocationInfo* allocation_result = nullptr);
66
78 static std::unique_ptr<IVulkanIndexBuffer> Allocate(const std::string& name,
79 const VulkanIndexBufferLayout& layout,
80 unsigned elements,
81 const VmaAllocator& allocator,
82 const VkBufferCreateInfo& create_info,
83 const VmaAllocationCreateInfo& allocation_info,
84 VmaAllocationInfo* allocation_result = nullptr);
85
87 [[nodiscard]] const VulkanIndexBufferLayout& layout() const noexcept override;
88
89 private:
90 struct Impl;
91 std::unique_ptr<Impl> m_impl;
92 };
93
94 SPARK_WARNING_POP
95}
Describes an index buffer.
Definition IndexBuffer.h:39
Vulkan interface for a IBuffer.
Definition VulkanBuffer.h:22
Vulkan interface for an IIndexBuffer.
Definition VulkanIndexBuffer.h:14
Vulkan implementation of IBuffer.
Definition VulkanBuffer.h:31
Implements IIndexBufferLayout for Vulkan.
Definition VulkanIndexBufferLayout.h:12
Vulkan implementation of an IIndexBuffer.
Definition VulkanIndexBuffer.h:26
Definition VulkanIndexBuffer.cpp:11