├── .gitignore
├── Assets
├── LockScreenLogo.scale-200.png
├── SplashScreen.scale-200.png
├── Square150x150Logo.scale-200.png
├── Square44x44Logo.scale-200.png
├── Square44x44Logo.targetsize-24_altform-unplated.png
├── StoreLogo.png
└── Wide310x150Logo.scale-200.png
├── FlipModelD3D12.sln
├── FlipModelD3D12.vcxproj
├── FlipModelD3D12.vcxproj.filters
├── FlipModelUniversal.vcxproj
├── FlipModelUniversal.vcxproj.filters
├── FlipModelUniversal_TemporaryKey.pfx
├── Package.appxmanifest
├── Readme.md
├── Source
├── App.cpp
├── App.h
├── DX12Helpers.cpp
├── DX12Helpers.hpp
├── EventViz.cpp
├── EventViz.hpp
├── PresentQueueStats.hpp
├── WindowsHelpers.cpp
├── WindowsHelpers.hpp
├── d3dx12.h
├── pixel_shader.hlsl
├── sample_cube.cpp
├── sample_cube.hpp
├── sample_dx12.cpp
├── sample_dx12.hpp
├── sample_game.cpp
├── sample_game.hpp
├── sample_main.cpp
├── sample_math.cpp
├── sample_math.hpp
├── timeline_multimap.hpp
├── vertex_shader.hlsl
├── wsi.cpp
├── wsi.hpp
├── wsi_utils.cpp
└── wsi_utils.hpp
├── license.txt
├── thumbnail_320.png
└── thumbnail_full.png
/.gitignore:
--------------------------------------------------------------------------------
1 | /.vs/
2 | /ARM/
3 | /Debug/
4 | /Release/
5 | /Win32/
6 | /x64/
7 | /Generated Files/
8 | /Source/pixel_shader.h
9 | /Source/vertex_shader.h
10 | /log.txt
11 | /FlipModelD3D12.VC.db
12 | /FlipModelD3D12.sdf
13 | /FlipModelD3D12.v11.suo
14 |
--------------------------------------------------------------------------------
/Assets/LockScreenLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameTechDev/FlipModelD3D12/f6f9233abd6957a77a1cf0d41050a3529352bf5a/Assets/LockScreenLogo.scale-200.png
--------------------------------------------------------------------------------
/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameTechDev/FlipModelD3D12/f6f9233abd6957a77a1cf0d41050a3529352bf5a/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameTechDev/FlipModelD3D12/f6f9233abd6957a77a1cf0d41050a3529352bf5a/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/Assets/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameTechDev/FlipModelD3D12/f6f9233abd6957a77a1cf0d41050a3529352bf5a/Assets/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/Assets/Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameTechDev/FlipModelD3D12/f6f9233abd6957a77a1cf0d41050a3529352bf5a/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/Assets/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameTechDev/FlipModelD3D12/f6f9233abd6957a77a1cf0d41050a3529352bf5a/Assets/StoreLogo.png
--------------------------------------------------------------------------------
/Assets/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameTechDev/FlipModelD3D12/f6f9233abd6957a77a1cf0d41050a3529352bf5a/Assets/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/FlipModelD3D12.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.24720.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FlipModelD3D12", "FlipModelD3D12.vcxproj", "{11EB5ED2-B797-47AF-825D-23DF434C97B5}"
7 | EndProject
8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FlipModelUniversal", "FlipModelUniversal.vcxproj", "{525F2141-A251-47B0-8E92-E631ABF3A5FA}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|ARM = Debug|ARM
13 | Debug|x64 = Debug|x64
14 | Debug|x86 = Debug|x86
15 | Release|ARM = Release|ARM
16 | Release|x64 = Release|x64
17 | Release|x86 = Release|x86
18 | EndGlobalSection
19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
20 | {11EB5ED2-B797-47AF-825D-23DF434C97B5}.Debug|ARM.ActiveCfg = Debug|Win32
21 | {11EB5ED2-B797-47AF-825D-23DF434C97B5}.Debug|x64.ActiveCfg = Debug|x64
22 | {11EB5ED2-B797-47AF-825D-23DF434C97B5}.Debug|x64.Build.0 = Debug|x64
23 | {11EB5ED2-B797-47AF-825D-23DF434C97B5}.Debug|x86.ActiveCfg = Debug|Win32
24 | {11EB5ED2-B797-47AF-825D-23DF434C97B5}.Debug|x86.Build.0 = Debug|Win32
25 | {11EB5ED2-B797-47AF-825D-23DF434C97B5}.Release|ARM.ActiveCfg = Release|Win32
26 | {11EB5ED2-B797-47AF-825D-23DF434C97B5}.Release|x64.ActiveCfg = Release|x64
27 | {11EB5ED2-B797-47AF-825D-23DF434C97B5}.Release|x64.Build.0 = Release|x64
28 | {11EB5ED2-B797-47AF-825D-23DF434C97B5}.Release|x86.ActiveCfg = Release|Win32
29 | {11EB5ED2-B797-47AF-825D-23DF434C97B5}.Release|x86.Build.0 = Release|Win32
30 | {525F2141-A251-47B0-8E92-E631ABF3A5FA}.Debug|ARM.ActiveCfg = Debug|ARM
31 | {525F2141-A251-47B0-8E92-E631ABF3A5FA}.Debug|ARM.Build.0 = Debug|ARM
32 | {525F2141-A251-47B0-8E92-E631ABF3A5FA}.Debug|ARM.Deploy.0 = Debug|ARM
33 | {525F2141-A251-47B0-8E92-E631ABF3A5FA}.Debug|x64.ActiveCfg = Debug|x64
34 | {525F2141-A251-47B0-8E92-E631ABF3A5FA}.Debug|x64.Build.0 = Debug|x64
35 | {525F2141-A251-47B0-8E92-E631ABF3A5FA}.Debug|x64.Deploy.0 = Debug|x64
36 | {525F2141-A251-47B0-8E92-E631ABF3A5FA}.Debug|x86.ActiveCfg = Debug|Win32
37 | {525F2141-A251-47B0-8E92-E631ABF3A5FA}.Debug|x86.Build.0 = Debug|Win32
38 | {525F2141-A251-47B0-8E92-E631ABF3A5FA}.Debug|x86.Deploy.0 = Debug|Win32
39 | {525F2141-A251-47B0-8E92-E631ABF3A5FA}.Release|ARM.ActiveCfg = Release|ARM
40 | {525F2141-A251-47B0-8E92-E631ABF3A5FA}.Release|ARM.Build.0 = Release|ARM
41 | {525F2141-A251-47B0-8E92-E631ABF3A5FA}.Release|ARM.Deploy.0 = Release|ARM
42 | {525F2141-A251-47B0-8E92-E631ABF3A5FA}.Release|x64.ActiveCfg = Release|x64
43 | {525F2141-A251-47B0-8E92-E631ABF3A5FA}.Release|x64.Build.0 = Release|x64
44 | {525F2141-A251-47B0-8E92-E631ABF3A5FA}.Release|x64.Deploy.0 = Release|x64
45 | {525F2141-A251-47B0-8E92-E631ABF3A5FA}.Release|x86.ActiveCfg = Release|Win32
46 | {525F2141-A251-47B0-8E92-E631ABF3A5FA}.Release|x86.Build.0 = Release|Win32
47 | {525F2141-A251-47B0-8E92-E631ABF3A5FA}.Release|x86.Deploy.0 = Release|Win32
48 | EndGlobalSection
49 | GlobalSection(SolutionProperties) = preSolution
50 | HideSolutionNode = FALSE
51 | EndGlobalSection
52 | EndGlobal
53 |
--------------------------------------------------------------------------------
/FlipModelD3D12.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Debug
10 | x64
11 |
12 |
13 | Release
14 | Win32
15 |
16 |
17 | Release
18 | x64
19 |
20 |
21 |
22 | {11EB5ED2-B797-47AF-825D-23DF434C97B5}
23 | Win32Proj
24 | WSI
25 | 10.0.10240.0
26 | FlipModelD3D12
27 |
28 |
29 |
30 | Application
31 | true
32 | v140
33 |
34 |
35 | Application
36 | true
37 | v140
38 |
39 |
40 | Application
41 | false
42 | v140
43 | true
44 |
45 |
46 | Application
47 | false
48 | v140
49 | true
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 | true
69 | $(SolutionDir)$(Platform)\$(ProjectName)\$(Configuration)\
70 | $(Platform)\$(ProjectName)\$(Configuration)\
71 |
72 |
73 | true
74 | $(SolutionDir)$(Platform)\$(ProjectName)\$(Configuration)\
75 | $(Platform)\$(ProjectName)\$(Configuration)\
76 |
77 |
78 | false
79 | $(SolutionDir)$(Platform)\$(ProjectName)\$(Configuration)\
80 | $(Platform)\$(ProjectName)\$(Configuration)\
81 |
82 |
83 | false
84 | $(SolutionDir)$(Platform)\$(ProjectName)\$(Configuration)\
85 | $(Platform)\$(ProjectName)\$(Configuration)\
86 |
87 |
88 |
89 |
90 |
91 | Disabled
92 | WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)
93 | .
94 | Level3
95 | MultiThreadedDebug
96 |
97 |
98 | Windows
99 | true
100 | %(AdditionalLibraryDirectories)
101 |
102 |
103 |
104 |
105 |
106 |
107 | Disabled
108 | WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)
109 | .
110 | Level3
111 | MultiThreadedDebug
112 |
113 |
114 | Windows
115 | true
116 | %(AdditionalLibraryDirectories)
117 |
118 |
119 |
120 |
121 |
122 |
123 | MaxSpeed
124 | true
125 | true
126 | WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)
127 | .
128 | Level3
129 | MultiThreaded
130 |
131 |
132 | Windows
133 | true
134 | true
135 | true
136 | %(AdditionalLibraryDirectories)
137 |
138 |
139 |
140 |
141 |
142 |
143 | MaxSpeed
144 | true
145 | true
146 | WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)
147 | .
148 | Level3
149 | MultiThreaded
150 |
151 |
152 | Windows
153 | true
154 | true
155 | true
156 | %(AdditionalLibraryDirectories)
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 | pixel_shader
188 | 4.0
189 |
190 |
191 | Pixel
192 | %(RelativeDir)%(Filename).h
193 |
194 |
195 | vertex_shader
196 | 4.0
197 |
198 |
199 | Vertex
200 | %(RelativeDir)%(Filename).h
201 |
202 |
203 |
204 |
205 |
206 |
207 |
--------------------------------------------------------------------------------
/FlipModelD3D12.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Source
6 |
7 |
8 | Source
9 |
10 |
11 | Source
12 |
13 |
14 | Source
15 |
16 |
17 | Source
18 |
19 |
20 | Source
21 |
22 |
23 | Helpers
24 |
25 |
26 | Helpers
27 |
28 |
29 | Helpers
30 |
31 |
32 | Helpers
33 |
34 |
35 |
36 |
37 | Source
38 |
39 |
40 | Source
41 |
42 |
43 | Source
44 |
45 |
46 | Source
47 |
48 |
49 | Source
50 |
51 |
52 | Source
53 |
54 |
55 | Helpers
56 |
57 |
58 | Helpers
59 |
60 |
61 | Helpers
62 |
63 |
64 | Helpers
65 |
66 |
67 | Helpers
68 |
69 |
70 | Source
71 |
72 |
73 |
74 |
75 | {d4b9a023-4208-435c-9013-45bc90cf9289}
76 |
77 |
78 | {2faa99ad-c882-482d-b216-2efa61450d86}
79 |
80 |
81 | {81ba097c-1074-4231-85ee-c8e2a326482f}
82 |
83 |
84 |
85 |
86 | Shaders
87 |
88 |
89 | Shaders
90 |
91 |
92 |
--------------------------------------------------------------------------------
/FlipModelUniversal.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 | Debug
14 | x64
15 |
16 |
17 | Release
18 | x64
19 |
20 |
21 | Debug
22 | ARM
23 |
24 |
25 | Release
26 | ARM
27 |
28 |
29 |
30 | {525f2141-a251-47b0-8e92-e631abf3a5fa}
31 | DirectXApp
32 | FlipModelUniversal
33 | en-US
34 | 14.0
35 | true
36 | Windows Store
37 | 10.0.10240.0
38 | 10.0.10240.0
39 | 10.0
40 | true
41 |
42 |
43 |
44 | Application
45 | true
46 | v140
47 |
48 |
49 | Application
50 | true
51 | v140
52 |
53 |
54 | Application
55 | true
56 | v140
57 |
58 |
59 | Application
60 | false
61 | true
62 | v140
63 | true
64 |
65 |
66 | Application
67 | false
68 | true
69 | v140
70 | true
71 |
72 |
73 | Application
74 | false
75 | true
76 | v140
77 | true
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 | False
106 | Always
107 | x86|x64|arm
108 |
109 |
110 |
111 | mincore.lib;d3d12.lib;dxgi.lib;windowscodecs.lib;%(AdditionalDependencies)
112 | %(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\arm; $(VCInstallDir)\lib\arm
113 |
114 |
115 |
116 |
117 |
118 |
119 | $(ProjectDir);$(IntermediateOutputPath);%(AdditionalIncludeDirectories)
120 | /bigobj %(AdditionalOptions)
121 | 4453;28204
122 | _DEBUG;%(PreprocessorDefinitions)
123 | NotUsing
124 |
125 |
126 |
127 |
128 | mincore.lib;d3d12.lib;dxgi.lib;windowscodecs.lib;%(AdditionalDependencies)
129 | %(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\arm; $(VCInstallDir)\lib\arm
130 |
131 |
132 |
133 |
134 |
135 |
136 | $(ProjectDir);$(IntermediateOutputPath);%(AdditionalIncludeDirectories)
137 | /bigobj %(AdditionalOptions)
138 | 4453;28204
139 | NDEBUG;%(PreprocessorDefinitions)
140 | NotUsing
141 |
142 |
143 |
144 |
145 | mincore.lib;d3d12.lib;dxgi.lib;windowscodecs.lib;%(AdditionalDependencies)
146 | %(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store; $(VCInstallDir)\lib
147 |
148 |
149 |
150 |
151 |
152 |
153 | $(ProjectDir);$(IntermediateOutputPath);%(AdditionalIncludeDirectories)
154 | /bigobj %(AdditionalOptions)
155 | 4453;28204
156 | _DEBUG;%(PreprocessorDefinitions)
157 | NotUsing
158 |
159 |
160 |
161 |
162 | mincore.lib;d3d12.lib;dxgi.lib;windowscodecs.lib;%(AdditionalDependencies)
163 | %(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store; $(VCInstallDir)\lib
164 |
165 |
166 |
167 |
168 |
169 |
170 | $(ProjectDir);$(IntermediateOutputPath);%(AdditionalIncludeDirectories)
171 | /bigobj %(AdditionalOptions)
172 | 4453;28204
173 | NDEBUG;%(PreprocessorDefinitions)
174 | NotUsing
175 |
176 |
177 |
178 |
179 | d3d12.lib;dxgi.lib;%(AdditionalDependencies)
180 | %(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\amd64; $(VCInstallDir)\lib\amd64
181 |
182 |
183 |
184 |
185 |
186 |
187 | $(ProjectDir);$(IntermediateOutputPath);%(AdditionalIncludeDirectories)
188 | /bigobj %(AdditionalOptions)
189 | 4453;28204
190 | _DEBUG;%(PreprocessorDefinitions)
191 | NotUsing
192 |
193 |
194 |
195 |
196 | mincore.lib;d3d12.lib;dxgi.lib;windowscodecs.lib;%(AdditionalDependencies)
197 | %(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\amd64; $(VCInstallDir)\lib\amd64
198 |
199 |
200 |
201 |
202 |
203 |
204 | $(ProjectDir);$(IntermediateOutputPath);%(AdditionalIncludeDirectories)
205 | /bigobj %(AdditionalOptions)
206 | 4453;28204
207 | NDEBUG;%(PreprocessorDefinitions)
208 | NotUsing
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 | Designer
246 |
247 |
248 |
249 |
250 |
251 | pixel_shader
252 | %(RelativeDir)%(Filename).h
253 |
254 |
255 | pixel_shader
256 | %(RelativeDir)%(Filename).h
257 |
258 |
259 | pixel_shader
260 | %(RelativeDir)%(Filename).h
261 |
262 |
263 | pixel_shader
264 | %(RelativeDir)%(Filename).h
265 |
266 |
267 | pixel_shader
268 | %(RelativeDir)%(Filename).h
269 |
270 |
271 | pixel_shader
272 | %(RelativeDir)%(Filename).h
273 |
274 |
275 | 4.0
276 | 4.0
277 | 4.0
278 | 4.0
279 | 4.0
280 | 4.0
281 | Pixel
282 | Pixel
283 | Pixel
284 | Pixel
285 | Pixel
286 | Pixel
287 |
288 |
289 | vertex_shader
290 | vertex_shader
291 | vertex_shader
292 | vertex_shader
293 | vertex_shader
294 | vertex_shader
295 | %(RelativeDir)%(Filename).h
296 | %(RelativeDir)%(Filename).h
297 | %(RelativeDir)%(Filename).h
298 | %(RelativeDir)%(Filename).h
299 | %(RelativeDir)%(Filename).h
300 | %(RelativeDir)%(Filename).h
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 | 4.0
314 | 4.0
315 | 4.0
316 | 4.0
317 | 4.0
318 | 4.0
319 | Vertex
320 | Vertex
321 | Vertex
322 | Vertex
323 | Vertex
324 | Vertex
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
--------------------------------------------------------------------------------
/FlipModelUniversal.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | c0140414-759a-4040-abcb-ed452f5c87b7
6 | bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png
7 |
8 |
9 | Assets
10 |
11 |
12 | Assets
13 |
14 |
15 | Assets
16 |
17 |
18 | Assets
19 |
20 |
21 | Assets
22 |
23 |
24 | Assets
25 |
26 |
27 | Assets
28 |
29 |
30 | {1f5b3db8-5fa5-4b8c-92a2-ca3bfe05cdca}
31 |
32 |
33 | {5d881376-446a-4b56-a275-f402162c54a5}
34 |
35 |
36 | {e022284a-f824-413e-b20f-b850f1022727}
37 |
38 |
39 |
40 |
41 | Source
42 |
43 |
44 | Source
45 |
46 |
47 | Source
48 |
49 |
50 | Source
51 |
52 |
53 | Source
54 |
55 |
56 | Source
57 |
58 |
59 | Helpers
60 |
61 |
62 | Helpers
63 |
64 |
65 |
66 |
67 | Source
68 |
69 |
70 | Source
71 |
72 |
73 | Source
74 |
75 |
76 | Source
77 |
78 |
79 | Source
80 |
81 |
82 | Source
83 |
84 |
85 | Source
86 |
87 |
88 | Helpers
89 |
90 |
91 | Helpers
92 |
93 |
94 | Helpers
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 | Source
105 |
106 |
107 |
108 |
109 | Shaders
110 |
111 |
112 | Shaders
113 |
114 |
115 |
--------------------------------------------------------------------------------
/FlipModelUniversal_TemporaryKey.pfx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GameTechDev/FlipModelD3D12/f6f9233abd6957a77a1cf0d41050a3529352bf5a/FlipModelUniversal_TemporaryKey.pfx
--------------------------------------------------------------------------------
/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | FlipModelD3D12
7 | dbregman
8 | Assets\StoreLogo.png
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Readme.md:
--------------------------------------------------------------------------------
1 | # DISCONTINUATION OF PROJECT #
2 | This project will no longer be maintained by Intel.
3 | Intel has ceased development and contributions including, but not limited to, maintenance, bug fixes, new releases, or updates, to this project.
4 | Intel no longer accepts patches to this project.
5 | FlipModel D3D12 Sample Application
6 | ======================================================
7 | An interactive visualization for understanding the Direct3D 12 Flip Model.
8 |
9 | For a detailed explanation, please see this [article](https://software.intel.com/en-us/articles/sample-application-for-direct3d-12-flip-model-swap-chains).
10 |
11 | Build Instructions
12 | ==================
13 | FlipModelD3D12.sln contains two projects:
14 | - FlipModelD3D12, for building a regular (win32) desktop application.
15 | - FlipModelUniversal, for building a Windows 10 Universal App.
16 |
17 | Choose your start up project, build and run.
18 |
19 | Requirements
20 | ============
21 | - Windows 10 or greater
22 | - Visual Studio 2015 or higher
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Source/App.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | // Copyright 2017 Intel Corporation
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | // use this file except in compliance with the License. You may obtain a copy
6 | // of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | // License for the specific language governing permissions and limitations
14 | // under the License.
15 | ////////////////////////////////////////////////////////////////////////////////
16 | #include "App.h"
17 |
18 | using namespace FlipModelUniversal;
19 |
20 | using namespace Windows::ApplicationModel;
21 | using namespace Windows::ApplicationModel::Core;
22 | using namespace Windows::ApplicationModel::Activation;
23 | using namespace Windows::UI::Core;
24 | using namespace Windows::UI::Input;
25 | using namespace Windows::System;
26 | using namespace Windows::Foundation;
27 | using namespace Windows::Graphics::Display;
28 |
29 | // The DirectX 12 Application template is documented at http://go.microsoft.com/fwlink/?LinkID=613670&clcid=0x409
30 |
31 | ref struct Direct3DApplicationSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource
32 | {
33 | virtual Windows::ApplicationModel::Core::IFrameworkView^ CreateView()
34 | {
35 | return ref new App();
36 | }
37 | };
38 |
39 | // The main function is only used to initialize our IFrameworkView class.
40 | [Platform::MTAThread]
41 | int main(Platform::Array^)
42 | {
43 |
44 | auto direct3DApplicationSource = ref new Direct3DApplicationSource();
45 | CoreApplication::Run(direct3DApplicationSource);
46 | return 0;
47 | }
48 |
49 | // The first method called when the IFrameworkView is being created.
50 | void App::Initialize(CoreApplicationView^ applicationView)
51 | {
52 | // Register event handlers for app lifecycle. This example includes Activated, so that we
53 | // can make the CoreWindow active and start rendering on the window.
54 | applicationView->Activated +=
55 | ref new TypedEventHandler(this, &App::OnActivated);
56 |
57 | CoreApplication::Suspending +=
58 | ref new EventHandler(this, &App::OnSuspending);
59 |
60 | CoreApplication::Resuming +=
61 | ref new EventHandler(this, &App::OnResuming);
62 | }
63 |
64 | // Called when the CoreWindow object is created (or re-created).
65 | void App::SetWindow(CoreWindow^ window)
66 | {
67 | window->Closed +=
68 | ref new TypedEventHandler(this, &App::OnWindowClosed);
69 |
70 | window->KeyDown +=
71 | ref new TypedEventHandler(this, &App::OnKeyDown);
72 |
73 | window->KeyUp +=
74 | ref new TypedEventHandler(this, &App::OnKeyUp);
75 | }
76 |
77 | // Initializes scene resources, or loads a previously saved app state.
78 | void App::Load(Platform::String^ entryPoint)
79 | {
80 | initialize_game(&m_game, GetTickCount64());
81 |
82 | serialize_swapchain_options(false);
83 | }
84 |
85 | // This method is called after the window becomes active.
86 | void App::Run()
87 | {
88 | while (!m_windowClosed)
89 | {
90 | ZeroMemory(&m_action, sizeof(m_action));
91 |
92 | CoreWindow^ window = CoreWindow::GetForCurrentThread();
93 | window->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent);
94 |
95 | m_windowDpi = DisplayInformation::GetForCurrentView()->LogicalDpi;
96 | m_windowWidthDips = window->Bounds.Width;
97 | m_windowHeightDips = window->Bounds.Height;
98 | m_windowVisible = window->Visible;
99 |
100 | if (window->GetAsyncKeyState(VirtualKey::Left) == CoreVirtualKeyStates::Down)
101 | {
102 | m_action.decrease_rotation = true;
103 | }
104 |
105 | if (window->GetAsyncKeyState(VirtualKey::Right) == CoreVirtualKeyStates::Down)
106 | {
107 | m_action.increase_rotation = true;
108 | }
109 |
110 | int64_t millisecond_clock_now = GetTickCount64();
111 |
112 | unsigned ticks_elapsed = 0;
113 | float fractional_ticks = 0;
114 | calc_game_elapsed_time(&m_game, &ticks_elapsed, &fractional_ticks, millisecond_clock_now);
115 |
116 | update_game(&m_game, ticks_elapsed, &m_action, millisecond_clock_now);
117 | update_fps();
118 |
119 | if (m_action.toggle_pause)
120 | {
121 | pause_eviz_dx12(m_game.paused);
122 | }
123 |
124 | if (m_windowVisible)
125 | {
126 | set_swapchain_options_dx12(NULL, reinterpret_cast(window),
127 | m_windowWidthDips, m_windowHeightDips, m_windowDpi, &m_swapchain_opts);
128 |
129 | WCHAR hud_string[4096];
130 |
131 | {
132 | #define NEWLINE "\n"
133 | swprintf_s(hud_string, L""
134 | "Controls:" NEWLINE
135 | "[%d] Pause: Space" NEWLINE
136 | "[%d] Fullscreen: F11" NEWLINE
137 | "[%d] Vsync: Ctrl+K" NEWLINE
138 | "[%d] Use Waitable Object: Ctrl+W" NEWLINE
139 | "[%d] MaximumFrameLatency: Ctrl+,Ctrl-" NEWLINE
140 | "[%d] BufferCount: +,-" NEWLINE
141 | "[%d] FrameCount: [,]" NEWLINE
142 | "[%.1f] GPU Workload up,down" NEWLINE
143 | "[%d] CPU Workload Ctrl+up, Ctrl+down" NEWLINE
144 | "Stats:" NEWLINE
145 | " DPI: %.2f, %.2fx%.2f" NEWLINE
146 | " Avg. Present Latency = %.2f ms" NEWLINE
147 | " Latency StdDev = %.2fms" NEWLINE
148 | " Latency MinMaxDev = %.2fms" NEWLINE
149 | " Fps = %.2f (%.2fms)" NEWLINE
150 | " GPU fps = %.2f (%.2fms)" NEWLINE
151 | " CPU fps = %.2f (%.2fms)" NEWLINE,
152 | m_game.paused,
153 | m_fullscreen,
154 | m_vsync,
155 | m_swapchain_opts.create_time.use_waitable_object,
156 | m_swapchain_opts.create_time.max_frame_latency,
157 | m_swapchain_opts.create_time.swapchain_buffer_count,
158 | m_swapchain_opts.create_time.gpu_frame_count,
159 | m_swapchain_opts.any_time.overdraw_factor,
160 | m_swapchain_opts.any_time.cpu_draw_ms,
161 | m_windowDpi, m_windowWidthDips, m_windowHeightDips,
162 | m_frame_latency,
163 | m_frame_latency_stddev, m_frame_latency_minmaxd,
164 | m_current_fps, 1000 / m_current_fps,
165 | m_current_fps_gpu, 1000 * m_current_frametime_gpu,
166 | m_current_fps_cpu, 1000 * m_current_frametime_cpu
167 | );
168 | }
169 |
170 | dx12_render_stats stats = {0};
171 | render_game_dx12(hud_string, &m_game, fractional_ticks, m_vsync, &stats);
172 | if (stats.latency) {
173 | const float alpha = 0.1f;
174 | m_frame_latency = (1 - alpha)*m_frame_latency + alpha*stats.latency;
175 | m_frame_latency_stddev = stats.stddev_jitter;
176 | m_frame_latency_minmaxd = stats.minmax_jitter;
177 | m_current_frametime_cpu = (1 - alpha)*m_current_frametime_cpu + alpha*stats.cpu_frame_time;
178 | m_current_frametime_gpu = (1 - alpha)*m_current_frametime_gpu + alpha*stats.gpu_frame_time;
179 | }
180 | }
181 | else
182 | {
183 | Sleep(1);
184 | }
185 |
186 | if (m_quit)
187 | {
188 | // FIXME: this isn't allowed.. ??
189 | //window->Close();
190 | //m_quit = false;
191 | }
192 | }
193 | }
194 |
195 | // Required for IFrameworkView.
196 | // Terminate events do not cause Uninitialize to be called. It will be called if your IFrameworkView
197 | // class is torn down while the app is in the foreground.
198 | void App::Uninitialize()
199 | {
200 | }
201 |
202 | // Application lifecycle event handlers.
203 |
204 | void App::OnActivated(CoreApplicationView^ applicationView, IActivatedEventArgs^ args)
205 | {
206 | // Run() won't start until the CoreWindow is activated.
207 | CoreWindow::GetForCurrentThread()->Activate();
208 | }
209 |
210 | void App::OnSuspending(Platform::Object^ sender, SuspendingEventArgs^ args)
211 | {
212 | // Save app state asynchronously after requesting a deferral. Holding a deferral
213 | // indicates that the application is busy performing suspending operations. Be
214 | // aware that a deferral may not be held indefinitely. After about five seconds,
215 | // the app will be forced to exit.
216 | /*SuspendingDeferral^ deferral = args->SuspendingOperation->GetDeferral();
217 |
218 | create_task([this, deferral]()
219 | {
220 | // TODO: Insert your code here.
221 | //m_sceneRenderer->SaveState();
222 |
223 | deferral->Complete();
224 | });*/
225 |
226 | //ApplicationData.Current.LocalSettings
227 |
228 | serialize_swapchain_options(true);
229 |
230 | trim_dx12();
231 | }
232 |
233 | void App::OnResuming(Platform::Object^ sender, Platform::Object^ args)
234 | {
235 | // Restore any data or state that was unloaded on suspend. By default, data
236 | // and state are persisted when resuming from suspend. Note that this event
237 | // does not occur if the app was previously terminated.
238 |
239 | // TODO: Replace this with your app's resuming logic.
240 | }
241 |
242 | // Window event handlers.
243 |
244 | void App::OnWindowClosed(CoreWindow^ sender, CoreWindowEventArgs^ args)
245 | {
246 | m_windowClosed = true;
247 | }
248 |
249 | void App::OnKeyDown(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args)
250 | {
251 | bool controlDown = (sender->GetKeyState(VirtualKey::Control) & CoreVirtualKeyStates::Down) == CoreVirtualKeyStates::Down;
252 | auto vkey = args->VirtualKey;
253 |
254 | auto status = args->KeyStatus;
255 | if (status.RepeatCount > 1) {
256 | return;
257 | }
258 |
259 | if (vkey == VirtualKey::F11) {
260 | auto applicationView = Windows::UI::ViewManagement::ApplicationView::GetForCurrentView();
261 | if (applicationView->IsFullScreenMode) {
262 | applicationView->ExitFullScreenMode();
263 | } else {
264 | applicationView->TryEnterFullScreenMode();
265 | }
266 | m_fullscreen = applicationView->IsFullScreenMode;
267 | }
268 | else if (vkey == VirtualKey::K && controlDown) {
269 | m_vsync = !m_vsync;
270 | }
271 | else if (vkey == VirtualKey::W && controlDown) {
272 | m_swapchain_opts.create_time.use_waitable_object = !m_swapchain_opts.create_time.use_waitable_object;
273 | }
274 | if (vkey == VirtualKey::Up) {
275 | if(controlDown){
276 | m_swapchain_opts.any_time.cpu_draw_ms = std::min(m_swapchain_opts.any_time.cpu_draw_ms + 1, 33);
277 | }
278 | else {
279 | m_swapchain_opts.any_time.overdraw_factor = std::min(m_swapchain_opts.any_time.overdraw_factor + 0.5f, 20);
280 | }
281 | }
282 | else if (vkey == VirtualKey::Down) {
283 | if(controlDown){
284 | m_swapchain_opts.any_time.cpu_draw_ms = std::max(0, m_swapchain_opts.any_time.cpu_draw_ms - 1);
285 | }
286 | else {
287 | m_swapchain_opts.any_time.overdraw_factor = std::max(0, m_swapchain_opts.any_time.overdraw_factor - 0.5f);
288 | }
289 | }
290 | else if ((int)vkey == VK_OEM_MINUS) {
291 | if(controlDown){
292 | m_swapchain_opts.create_time.max_frame_latency = std::max(1, m_swapchain_opts.create_time.max_frame_latency - 1);
293 | }
294 | else {
295 | m_swapchain_opts.create_time.swapchain_buffer_count = std::max(2, m_swapchain_opts.create_time.swapchain_buffer_count - 1);
296 | }
297 | }
298 | else if ((int)vkey == VK_OEM_PLUS) {
299 | if(controlDown){
300 | m_swapchain_opts.create_time.max_frame_latency = std::min(8, m_swapchain_opts.create_time.max_frame_latency + 1);
301 | }
302 | else {
303 | m_swapchain_opts.create_time.swapchain_buffer_count = std::min(8, m_swapchain_opts.create_time.swapchain_buffer_count + 1);
304 | }
305 | }
306 | else if ((int)vkey == VK_OEM_4 /*[*/) {
307 | m_swapchain_opts.create_time.gpu_frame_count = std::max(1, m_swapchain_opts.create_time.gpu_frame_count - 1);
308 | }
309 | else if ((int)vkey == VK_OEM_6 /*]*/) {
310 | m_swapchain_opts.create_time.gpu_frame_count = std::min(8, m_swapchain_opts.create_time.gpu_frame_count + 1);
311 | }
312 | else if (vkey == VirtualKey::Tab) {
313 | m_swapchain_opts.inject.cpu_hiccup_count = 1;
314 | m_swapchain_opts.inject.cpu_hiccup_size = 10;
315 | }
316 | else if (vkey == VirtualKey::Escape)
317 | {
318 | m_quit = true;
319 | }
320 | else if (vkey == VirtualKey::Space)
321 | {
322 | m_action.toggle_pause = true;
323 | }
324 | }
325 |
326 | void App::OnKeyUp(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args)
327 | {
328 | }
329 |
330 | void FlipModelUniversal::App::update_fps()
331 | {
332 | int64_t now = GetTickCount64();
333 | int64_t then = m_fps_frame_timestamps[m_fps_frame_timestamp_write_index];
334 | m_fps_frame_timestamps[m_fps_frame_timestamp_write_index] = now;
335 | m_fps_frame_timestamp_write_index = (m_fps_frame_timestamp_write_index + 1) & (FRAMETIME_BUFFER_LENGTH - 1);
336 |
337 | if (now > then)
338 | {
339 | if (FPS_UPDATES_PER_SECOND*(now - m_fps_last_update) > 1000)
340 | {
341 | float fps = (1000.0f*FRAMETIME_BUFFER_LENGTH) / (now - then);
342 | m_fps_last_update = now;
343 | m_current_fps = fps;
344 | m_current_fps_cpu = 1.0f / m_current_frametime_cpu;
345 | m_current_fps_gpu = 1.0f / m_current_frametime_gpu;
346 | }
347 | }
348 | else
349 | {
350 | m_current_fps = 0;
351 | }
352 | }
353 |
354 | static void serialize(
355 | Windows::Foundation::Collections::IPropertySet ^props,
356 | bool write, Platform::String^ key,
357 | int& value, int default_value)
358 | {
359 | if (write) {
360 | props->Insert(key, value);
361 | }
362 | else {
363 | value = default_value;
364 | auto entry = props->Lookup(key);
365 | if (entry) {
366 | auto propVal = dynamic_cast(entry);
367 | if (propVal) {
368 | value = propVal->GetInt32();
369 | }
370 | }
371 | }
372 | };
373 |
374 | static void serialize(
375 | Windows::Foundation::Collections::IPropertySet ^props,
376 | bool write, Platform::String^ key,
377 | float& value, float default_value)
378 | {
379 | if (write) {
380 | props->Insert(key, value);
381 | }
382 | else {
383 | value = default_value;
384 | auto entry = props->Lookup(key);
385 | if (entry) {
386 | auto propVal = dynamic_cast(entry);
387 | if (propVal) {
388 | value = (float)propVal->GetDouble();
389 | }
390 | }
391 | }
392 | };
393 |
394 | void App::serialize_swapchain_options(bool write)
395 | {
396 | auto settings = Windows::Storage::ApplicationData::Current->LocalSettings->Values;
397 | auto opts = &m_swapchain_opts;
398 |
399 | serialize(settings, write, "overdraw_factor", opts->any_time.overdraw_factor, 8.0f);
400 | serialize(settings, write, "cpu_draw_ms", opts->any_time.cpu_draw_ms, 8);
401 | serialize(settings, write, "use_waitable_object", opts->create_time.use_waitable_object, 1);
402 | serialize(settings, write, "max_frame_latency", opts->create_time.max_frame_latency, 2);
403 | serialize(settings, write, "swapchain_buffer_count", opts->create_time.swapchain_buffer_count, 3);
404 | serialize(settings, write, "gpu_frame_count", opts->create_time.gpu_frame_count, 2);
405 | }
406 |
--------------------------------------------------------------------------------
/Source/App.h:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | // Copyright 2017 Intel Corporation
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | // use this file except in compliance with the License. You may obtain a copy
6 | // of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | // License for the specific language governing permissions and limitations
14 | // under the License.
15 | ////////////////////////////////////////////////////////////////////////////////
16 | #pragma once
17 |
18 | #define NOMINMAX
19 | #include
20 | #include
21 | #include
22 | #include
23 | #include
24 |
25 | #include "sample_game.hpp"
26 | #include "sample_dx12.hpp"
27 |
28 | namespace FlipModelUniversal
29 | {
30 | // Main entry point for our app. Connects the app with the Windows shell and handles application lifecycle events.
31 | ref class App sealed : public Windows::ApplicationModel::Core::IFrameworkView
32 | {
33 | public:
34 |
35 | // IFrameworkView methods.
36 | virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView);
37 | virtual void SetWindow(Windows::UI::Core::CoreWindow^ window);
38 | virtual void Load(Platform::String^ entryPoint);
39 | virtual void Run();
40 | virtual void Uninitialize();
41 |
42 | protected:
43 | // Application lifecycle event handlers.
44 | void OnActivated(Windows::ApplicationModel::Core::CoreApplicationView^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs^ args);
45 | void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ args);
46 | void OnResuming(Platform::Object^ sender, Platform::Object^ args);
47 |
48 | // Window event handlers.
49 | void OnWindowClosed(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::CoreWindowEventArgs^ args);
50 |
51 | // Input event handlers.
52 | void OnKeyDown(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);
53 | void OnKeyUp(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::KeyEventArgs^ args);
54 |
55 | private:
56 |
57 | void update_fps();
58 | void serialize_swapchain_options(bool write);
59 |
60 | bool m_initialized = 0;
61 | bool m_quit = 0;
62 | bool m_fullscreen = 0;
63 |
64 | game_data m_game = { 0 };
65 | game_command m_action = { 0 };
66 | dx12_swapchain_options m_swapchain_opts = { 0 };
67 |
68 | enum {
69 | FRAMETIME_BUFFER_LENGTH = 32,
70 | FPS_UPDATES_PER_SECOND = 4
71 | };
72 |
73 | int64_t m_fps_frame_timestamps[FRAMETIME_BUFFER_LENGTH] = { 0 };
74 | int64_t m_fps_frame_timestamp_write_index = 0;
75 | int64_t m_fps_last_update = 0;
76 |
77 | float m_current_fps = 0, m_current_fps_cpu = 0, m_current_fps_gpu = 0;
78 | float m_current_frametime_cpu = 0, m_current_frametime_gpu = 0;
79 | float m_frame_latency = 0;
80 | float m_frame_latency_stddev = 0, m_frame_latency_minmaxd = 0;
81 |
82 | bool m_vsync = 1;
83 |
84 | float m_windowWidthDips = 0;
85 | float m_windowHeightDips = 0;
86 |
87 | float m_windowDpi = 0;
88 |
89 | bool m_windowClosed = 0;
90 | bool m_windowVisible = 1;
91 | };
92 | }
93 |
--------------------------------------------------------------------------------
/Source/DX12Helpers.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | // Copyright 2017 Intel Corporation
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | // use this file except in compliance with the License. You may obtain a copy
6 | // of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | // License for the specific language governing permissions and limitations
14 | // under the License.
15 | ////////////////////////////////////////////////////////////////////////////////
16 | #include "DX12Helpers.hpp"
17 |
18 | #if D3D12_DYNAMIC_LINK
19 |
20 | HMODULE hModuleD3D12;
21 | D3D12DllExports D3D12;
22 | BOOL LoadD3D12Dll(BOOL Load)
23 | {
24 | // Already in desired state
25 | if(D3D12.loaded == Load)
26 | {
27 | return TRUE;
28 | }
29 |
30 | // Unloading
31 | if(!Load)
32 | {
33 | assert(hModuleD3D12);
34 | FreeLibrary(hModuleD3D12);
35 | ZeroMemory(&D3D12, sizeof(D3D12));
36 | return TRUE;
37 | }
38 |
39 | // Loading
40 | hModuleD3D12 = LoadLibrary("D3D12");
41 | if(!hModuleD3D12)
42 | {
43 | return FALSE;
44 | }
45 |
46 | *(FARPROC*)&D3D12.CreateDevice = GetProcAddress(hModuleD3D12, "D3D12CreateDevice");
47 | *(FARPROC*)&D3D12.GetDebugInterface = GetProcAddress(hModuleD3D12, "D3D12GetDebugInterface");
48 | *(FARPROC*)&D3D12.SerializeRootSignature = GetProcAddress(hModuleD3D12, "D3D12SerializeRootSignature");
49 | *(FARPROC*)&D3D12.CreateRootSignatureDeserializer = GetProcAddress(hModuleD3D12, "D3D12CreateRootSignatureDeserializer");
50 |
51 | if(!D3D12.CreateDevice ||
52 | !D3D12.GetDebugInterface ||
53 | !D3D12.SerializeRootSignature ||
54 | !D3D12.CreateRootSignatureDeserializer)
55 | {
56 | FreeLibrary(hModuleD3D12);
57 | ZeroMemory(&D3D12, sizeof(D3D12));
58 | return FALSE;
59 | }
60 |
61 | D3D12.loaded = TRUE;
62 |
63 | return TRUE;
64 | }
65 |
66 | #endif // #if D3D12_DYNAMIC_LINK
67 |
68 | void SetNameV(ID3D12Object *obj, const char *fmt, va_list args)
69 | {
70 | char buf[256];
71 | int len = vsnprintf(buf, sizeof(buf), fmt, args);
72 | std::wstring temp(buf, buf+len);
73 | obj->SetName(temp.c_str());
74 | }
75 |
76 | UINT64 WaitForFence(ID3D12Fence *Fence, HANDLE FenceEvent, UINT64 WaitValue)
77 | {
78 | UINT64 CompletedValue;
79 | while((CompletedValue = Fence->GetCompletedValue()) < WaitValue)
80 | {
81 | if(FenceEvent)
82 | {
83 | WaitForSingleObject(FenceEvent, INFINITE);
84 | }
85 | else
86 | {
87 | Sleep(1);
88 | }
89 | }
90 | return CompletedValue;
91 | }
92 |
93 | HRESULT UploadHeap::Initialize(ID3D12Device* device, UINT64 size)
94 | {
95 | this->~UploadHeap();
96 |
97 | HRESULT hr;
98 |
99 | hr = device->CreateCommittedResource(
100 | &CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_UPLOAD),
101 | D3D12_HEAP_FLAG_NONE,
102 | &CD3DX12_RESOURCE_DESC::Buffer(size),
103 | D3D12_RESOURCE_STATE_GENERIC_READ,
104 | nullptr,
105 | IID_PPV_ARGS(&mHeap));
106 | if (FAILED(hr)) {
107 | return hr;
108 | }
109 |
110 | hr = mHeap->Map(0, nullptr, reinterpret_cast(&mHeapWO));
111 |
112 | return hr;
113 | }
114 |
115 | void DescriptorArray::Initialize(ID3D12Device *Device, D3D12_DESCRIPTOR_HEAP_TYPE HeapType,
116 | D3D12_DESCRIPTOR_HEAP_FLAGS HeapFlags, UINT Size)
117 | {
118 | this->~DescriptorArray();
119 |
120 | mArraySize = Size;
121 | D3D12_DESCRIPTOR_HEAP_DESC HeapDesc;
122 | ZeroMemory(&HeapDesc, sizeof(HeapDesc));
123 | HeapDesc.NumDescriptors = Size;
124 | HeapDesc.Type = HeapType;
125 | HeapDesc.Flags = HeapFlags;
126 | Device->CreateDescriptorHeap(&HeapDesc, IID_PPV_ARGS(&mHeap));
127 | mElementSize = Device->GetDescriptorHandleIncrementSize(HeapType);
128 | mCpuBase = mHeap->GetCPUDescriptorHandleForHeapStart();
129 | mGpuBase = mHeap->GetGPUDescriptorHandleForHeapStart();
130 | }
131 |
132 | bool FrameQueue::Initialize(
133 | const char *DebugName,
134 | ID3D12Device *Device, ID3D12CommandQueue *CommandQueue,
135 | ID3D12PipelineState *InitialPipelineState,
136 | void *FrameUserData, UINT SizeofStructFrame, UINT FrameCount,
137 | ID3D11On12Device *Device11On12,
138 | ID2D1DeviceContext2 *D2DDeviceContext)
139 | {
140 | this->~FrameQueue();
141 |
142 | mNextFrameFence = 1;
143 | mNextFrameIndex = 0;
144 |
145 | mDebugName = DebugName;
146 | mDevice = Device;
147 | mDevice11On12 = Device11On12;
148 | mD2DDeviceContext = D2DDeviceContext;
149 | mCommandQueue = CommandQueue;
150 |
151 | CheckHresult(Device->CreateFence(0, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(&mFence)));
152 | mFenceEvent.Initialize();
153 |
154 | mFrames.resize(FrameCount);
155 | for(UINT i = 0; i < FrameCount; ++i)
156 | {
157 | FrameContext *Frame = &mFrames[i];
158 | Frame->mFrameFenceId = 0;
159 | CheckHresult(Device->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT,
160 | IID_PPV_ARGS(&Frame->mCommandAllocator)));
161 | SetName(Frame->mCommandAllocator, "%s.Frame%d:CmdAlloc", DebugName, i);
162 | Frame->mUserData = (char*)FrameUserData + i*SizeofStructFrame;
163 | }
164 |
165 | return true;
166 | }
167 |
168 | bool FrameQueue::SetSwapChain(
169 | IDXGISwapChain2 *SwapChain,
170 | DXGI_FORMAT RenderTargetViewFormat,
171 | float dpiX, float dpiY)
172 | {
173 | if (!SwapChain) {
174 | mBackBuffers.clear();
175 | return true;
176 | }
177 |
178 | DXGI_SWAP_CHAIN_DESC1 Desc1;
179 | CheckHresult(SwapChain->GetDesc1(&Desc1));
180 | UINT ChainLength = Desc1.BufferCount;
181 | assert(ChainLength);
182 |
183 | CheckHresult(SwapChain->QueryInterface(mSwapChain.ReleaseAndGetAddressOf()));
184 | mBackBuffers.resize(ChainLength);
185 | mRenderTargetViews.Initialize(mDevice.Get(), D3D12_DESCRIPTOR_HEAP_FLAG_NONE, ChainLength);
186 | D3D12_RENDER_TARGET_VIEW_DESC RtvDesc = {};
187 | RtvDesc.ViewDimension = D3D12_RTV_DIMENSION_TEXTURE2D;
188 | RtvDesc.Format = RenderTargetViewFormat == DXGI_FORMAT_UNKNOWN ? Desc1.Format : RenderTargetViewFormat;
189 |
190 | D2D1_BITMAP_PROPERTIES1 bitmapProperties = D2D1::BitmapProperties1(
191 | D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW,
192 | D2D1::PixelFormat(DXGI_FORMAT_UNKNOWN, D2D1_ALPHA_MODE_PREMULTIPLIED),
193 | dpiX,
194 | dpiY
195 | );
196 |
197 | for(UINT i = 0; i < ChainLength; ++i)
198 | {
199 | auto& BufferResources = mBackBuffers[i];
200 |
201 | CheckHresult(mSwapChain->GetBuffer(i, IID_PPV_ARGS(&BufferResources.mBuffer)));
202 | SetName(BufferResources.mBuffer.Get(), "%s.BackBuffer%d", mDebugName, i);
203 | mDevice->CreateRenderTargetView(BufferResources.mBuffer.Get(), &RtvDesc, mRenderTargetViews[i].CpuHandle);
204 | if (mDevice11On12)
205 | {
206 | D3D11_RESOURCE_FLAGS d3d11Flags = { D3D11_BIND_RENDER_TARGET };
207 | CheckHresult(mDevice11On12->CreateWrappedResource(
208 | BufferResources.mBuffer.Get(), &d3d11Flags, D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_PRESENT,
209 | IID_PPV_ARGS(&BufferResources.mWrapped11Buffer)));
210 | ComPtr surface;
211 | CheckHresult(BufferResources.mWrapped11Buffer.As(&surface));
212 | CheckHresult(mD2DDeviceContext->CreateBitmapFromDxgiSurface(
213 | surface.Get(),
214 | &bitmapProperties,
215 | &BufferResources.mD2DRenderTarget
216 | ));
217 | }
218 | }
219 |
220 | return true;
221 | }
222 |
223 | void FrameQueue::BeginFrame(FrameContext **OutFrame)
224 | {
225 | assert(mSwapChain);
226 |
227 | // Get/Increment the fence counter
228 | UINT64 FrameFence = mNextFrameFence;
229 | mNextFrameFence = mNextFrameFence + 1;
230 |
231 | // Get/Increment the frame ring-buffer index
232 | UINT FrameIndex = mNextFrameIndex;
233 | mNextFrameIndex = (mNextFrameIndex + 1) % (UINT)mFrames.size();
234 |
235 | // Wait for the last frame occupying this slot to be complete
236 | FrameContext *Frame = &mFrames[FrameIndex];
237 | WaitForFence(mFence.Get(), mFenceEvent.Get(), Frame->mFrameFenceId);
238 | Frame->mFrameFenceId = FrameFence;
239 |
240 | // Associate the frame with the swap chain backbuffer & RTV.
241 | UINT BackBufferIndex = mSwapChain->GetCurrentBackBufferIndex();
242 | auto& Resources = mBackBuffers[BackBufferIndex];
243 | Frame->mBackBufferIndex = BackBufferIndex;
244 | Frame->mBackBuffer = Resources.mBuffer.Get();
245 | Frame->mWrapped11BackBuffer = Resources.mWrapped11Buffer.Get();
246 | Frame->mD2DRenderTarget = Resources.mD2DRenderTarget.Get();
247 | Frame->mBackBufferRTV = mRenderTargetViews[BackBufferIndex].CpuHandle;
248 |
249 | // Reset the command allocator and list
250 | ThrowIfFailed(Frame->mCommandAllocator->Reset());
251 |
252 | *OutFrame = Frame;
253 | }
254 |
255 | void FrameQueue::EndFrame(FrameContext *Frame)
256 | {
257 | // Signal that the frame is complete
258 | ThrowIfFailed(mFence->SetEventOnCompletion(Frame->mFrameFenceId, mFenceEvent.Get()));
259 | ThrowIfFailed(mCommandQueue->Signal(mFence.Get(), Frame->mFrameFenceId));
260 | }
261 |
--------------------------------------------------------------------------------
/Source/DX12Helpers.hpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | // Copyright 2017 Intel Corporation
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | // use this file except in compliance with the License. You may obtain a copy
6 | // of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | // License for the specific language governing permissions and limitations
14 | // under the License.
15 | ////////////////////////////////////////////////////////////////////////////////
16 | #pragma once
17 |
18 | #include "WindowsHelpers.hpp"
19 | #include "d3dx12.h"
20 | #include
21 | #include
22 | #include
23 | #include
24 |
25 | #if D3D12_DYNAMIC_LINK
26 |
27 | struct D3D12DllExports
28 | {
29 | BOOL loaded;
30 | PFN_D3D12_CREATE_DEVICE CreateDevice;
31 | PFN_D3D12_GET_DEBUG_INTERFACE GetDebugInterface;
32 | PFN_D3D12_SERIALIZE_ROOT_SIGNATURE SerializeRootSignature;
33 | PFN_D3D12_CREATE_ROOT_SIGNATURE_DESERIALIZER CreateRootSignatureDeserializer;
34 | };
35 |
36 | extern D3D12DllExports D3D12;
37 | BOOL LoadD3D12Dll(BOOL Load);
38 |
39 | #define D3D12CreateDevice D3D12.CreateDevice
40 | #define D3D12GetDebugInterface D3D12.GetDebugInterface
41 | #define D3D12SerializeRootSignature D3D12.SerializeRootSignature
42 | #define D3D12CreateRootSignatureDeserializer D3D12.CreateRootSignatureDeserializer
43 |
44 | #endif // D3D12_DYNAMIC_LINK
45 |
46 | inline UINT AlignTo(UINT offset, UINT align)
47 | {
48 | assert(!(align & (align-1)));
49 | return (offset + (align-1)) &~ (align-1);
50 | }
51 |
52 | template
53 | inline D3D12_GPU_VIRTUAL_ADDRESS GetGpuAddress(D3D12_GPU_VIRTUAL_ADDRESS base, T* member, S* structure)
54 | {
55 | return base + (reinterpret_cast(member) - reinterpret_cast(structure));
56 | }
57 |
58 | template
59 | inline D3D12_VERTEX_BUFFER_VIEW MakeVertexBufferView(D3D12_GPU_VIRTUAL_ADDRESS base, T* member, UINT size, S* structure)
60 | {
61 | D3D12_VERTEX_BUFFER_VIEW view;
62 | view.BufferLocation = GetGpuAddress(base, member, structure);
63 | view.SizeInBytes = size;
64 | view.StrideInBytes = sizeof(T);
65 | return view;
66 | }
67 |
68 | template
69 | inline D3D12_INDEX_BUFFER_VIEW MakeIndexBufferView(D3D12_GPU_VIRTUAL_ADDRESS base, T* member, UINT size, S* structure, DXGI_FORMAT format)
70 | {
71 | D3D12_INDEX_BUFFER_VIEW view;
72 | view.BufferLocation = GetGpuAddress(base, member, structure);
73 | view.SizeInBytes = size;
74 | view.Format = format;
75 | return view;
76 | }
77 |
78 | void SetNameV(ID3D12Object *obj, const char *fmt, va_list args);
79 |
80 | static void SetName(ID3D12Object *obj, const char *fmt, ...)
81 | {
82 | va_list args;
83 | va_start(args, fmt);
84 | SetNameV(obj, fmt, args);
85 | va_end(args);
86 | }
87 |
88 | template
89 | static void SetName(ComPtr& obj, const char *fmt, ...)
90 | {
91 | va_list args;
92 | va_start(args, fmt);
93 | SetNameV(obj.Get(), fmt, args);
94 | va_end(args);
95 | }
96 |
97 | static void SetName(IDXGIObject *obj, const char *name)
98 | {
99 | obj->SetPrivateData(WKPDID_D3DDebugObjectName, (UINT)strlen(name), name);
100 | }
101 |
102 | UINT64 WaitForFence(ID3D12Fence *Fence, HANDLE FenceEvent, UINT64 WaitValue);
103 |
104 | // Upload Heap: Untyped version
105 | struct UploadHeap
106 | {
107 | HRESULT Initialize(ID3D12Device* device, UINT64 size);
108 |
109 | ID3D12Resource* Heap() { return mHeap.Get(); }
110 |
111 | // Write-only!
112 | void* DataWO() { return mHeapWO; }
113 |
114 | private:
115 | ComPtr mHeap;
116 | void* mHeapWO = nullptr;
117 | };
118 |
119 | // Upload Heap: Structure/typed version
120 | template
121 | struct UploadHeapT: UploadHeap
122 | {
123 | HRESULT Initialize(ID3D12Device *device)
124 | {
125 | return UploadHeap::Initialize(device, sizeof(T));
126 | }
127 |
128 | T* DataWO() { return (T*)UploadHeap::DataWO(); }
129 | };
130 |
131 | // Untyped version
132 | struct DescriptorArray
133 | {
134 | struct IndexValue {
135 | const D3D12_CPU_DESCRIPTOR_HANDLE CpuHandle;
136 | const D3D12_GPU_DESCRIPTOR_HANDLE GpuHandle;
137 | };
138 | UINT Size() const { return mArraySize; }
139 | IndexValue operator[](UINT i) {
140 | assert(i >= 0 && i < mArraySize);
141 | return { CpuHandle(i), GpuHandle(i) };
142 | }
143 | D3D12_CPU_DESCRIPTOR_HANDLE CpuHandle(UINT i) {
144 | auto h = mCpuBase;
145 | h.ptr += i*mElementSize;
146 | return h;
147 | }
148 | D3D12_GPU_DESCRIPTOR_HANDLE GpuHandle(UINT i) {
149 | auto h = mGpuBase;
150 | h.ptr += i*mElementSize;
151 | return h;
152 | }
153 | ID3D12DescriptorHeap *GetHeap() { return mHeap.Get(); }
154 |
155 | protected:
156 | void Initialize(ID3D12Device *Device, D3D12_DESCRIPTOR_HEAP_TYPE HeapType,
157 | D3D12_DESCRIPTOR_HEAP_FLAGS HeapFlags, UINT Size);
158 |
159 | private:
160 | ComPtr mHeap;
161 | UINT mArraySize;
162 | UINT mElementSize;
163 | D3D12_CPU_DESCRIPTOR_HANDLE mCpuBase;
164 | D3D12_GPU_DESCRIPTOR_HANDLE mGpuBase;
165 | };
166 |
167 | template
168 | struct DescriptorArrayT : DescriptorArray
169 | {
170 | void Initialize(ID3D12Device *Device, D3D12_DESCRIPTOR_HEAP_FLAGS HeapFlags, UINT Size)
171 | {
172 | DescriptorArray::Initialize(Device, HeapType, HeapFlags, Size);
173 | }
174 | };
175 |
176 | /* How to use FrameQueue:
177 |
178 | init:
179 |
180 | FrameQueue frameQueue;
181 | MyFrameData myFrames[2];
182 | frameQueue.Initialize(..., &frames, sizeof(MyFrameData), ARRAY_SIZE(myFrames));
183 |
184 | render:
185 |
186 | FrameContext *Frame;
187 | frameQueue.BeginFrame(&frame);
188 | RenderFrame(Frame, FrameData);
189 | frameQueue.EndFrame(Frame);
190 | */
191 |
192 | struct FrameQueue
193 | {
194 | bool Initialize(
195 | const char *DebugName,
196 | ID3D12Device *Device, ID3D12CommandQueue *CommandQueue,
197 | ID3D12PipelineState *InitialPipelineState,
198 | void *FrameUserData, UINT SizeofStructFrame, UINT FrameCount,
199 | ID3D11On12Device *Device11On12 = nullptr,
200 | ID2D1DeviceContext2 *D2DDeviceContext = nullptr);
201 |
202 | bool SetSwapChain(IDXGISwapChain2 *SwapChain,
203 | DXGI_FORMAT RenderTargetViewFormat = DXGI_FORMAT_UNKNOWN,
204 | float dpiX = 0,
205 | float dpiY = 0);
206 |
207 | struct FrameContext
208 | {
209 | friend struct FrameQueue;
210 | ID3D12Resource *mBackBuffer;
211 | ID3D11Resource *mWrapped11BackBuffer;
212 | ID2D1Bitmap1 *mD2DRenderTarget;
213 | D3D12_CPU_DESCRIPTOR_HANDLE mBackBufferRTV;
214 | ComPtr mCommandAllocator;
215 | UINT mBackBufferIndex;
216 | template T *CastUserDataAs() {
217 | return static_cast(mUserData);
218 | }
219 | void FlushCommandList() {
220 |
221 | }
222 | private:
223 | bool mCommandListOpen;
224 | void *mUserData;
225 | UINT64 mFrameFenceId;
226 | };
227 |
228 | // Handle fencing
229 | void BeginFrame(FrameContext **Frame);
230 | void EndFrame(FrameContext *Frame);
231 |
232 | FrameContext *GetFrameContext(int i) {
233 | return &mFrames[i];
234 | }
235 |
236 | private:
237 | const char *mDebugName;
238 | ComPtr mDevice;
239 | ComPtr mDevice11On12;
240 | ComPtr mD2DDeviceContext;
241 | ComPtr mSwapChain;
242 | ComPtr mCommandQueue;
243 |
244 | UINT64 mNextFrameFence;
245 | ComPtr mFence;
246 | WindowsEvent mFenceEvent;
247 |
248 | UINT mNextFrameIndex;
249 | std::vector mFrames;
250 |
251 | struct BackBufferResources {
252 | ComPtr mBuffer;
253 | ComPtr mWrapped11Buffer;
254 | ComPtr mD2DRenderTarget;
255 | };
256 |
257 | std::vector mBackBuffers;
258 | DescriptorArrayT mRenderTargetViews;
259 | };
260 |
261 | struct TimestampQueryHeap
262 | {
263 | bool Initialize(ID3D12Device *Device, UINT TimestampCount)
264 | {
265 | D3D12_QUERY_HEAP_DESC QueryHeapDesc;
266 | QueryHeapDesc.Count = TimestampCount;
267 | QueryHeapDesc.NodeMask = 0;
268 | QueryHeapDesc.Type = D3D12_QUERY_HEAP_TYPE_TIMESTAMP;
269 | CheckHresult(Device->CreateQueryHeap(&QueryHeapDesc, IID_PPV_ARGS(&mQueryHeap)));
270 |
271 | UINT BufferSize = sizeof(UINT64)*TimestampCount;
272 | D3D12_RESOURCE_DESC ReadbackBufferDesc = CD3DX12_RESOURCE_DESC::Buffer(BufferSize);
273 | D3D12_HEAP_PROPERTIES ReadbackBufferHeapProps = CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_READBACK);
274 | CheckHresult(Device->CreateCommittedResource(&ReadbackBufferHeapProps, D3D12_HEAP_FLAG_NONE,
275 | &ReadbackBufferDesc, D3D12_RESOURCE_STATE_COPY_DEST, NULL, IID_PPV_ARGS(&mReadbackBuffer)));
276 |
277 | return true;
278 | }
279 |
280 | void QueryTimestampCommand(ID3D12GraphicsCommandList *CommandList, UINT TimestampIndex)
281 | {
282 | CommandList->EndQuery(mQueryHeap.Get(), D3D12_QUERY_TYPE_TIMESTAMP, TimestampIndex);
283 | }
284 |
285 | void ReadTimestampQueryCommand(ID3D12GraphicsCommandList *CommandList, UINT StartIndex, UINT NumQueries)
286 | {
287 | CommandList->ResolveQueryData(mQueryHeap.Get(), D3D12_QUERY_TYPE_TIMESTAMP,
288 | StartIndex, NumQueries, mReadbackBuffer.Get(), StartIndex*sizeof(UINT64));
289 | }
290 |
291 | void Readback(void *Dest, UINT Size)
292 | {
293 | void *Source;
294 | D3D12_RANGE Range;
295 | Range.Begin = 0;
296 | Range.End = Size;
297 | ThrowIfFailed(mReadbackBuffer->Map(0, &Range, &Source));
298 | memcpy(Dest, Source, Size);
299 | mReadbackBuffer->Unmap(0, NULL);
300 | }
301 |
302 | private:
303 |
304 | ComPtr mQueryHeap;
305 | ComPtr mReadbackBuffer;
306 | };
307 |
308 | template
309 | struct TimestampQueryHeapT
310 | {
311 | enum { NumberOfTimestampsPerStruct = sizeof(FrameTimestamps) / sizeof(UINT64) };
312 |
313 | struct QueryScope {
314 | QueryScope(TimestampQueryHeapT *Parent,
315 | ID3D12GraphicsCommandList *CommandList,
316 | const UINT64(&Timestamps)[2])
317 | : mParent(Parent)
318 | , mCommandList(CommandList)
319 | , mTimestamps(Timestamps)
320 | {
321 | mParent->QueryTimestampCommand(mCommandList, &mTimestamps[0]);
322 | }
323 |
324 | ~QueryScope()
325 | {
326 | mParent->QueryTimestampCommand(mCommandList, &mTimestamps[1]);
327 | }
328 |
329 | TimestampQueryHeapT *mParent;
330 | ID3D12GraphicsCommandList *mCommandList;
331 | const FrameTimestamps *mTimestampStruct;
332 | const UINT64(&mTimestamps)[2];
333 | };
334 |
335 | bool Initialize(ID3D12Device *Device)
336 | {
337 | return mQueryHeap.Initialize(Device, NumberOfTimestampsPerStruct);
338 | }
339 |
340 | const FrameTimestamps *GetTimestampWriteStruct()
341 | {
342 | return 0;
343 | }
344 |
345 | const FrameTimestamps *GetTimestampReadStruct(bool refresh)
346 | {
347 | if (refresh) {
348 | mQueryHeap.Readback(&mLastReadback, sizeof(FrameTimestamps));
349 | }
350 | return &mLastReadback;
351 | }
352 |
353 | void QueryTimestampCommand(ID3D12GraphicsCommandList *CommandList, const UINT64 *Timestamp)
354 | {
355 | UINT TimestampIndex = (UINT)(Timestamp - (UINT64*)0);
356 | assert(TimestampIndex*sizeof(UINT64) <= sizeof(FrameTimestamps));
357 | mQueryHeap.QueryTimestampCommand(CommandList, TimestampIndex);
358 | }
359 |
360 | void ReadbackCommand(ID3D12GraphicsCommandList *CommandList)
361 | {
362 | mQueryHeap.ReadTimestampQueryCommand(CommandList, 0, NumberOfTimestampsPerStruct);
363 | }
364 |
365 | private:
366 | TimestampQueryHeap mQueryHeap;
367 | FrameTimestamps mLastReadback;
368 | };
369 |
--------------------------------------------------------------------------------
/Source/EventViz.cpp:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | // Copyright 2017 Intel Corporation
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 | // use this file except in compliance with the License. You may obtain a copy
6 | // of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | // License for the specific language governing permissions and limitations
14 | // under the License.
15 | ////////////////////////////////////////////////////////////////////////////////
16 | #include "EventViz.hpp"
17 | #include
18 | #include