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 bool operator==(const BufferDescription& other) const {
19 return size == other.size &&
20 bufferUsage == other.bufferUsage &&
21 memoryUsage == other.memoryUsage;
22 }
23
24 bool operator!=(const BufferDescription& other) const {
25 return !(*this == other);
26 }
27 };
28}
29
30namespace std {
31 template<>
32 struct hash<Grindstone::Renderer::BufferDescription> {
33 std::size_t operator()(const Grindstone::Renderer::BufferDescription& desc) const noexcept {
34 size_t result = std::hash<size_t>{}(
35 static_cast<size_t>(desc.bufferUsage) |
36 static_cast<size_t>(desc.memoryUsage) << 32
37 );
38
39 result ^= std::hash<size_t>{}(static_cast<size_t>(desc.size));
40 return result;
41 }
42 };
43}
Definition BufferInfo.hpp:12