blob: 48f4abcc65894722e89b4eb941f196b9e5125fa0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
# Includes
## Header files
Includes in the source file should go in the following order:
1. System includes and standard headers
2. Diligent Engine interface headers
3. Header for the base object implementation, if any
4. Headers of the object implementations
5. Other headers required by this header file
Example:
```cpp
// DeviceContextD3D12Impl.hpp
// 1 - System includes and standard headers
#include <unordered_map>
#include <vector>
// 2 - System includes and standard headers
#include "DeviceContextD3D12.h"
// 3 - Header for the base object implementation
#include "DeviceContextNextGenBase.hpp"
// 4 - Headers of the object implementations
#include "BufferD3D12Impl.hpp"
#include "TextureD3D12Impl.hpp"
#include "QueryD3D12Impl.hpp"
#include "FramebufferD3D12Impl.hpp"
#include "RenderPassD3D12Impl.hpp"
#include "PipelineStateD3D12Impl.hpp"
#include "D3D12DynamicHeap.hpp"
#include "BottomLevelASD3D12Impl.hpp"
#include "TopLevelASD3D12Impl.hpp"
// 5 - Other headers
#include "D3D12DynamicHeap.hpp"
```
## Source files
Includes in the source file should go in the following order:
1. Precompiled header (if any)
2. The source file's header
3. System includes and standard headers
4. Diligent Engine interface headers
5. Headers of the object implementations
6. Other headers required by this source file
Example:
```cpp
// DeviceContextD3D12Impl.cpp
// 1 - Precompiled header
#include "pch.h"
// 2 - The source file's header
#include "DeviceContextD3D12Impl.hpp"
// 3 - System includes and standard headers
#include <sstream>
// 4 - Interface headers
#include "RenderDeviceD3D12.hpp"
#include "DeviceContextD3D12.hpp"
// 5 - Headers of the object implementations
#include "RenderDeviceD3D12Impl.hpp" // Render device always goes first, if any
#include "PipelineStateD3D12Impl.hpp"
#include "TextureD3D12Impl.hpp"
#include "BufferD3D12Impl.hpp"
#include "FenceD3D12Impl.hpp"
#include "ShaderBindingTableD3D12Impl.hpp"
#include "ShaderResourceBindingD3D12Impl.hpp"
#include "CommandListD3D12Impl.hpp"
// 6 - Other headers required by this source file
#include "CommandContext.hpp"
#include "D3D12TypeConversions.hpp"
#include "d3dx12_win.h"
#include "D3D12DynamicHeap.hpp"
#include "DXGITypeConversions.hpp"
```
When there is more than one header in each group, it is recommended to separate the groups with blank lines.
# Exceptions
# Naming conventions
# Debug macros
|