Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
Loading...
Searching...
No Matches
BufferInfo.hpp
1#pragma once
2
3#include <vector>
4#include <string>
5#include <map>
6#include <stdint.h>
7
8#include <Common/Graphics/Buffer.hpp>
9#include <Common/Graphics/Formats.hpp>
10
11namespace Grindstone::Renderer {
13 Grindstone::String name;
14 size_t size = 0;
15 Grindstone::GraphicsAPI::BufferUsage bufferUsage;
16 Grindstone::GraphicsAPI::MemoryUsage memoryUsage;
17
18 Grindstone::GraphicsAPI::AccessFlags externalInitialAccessFlags;
19 Grindstone::GraphicsAPI::PipelineStageBit externalInitialPipelineStage;
20 Grindstone::GraphicsAPI::ImageLayout externalFinalLayout;
21 Grindstone::GraphicsAPI::AccessFlags externalFinalAccessFlags;
22 Grindstone::GraphicsAPI::PipelineStageBit externalFinalPipelineStage;
23 std::function<Grindstone::GraphicsAPI::Buffer* ()> externalGetterCallback;
24
25 bool operator==(const BufferDescription& other) const {
26 return size == other.size &&
27 bufferUsage == other.bufferUsage &&
28 memoryUsage == other.memoryUsage;
29 }
30
31 bool operator!=(const BufferDescription& other) const {
32 return !(*this == other);
33 }
34 };
35}
36
37namespace std {
38 template<>
39 struct hash<Grindstone::Renderer::BufferDescription> {
40 std::size_t operator()(const Grindstone::Renderer::BufferDescription& desc) const noexcept {
41 size_t result = std::hash<size_t>{}(
42 static_cast<size_t>(desc.bufferUsage) |
43 static_cast<size_t>(desc.memoryUsage) << 32
44 );
45
46 result ^= std::hash<size_t>{}(static_cast<size_t>(desc.size));
47 return result;
48 }
49 };
50}
Definition Buffer.hpp:49
Definition AttachmentInfo.hpp:17
Definition Assert.hpp:16
Definition DescriptorSetLayout.hpp:65
Definition BufferInfo.hpp:12