Pyrogenesis  trunk
Format.h
Go to the documentation of this file.
1 /* Copyright (C) 2023 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,
36 
37  // TODO: we need to drop legacy A8 and L8 formats as soon as we have proper
38  // channel swizzling.
39  A8_UNORM,
40  L8_UNORM,
41 
42  R16_UNORM,
43  R16_UINT,
44  R16_SINT,
48 
49  R32_SFLOAT,
53 
54  D16_UNORM,
55  D24_UNORM,
57  D32_SFLOAT,
59 
62  BC2_UNORM,
63  BC3_UNORM
64 };
65 
66 inline bool IsDepthFormat(const Format format)
67 {
68  return
69  format == Format::D16_UNORM ||
70  format == Format::D24_UNORM ||
71  format == Format::D24_UNORM_S8_UINT ||
72  format == Format::D32_SFLOAT ||
74 }
75 
76 } // namespace Backend
77 
78 } // namespace Renderer
79 
80 #endif // INCLUDED_RENDERER_BACKEND_FORMAT
Format
Definition: Format.h:27
Backend
Definition: Backend.h:27
Definition: VideoMode.h:28
bool IsDepthFormat(const Format format)
Definition: Format.h:66