Line data Source code
1 : /* Copyright (C) 2026 Wildfire Games.
2 : * This file is part of 0 A.D.
3 : *
4 : * 0 A.D. is free software: you can redistribute it and/or modify
5 : * it under the terms of the GNU General Public License as published by
6 : * the Free Software Foundation, either version 2 of the License, or
7 : * (at your option) any later version.
8 : *
9 : * 0 A.D. is distributed in the hope that it will be useful,
10 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 : * GNU General Public License for more details.
13 : *
14 : * You should have received a copy of the GNU General Public License
15 : * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16 : */
17 :
18 : #ifndef INCLUDED_RENDERER_BACKEND_FORMAT
19 : #define INCLUDED_RENDERER_BACKEND_FORMAT
20 :
21 : namespace Renderer
22 : {
23 :
24 : namespace Backend
25 : {
26 :
27 : enum class Format
28 : {
29 : UNDEFINED,
30 : R8_UNORM,
31 : R8G8_UNORM,
32 : R8G8_UINT,
33 : R8G8B8_UNORM,
34 : R8G8B8A8_UNORM,
35 : R8G8B8A8_SRGB,
36 : R8G8B8A8_UINT,
37 : B8G8R8A8_UNORM,
38 : B8G8R8A8_SRGB,
39 :
40 : // TODO: we need to drop legacy A8 and L8 formats as soon as we have proper
41 : // channel swizzling.
42 : A8_UNORM,
43 : L8_UNORM,
44 :
45 : R16_UNORM,
46 : R16_UINT,
47 : R16_SINT,
48 : R16_SFLOAT,
49 : R16G16_UNORM,
50 : R16G16_UINT,
51 : R16G16_SINT,
52 : R16G16_SFLOAT,
53 : R16G16B16_SFLOAT,
54 : R16G16B16A16_SFLOAT,
55 :
56 : R32_SFLOAT,
57 : R32G32_SFLOAT,
58 : R32G32B32_SFLOAT,
59 : R32G32B32A32_SFLOAT,
60 :
61 : B10G11R11_UFLOAT,
62 :
63 : D16_UNORM,
64 : D24_UNORM,
65 : D24_UNORM_S8_UINT,
66 : D32_SFLOAT,
67 : D32_SFLOAT_S8_UINT,
68 :
69 : BC1_RGB_UNORM,
70 : BC1_RGB_SRGB,
71 : BC1_RGBA_UNORM,
72 : BC1_RGBA_SRGB,
73 : BC2_UNORM,
74 : BC2_SRGB,
75 : BC3_UNORM,
76 : BC3_SRGB,
77 : };
78 :
79 0 : inline bool IsDepthFormat(const Format format)
80 : {
81 0 : return
82 : format == Format::D16_UNORM ||
83 : format == Format::D24_UNORM ||
84 : format == Format::D24_UNORM_S8_UINT ||
85 0 : format == Format::D32_SFLOAT ||
86 : format == Format::D32_SFLOAT_S8_UINT;
87 : }
88 :
89 : } // namespace Backend
90 :
91 : } // namespace Renderer
92 :
93 : #endif // INCLUDED_RENDERER_BACKEND_FORMAT
|