Cogs.Rendering
Loading...
Searching...
No Matches
DataFormat.h
Go to the documentation of this file.
1#pragma once
2
3#include "Flags.h"
4
5namespace Cogs
6{
7 class StringView;
8
9 enum struct FormatFlags : uint32_t
10 {
11 None = 0,
12 Alpha = 1 << 0,
13 VertexFormat = 1 << 1,
14 Depth = 1 << 2,
15 Typeless = 1 << 3,
16 Integer = 1 << 4,
17 Unsigned = 1 << 5
18 };
20
21 enum class Format : uint16_t
22 {
23 Unknown = 0,
24
25 // Unsigned normalized byte formats
26
31
32 // Unsigned 16 bit normalized integer formats
33
38
39 // Signed normalized byte formats
40
45
46 // Signed 16 bit normalized integer formats
47
52
53 // Unsigned byte formats
54
55 R8_UINT,
59
60 // Unsigned 16 bit integer formats
61
66
67 // Unsigned 32 bit integer formats
68
73
74 // Signed byte formats
75
76 R8_SINT,
80
81 // Signed 16 bit integer formats
82
87
88 // Signed 32 bit integer formats
89
94
95 // 16 bit floating point formats
96
101
102 // 32 bit floating point formats
103
104 R32_FLOAT,
108
109 // Depth buffer formats
110
111 D16_UNORM,
112 D24_UNORM,
114 D32_FLOAT,
117
118 // 8 bit typeless formats
119
120 R8T,
121 R8G8T,
122 R8G8B8T,
123 R8G8B8A8T,
124
125 // Reverse component order formats.
126
127 B8G8R8,
128 B8G8R8A8,
129
130 // Alpha formats
131
132 A8_UNORM,
133
134 // Compressed formats
135
137 BC1_UNORM,
140 BC2_UNORM,
143 BC3_UNORM,
146 BC4_UNORM,
147 BC4_SNORM,
149 BC5_UNORM,
150 BC5_SNORM,
151
152 // BC7
153
158
159 // PRTVC_V1
164
165 // ETC
170
175
176 // ASTC
191 // ASTC SRGBA
206
207 // SRGB formats
208
211
212 // Packed formats
213
222
223 // Matrix format for instancing
224
226
227 // Utility
228
231
232 // Format aliases
233
238
243 };
244
247
249 {
250 uint32_t width = 0;
251 uint32_t height = 0;
252 uint32_t depth = 0;
253 };
254
256 {
257 uint8_t blockSize = 0;
259 uint16_t elements = 0;
260 const char * name = nullptr;
261 const char * vName = nullptr;
263 };
264
266
267 COGSRENDERING_DLL_API DataFormat parseDataFormat(const StringView& format);
268
269}
#define COGSRENDERING_DLL_API
Definition: Base.h:20
#define COGS_RENDERING_ENABLE_ENUM_FLAGS(EnumType)
Definition: Flags.h:8
Definition: Base.h:24
@ Unknown
Unknown type of graphics device.
COGSRENDERING_DLL_API const FormatInfo * getFormatInfo(Format format)
Definition: DataFormat.cpp:218
COGSRENDERING_DLL_API DataFormat parseDataFormat(const StringView &format)
Definition: DataFormat.cpp:223
@ None
Default flags.
Definition: IGraphicsDevice.h:30
Format
Definition: DataFormat.h:22
@ ETC2_BLOCK16_UNORM_RGBA
@ EAC_BLOCK8_UNSIGNED_FLOAT_R
@ EAC_BLOCK16_SIGNED_FLOAT_RG
@ PVRTC1_4BPP_UNORM_RGBA
@ ASTC_10x10_UNORM_SRGBA
@ ETC2_BLOCK16_UNORM_SRGBA
@ ASTC_12x10_UNORM_SRGBA
@ BC6H_UNSIGNED_FLOAT_RGB
@ ASTC_12x12_UNORM_SRGBA
@ EAC_BLOCK16_UNSIGNED_FLOAT_RG
@ EAC_BLOCK8_SIGNED_FLOAT_R
@ ETC2_BLOCK8_UNORM_SRGB
@ PVRTC1_2BPP_UNORM_RGBA
FormatFlags
Definition: DataFormat.h:10
Definition: DataFormat.h:256
uint16_t elements
Number of channels in a data item.
Definition: DataFormat.h:259
uint8_t blockSize
Bytesize of one block of data.
Definition: DataFormat.h:257
TextureExtent blockExtent
Number of data items in a block.
Definition: DataFormat.h:258
const char * vName
Name as a vertex format (using XYZW as channels).
Definition: DataFormat.h:261
const char * name
Name as a color format (using RGBA as channels).
Definition: DataFormat.h:260
FormatFlags flags
See FormatFlags.
Definition: DataFormat.h:262
Definition: DataFormat.h:249
uint32_t depth
Definition: DataFormat.h:252
uint32_t width
Definition: DataFormat.h:250
uint32_t height
Definition: DataFormat.h:251
Vertex format structure used to describe a single vertex for the input assembler.
Definition: VertexFormat.h:60