├── .gitattributes
├── LICENSE.txt
├── README.md
├── amd_sdk
├── .gitattributes
├── .gitignore
├── LICENSE.txt
├── README.md
├── build
│ ├── AMD_SDK_2010.vcxproj
│ ├── AMD_SDK_2010.vcxproj.filters
│ ├── AMD_SDK_2012.vcxproj
│ ├── AMD_SDK_2012.vcxproj.filters
│ ├── AMD_SDK_2013.vcxproj
│ ├── AMD_SDK_2013.vcxproj.filters
│ ├── AMD_SDK_2015.vcxproj
│ ├── AMD_SDK_2015.vcxproj.filters
│ ├── AMD_SDK_Minimal_2010.vcxproj
│ ├── AMD_SDK_Minimal_2010.vcxproj.filters
│ ├── AMD_SDK_Minimal_2012.vcxproj
│ ├── AMD_SDK_Minimal_2012.vcxproj.filters
│ ├── AMD_SDK_Minimal_2013.vcxproj
│ ├── AMD_SDK_Minimal_2013.vcxproj.filters
│ ├── AMD_SDK_Minimal_2015.vcxproj
│ ├── AMD_SDK_Minimal_2015.vcxproj.filters
│ ├── Windows10SDKVS13_x64.props
│ ├── Windows81SDKVS12_x64.props
│ ├── Windows81SDK_x64.props
│ └── Windows8SDK_x64.props
├── inc
│ ├── AMD_SDK.h
│ └── ShaderCacheSampleHelper.h
├── media
│ ├── AMD.dds
│ ├── AMD.ico
│ └── amd_logo_black.png
├── premake
│ ├── premake5.lua
│ └── premake5_minimal.lua
└── src
│ ├── AMD_Mesh.cpp
│ ├── AMD_Mesh.h
│ ├── Geometry.cpp
│ ├── Geometry.h
│ ├── HUD.cpp
│ ├── HUD.h
│ ├── HelperFunctions.cpp
│ ├── HelperFunctions.h
│ ├── LineRender.cpp
│ ├── LineRender.h
│ ├── Magnify.cpp
│ ├── Magnify.h
│ ├── MagnifyTool.cpp
│ ├── MagnifyTool.h
│ ├── ShaderCache.cpp
│ ├── ShaderCache.h
│ ├── ShaderCacheSampleHelper.cpp
│ ├── Shaders
│ ├── Line.hlsl
│ └── Sprite.hlsl
│ ├── Sprite.cpp
│ ├── Sprite.h
│ ├── Timer.cpp
│ ├── Timer.h
│ ├── crc.cpp
│ └── crc.h
├── dxut
├── .gitattributes
├── .gitignore
├── Core
│ ├── DDSTextureLoader.cpp
│ ├── DDSTextureLoader.h
│ ├── DXUT.cpp
│ ├── DXUT.h
│ ├── DXUTDevice11.cpp
│ ├── DXUTDevice11.h
│ ├── DXUT_2010.vcxproj
│ ├── DXUT_2012.vcxproj
│ ├── DXUT_2013.vcxproj
│ ├── DXUT_2015.vcxproj
│ ├── DXUTmisc.cpp
│ ├── DXUTmisc.h
│ ├── ScreenGrab.cpp
│ ├── ScreenGrab.h
│ ├── WICTextureLoader.cpp
│ ├── WICTextureLoader.h
│ ├── Windows10SDKVS13_x64.props
│ ├── Windows81SDKVS12_x64.props
│ ├── Windows81SDK_x64.props
│ ├── Windows8SDK_x64.props
│ ├── dxerr.cpp
│ ├── dxerr.h
│ └── premake5.lua
├── MIT.txt
├── Optional
│ ├── DXUTLockFreePipe.h
│ ├── DXUTOpt_2010.vcxproj
│ ├── DXUTOpt_2012.vcxproj
│ ├── DXUTOpt_2013.vcxproj
│ ├── DXUTOpt_2015.vcxproj
│ ├── DXUTcamera.cpp
│ ├── DXUTcamera.h
│ ├── DXUTgui.cpp
│ ├── DXUTgui.h
│ ├── DXUTguiIME.cpp
│ ├── DXUTguiIME.h
│ ├── DXUTres.cpp
│ ├── DXUTres.h
│ ├── DXUTsettingsdlg.cpp
│ ├── DXUTsettingsdlg.h
│ ├── ImeUi.cpp
│ ├── ImeUi.h
│ ├── SDKmesh.cpp
│ ├── SDKmesh.h
│ ├── SDKmisc.cpp
│ ├── SDKmisc.h
│ ├── Windows10SDKVS13_x64.props
│ ├── Windows81SDKVS12_x64.props
│ ├── Windows81SDK_x64.props
│ ├── Windows8SDK_x64.props
│ ├── directx.ico
│ └── premake5.lua
└── ReadMe.txt
├── gpuparticles11
├── .gitignore
├── build
│ ├── GPUParticles11_2012.sln
│ ├── GPUParticles11_2012.vcxproj
│ ├── GPUParticles11_2012.vcxproj.filters
│ ├── GPUParticles11_2013.sln
│ ├── GPUParticles11_2013.vcxproj
│ ├── GPUParticles11_2013.vcxproj.filters
│ ├── GPUParticles11_2015.sln
│ ├── GPUParticles11_2015.vcxproj
│ ├── GPUParticles11_2015.vcxproj.filters
│ ├── Windows10SDKVS13_x64.props
│ ├── Windows81SDKVS12_x64.props
│ ├── Windows81SDK_x64.props
│ └── Windows8SDK_x64.props
├── doc
│ └── GPUParticles.ppsx
├── media
│ ├── MSH1024.bmp
│ ├── Thumbnail.png
│ ├── atlas.dds
│ ├── readme.txt
│ ├── tank
│ │ ├── MIT.txt
│ │ ├── TankScene.sdkmesh
│ │ ├── colorgradient.dds
│ │ ├── desert_sky.dds
│ │ ├── desertsky.sdkmesh
│ │ ├── ground_diff.dds
│ │ ├── ground_norm.dds
│ │ ├── left_engine_diff.dds
│ │ ├── left_engine_norm.dds
│ │ ├── turret_diff.dds
│ │ └── turret_norm.dds
│ └── ui
│ │ ├── Font.dds
│ │ ├── MIT.txt
│ │ └── dxutcontrols.dds
├── premake
│ └── premake5.lua
└── src
│ ├── GPUParticleSystem.cpp
│ ├── GPUParticles11.cpp
│ ├── ParticleHelpers.h
│ ├── ParticleSystem.h
│ ├── ResourceFiles
│ ├── GPUParticles11.rc
│ ├── dpiaware.manifest
│ └── resource.h
│ ├── Shaders
│ ├── CoarseCullingCS.hlsl
│ ├── CullingCS.hlsl
│ ├── FullscreenQuad.hlsl
│ ├── Globals.h
│ ├── InitDeadList.hlsl
│ ├── InitSortArgsCS.hlsl
│ ├── ParticleEmit.hlsl
│ ├── ParticleRender.hlsl
│ ├── ParticleRenderQuad.hlsl
│ ├── ParticleSimulation.hlsl
│ ├── ParticleSort.hlsl
│ ├── RenderScene.hlsl
│ ├── ShaderConstants.h
│ ├── SortCS.hlsl
│ ├── SortInnerCS.hlsl
│ ├── SortStepCS2.hlsl
│ ├── Terrain.hlsl
│ └── TiledRendering.hlsl
│ ├── SortLib.cpp
│ ├── SortLib.h
│ ├── Terrain.cpp
│ └── Terrain.h
└── premake
├── LICENSE.txt
├── amd_premake_util.lua
├── premake5.exe
├── update_all_vs_files_for_dx11_sample.bat
└── update_vs_files_for_dx11_sample.bat
/.gitattributes:
--------------------------------------------------------------------------------
1 | # This is a windows-only project. Force CRLF.
2 | * text eol=crlf
3 |
4 | # Explicit settings for specific file types.
5 | *.h eol=crlf
6 | *.cpp eol=crlf
7 | *.inl eol=crlf
8 | *.hlsl eol=crlf
9 | *.rc eol=crlf
10 | *.manifest eol=crlf
11 | *.vcxproj eol=crlf
12 | *.filters eol=crlf
13 | *.props eol=crlf
14 | *.sln eol=crlf
15 | *.bat eol=crlf
16 | *.txt eol=crlf
17 | *.lua eol=crlf
18 | *.md eol=crlf
19 | *.pdf binary
20 | *.ppsx binary
21 | *.ico binary
22 | *.png binary
23 | *.bmp binary
24 | *.dds binary
25 | *.DDS binary
26 | *.sdkmesh binary
27 | *.dll binary
28 | *.exe binary
29 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # AMD GPU Particles Sample
2 |
3 |
4 | The GPUParticles11 DirectX 11 sample demonstrates how to implement a simple GPU-based particle system. It also shows how to perform depth buffer collisions as well as sorting the particles on the GPU for correct blending of rasterized billboards. The sample also shows an alternative technique to rasterization that leverages DirectCompute to render the particles in tiles in a compute shader.
5 |
6 | ### Prerequisites
7 | * AMD Radeon™ GCN-based GPU (HD 7000 series or newer)
8 | * 64-bit Windows® 7 (SP1 with the [Platform Update](https://msdn.microsoft.com/en-us/library/windows/desktop/jj863687.aspx)), Windows® 8.1, or Windows® 10
9 | * Visual Studio® 2012, Visual Studio® 2013, or Visual Studio® 2015
10 |
11 | ### Getting Started
12 | * Visual Studio solutions for VS2012, VS2013, and VS2015 can be found in the `gpuparticles11\build` directory.
13 | * Additional documentation can be found in the `gpuparticles11\doc` directory.
14 |
15 | ### Premake
16 | The Visual Studio solutions and projects in this repo were generated with Premake. To generate the project files yourself (for another version of Visual Studio, for example), open a command prompt in the `premake` directory and execute the following command:
17 |
18 | * `update_vs_files_for_dx11_sample.bat gpuparticles11 [action]`
19 | * For example: `update_vs_files_for_dx11_sample.bat gpuparticles11 vs2010`
20 |
21 | This version of Premake has been modified from the stock version to use the property sheet technique for the Windows SDK from this [Visual C++ Team blog post](http://blogs.msdn.com/b/vcblog/archive/2012/11/23/using-the-windows-8-sdk-with-visual-studio-2010-configuring-multiple-projects.aspx). The technique was originally described for using the Windows 8.0 SDK with Visual Studio 2010, but it applies more generally to using newer versions of the Windows SDK with older versions of Visual Studio.
22 |
23 | The default SDK for a particular version of Visual Studio (for 2012 or higher) is installed as part of Visual Studio installation. This default (Windows 8.0 SDK for Visual Studio 2012 and Windows 8.1 SDK for Visual Studio 2013) will be used if newer SDKs do not exist on the user's machine. However, the projects generated with this version of Premake will use the next higher SDK (Windows 8.1 SDK for Visual Studio 2012 and Windows 10 SDK with Visual Studio 2013), if the newer SDKs exist on the user's machine.
24 |
25 | For Visual Studio 2015, this version of Premake adds the `WindowsTargetPlatformVersion` element to the project file to specify which version of the Windows SDK will be used. To change `WindowsTargetPlatformVersion` for Visual Studio 2015, change the value for `_AMD_WIN_SDK_VERSION` in `premake\amd_premake_util.lua` and regenerate the Visual Studio files.
26 |
27 | ### Third-Party Software
28 | * DXUT is distributed under the terms of the MIT License. See `dxut\MIT.txt`.
29 | * Premake is distributed under the terms of the BSD License. See `premake\LICENSE.txt`.
30 |
31 | ### Attribution
32 | * AMD, the AMD Arrow logo, Radeon, and combinations thereof are either registered trademarks or trademarks of Advanced Micro Devices, Inc. in the United States and/or other countries.
33 | * Microsoft, DirectX, Visual Studio, and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.
34 |
--------------------------------------------------------------------------------
/amd_sdk/.gitattributes:
--------------------------------------------------------------------------------
1 | # This is a windows-only project. Force CRLF.
2 | * text eol=crlf
3 |
4 | # Explicit settings for specific file types.
5 | *.h eol=crlf
6 | *.cpp eol=crlf
7 | *.inl eol=crlf
8 | *.hlsl eol=crlf
9 | *.rc eol=crlf
10 | *.manifest eol=crlf
11 | *.vcxproj eol=crlf
12 | *.filters eol=crlf
13 | *.props eol=crlf
14 | *.sln eol=crlf
15 | *.bat eol=crlf
16 | *.txt eol=crlf
17 | *.lua eol=crlf
18 | *.md eol=crlf
19 | *.pdf binary
20 | *.ppsx binary
21 | *.ico binary
22 | *.png binary
23 | *.dds binary
24 | *.sdkmesh binary
25 | *.dll binary
26 | *.exe binary
27 |
--------------------------------------------------------------------------------
/amd_sdk/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, etc.
2 |
3 | # User-specific files
4 | *.suo
5 | *.user
6 |
7 | # Build results
8 | [Dd]esktop_*/
9 | lib/
10 |
11 | # Visual Studo 2015 cache/options directory
12 | .vs/
13 |
14 | # Visual C++ cache files
15 | ipch/
16 | *.aps
17 | *.ncb
18 | *.opensdf
19 | *.sdf
20 | *.cachefile
21 |
22 | # Visual Studio profiler
23 | *.psess
24 | *.vsp
25 | *.vspx
26 |
27 | # Installshield output folder
28 | [Ee]xpress/
29 |
30 | # Backup & report files from converting an old project file
31 | # to a newer Visual Studio version. Backup files are not needed,
32 | # because we have git ;-)
33 | _UpgradeReport_Files/
34 | Backup*/
35 | UpgradeLog*.XML
36 | UpgradeLog*.htm
37 |
--------------------------------------------------------------------------------
/amd_sdk/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/amd_sdk/README.md:
--------------------------------------------------------------------------------
1 | # AMD SDK
2 |
3 |
4 | The AMD SDK project contains utility code used by AMD samples based on DirectX 11.
5 |
6 | For examples that use AMD SDK, see the DirectX 11 samples here:
7 |
8 | * [GPUOpen Libraries & SDKs](https://github.com/GPUOpen-LibrariesAndSDKs/)
9 |
10 | ### Prerequisites
11 | * AMD Radeon™ GCN-based GPU (HD 7000 series or newer)
12 | * 64-bit Windows® 7 (SP1 with the [Platform Update](https://msdn.microsoft.com/en-us/library/windows/desktop/jj863687.aspx)), Windows® 8.1, or Windows® 10
13 | * Visual Studio® 2012, Visual Studio® 2013, or Visual Studio® 2015
14 |
15 | ### Getting Started
16 | * Visual Studio projects for VS2012, VS2013, and VS2015 can be found in the `build` directory.
17 | * Samples that make use of the AMD SDK can be found here: [GPUOpen Libraries & SDKs](https://github.com/GPUOpen-LibrariesAndSDKs/)
18 |
--------------------------------------------------------------------------------
/amd_sdk/build/AMD_SDK_2010.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {1F80880B-8B89-887C-1405-9F7C800D947C}
6 |
7 |
8 | {2DAB880B-99B4-887C-2230-9F7C8E38947C}
9 |
10 |
11 | {06ADC7FB-7262-40F1-FB56-3AC8670B37F5}
12 |
13 |
14 |
15 |
16 | src\Shaders
17 |
18 |
19 | src\Shaders
20 |
21 |
22 |
23 |
24 | inc
25 |
26 |
27 | inc
28 |
29 |
30 | src
31 |
32 |
33 | src
34 |
35 |
36 | src
37 |
38 |
39 | src
40 |
41 |
42 | src
43 |
44 |
45 | src
46 |
47 |
48 | src
49 |
50 |
51 | src
52 |
53 |
54 | src
55 |
56 |
57 | src
58 |
59 |
60 | src
61 |
62 |
63 |
64 |
65 | src
66 |
67 |
68 | src
69 |
70 |
71 | src
72 |
73 |
74 | src
75 |
76 |
77 | src
78 |
79 |
80 | src
81 |
82 |
83 | src
84 |
85 |
86 | src
87 |
88 |
89 | src
90 |
91 |
92 | src
93 |
94 |
95 | src
96 |
97 |
98 | src
99 |
100 |
101 |
--------------------------------------------------------------------------------
/amd_sdk/build/AMD_SDK_2012.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {1F80880B-8B89-887C-1405-9F7C800D947C}
6 |
7 |
8 | {2DAB880B-99B4-887C-2230-9F7C8E38947C}
9 |
10 |
11 | {06ADC7FB-7262-40F1-FB56-3AC8670B37F5}
12 |
13 |
14 |
15 |
16 | src\Shaders
17 |
18 |
19 | src\Shaders
20 |
21 |
22 |
23 |
24 | inc
25 |
26 |
27 | inc
28 |
29 |
30 | src
31 |
32 |
33 | src
34 |
35 |
36 | src
37 |
38 |
39 | src
40 |
41 |
42 | src
43 |
44 |
45 | src
46 |
47 |
48 | src
49 |
50 |
51 | src
52 |
53 |
54 | src
55 |
56 |
57 | src
58 |
59 |
60 | src
61 |
62 |
63 |
64 |
65 | src
66 |
67 |
68 | src
69 |
70 |
71 | src
72 |
73 |
74 | src
75 |
76 |
77 | src
78 |
79 |
80 | src
81 |
82 |
83 | src
84 |
85 |
86 | src
87 |
88 |
89 | src
90 |
91 |
92 | src
93 |
94 |
95 | src
96 |
97 |
98 | src
99 |
100 |
101 |
--------------------------------------------------------------------------------
/amd_sdk/build/AMD_SDK_2013.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {1F80880B-8B89-887C-1405-9F7C800D947C}
6 |
7 |
8 | {2DAB880B-99B4-887C-2230-9F7C8E38947C}
9 |
10 |
11 | {06ADC7FB-7262-40F1-FB56-3AC8670B37F5}
12 |
13 |
14 |
15 |
16 | src\Shaders
17 |
18 |
19 | src\Shaders
20 |
21 |
22 |
23 |
24 | inc
25 |
26 |
27 | inc
28 |
29 |
30 | src
31 |
32 |
33 | src
34 |
35 |
36 | src
37 |
38 |
39 | src
40 |
41 |
42 | src
43 |
44 |
45 | src
46 |
47 |
48 | src
49 |
50 |
51 | src
52 |
53 |
54 | src
55 |
56 |
57 | src
58 |
59 |
60 | src
61 |
62 |
63 |
64 |
65 | src
66 |
67 |
68 | src
69 |
70 |
71 | src
72 |
73 |
74 | src
75 |
76 |
77 | src
78 |
79 |
80 | src
81 |
82 |
83 | src
84 |
85 |
86 | src
87 |
88 |
89 | src
90 |
91 |
92 | src
93 |
94 |
95 | src
96 |
97 |
98 | src
99 |
100 |
101 |
--------------------------------------------------------------------------------
/amd_sdk/build/AMD_SDK_2015.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {1F80880B-8B89-887C-1405-9F7C800D947C}
6 |
7 |
8 | {2DAB880B-99B4-887C-2230-9F7C8E38947C}
9 |
10 |
11 | {06ADC7FB-7262-40F1-FB56-3AC8670B37F5}
12 |
13 |
14 |
15 |
16 | src\Shaders
17 |
18 |
19 | src\Shaders
20 |
21 |
22 |
23 |
24 | inc
25 |
26 |
27 | inc
28 |
29 |
30 | src
31 |
32 |
33 | src
34 |
35 |
36 | src
37 |
38 |
39 | src
40 |
41 |
42 | src
43 |
44 |
45 | src
46 |
47 |
48 | src
49 |
50 |
51 | src
52 |
53 |
54 | src
55 |
56 |
57 | src
58 |
59 |
60 | src
61 |
62 |
63 |
64 |
65 | src
66 |
67 |
68 | src
69 |
70 |
71 | src
72 |
73 |
74 | src
75 |
76 |
77 | src
78 |
79 |
80 | src
81 |
82 |
83 | src
84 |
85 |
86 | src
87 |
88 |
89 | src
90 |
91 |
92 | src
93 |
94 |
95 | src
96 |
97 |
98 | src
99 |
100 |
101 |
--------------------------------------------------------------------------------
/amd_sdk/build/AMD_SDK_Minimal_2010.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {1F80880B-8B89-887C-1405-9F7C800D947C}
6 |
7 |
8 | {2DAB880B-99B4-887C-2230-9F7C8E38947C}
9 |
10 |
11 | {06ADC7FB-7262-40F1-FB56-3AC8670B37F5}
12 |
13 |
14 |
15 |
16 | src\Shaders
17 |
18 |
19 | src\Shaders
20 |
21 |
22 |
23 |
24 | inc
25 |
26 |
27 | inc
28 |
29 |
30 | src
31 |
32 |
33 | src
34 |
35 |
36 | src
37 |
38 |
39 | src
40 |
41 |
42 | src
43 |
44 |
45 | src
46 |
47 |
48 | src
49 |
50 |
51 | src
52 |
53 |
54 | src
55 |
56 |
57 | src
58 |
59 |
60 | src
61 |
62 |
63 |
64 |
65 | src
66 |
67 |
68 | src
69 |
70 |
71 | src
72 |
73 |
74 | src
75 |
76 |
77 | src
78 |
79 |
80 | src
81 |
82 |
83 | src
84 |
85 |
86 | src
87 |
88 |
89 | src
90 |
91 |
92 | src
93 |
94 |
95 | src
96 |
97 |
98 | src
99 |
100 |
101 |
--------------------------------------------------------------------------------
/amd_sdk/build/AMD_SDK_Minimal_2012.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {1F80880B-8B89-887C-1405-9F7C800D947C}
6 |
7 |
8 | {2DAB880B-99B4-887C-2230-9F7C8E38947C}
9 |
10 |
11 | {06ADC7FB-7262-40F1-FB56-3AC8670B37F5}
12 |
13 |
14 |
15 |
16 | src\Shaders
17 |
18 |
19 | src\Shaders
20 |
21 |
22 |
23 |
24 | inc
25 |
26 |
27 | inc
28 |
29 |
30 | src
31 |
32 |
33 | src
34 |
35 |
36 | src
37 |
38 |
39 | src
40 |
41 |
42 | src
43 |
44 |
45 | src
46 |
47 |
48 | src
49 |
50 |
51 | src
52 |
53 |
54 | src
55 |
56 |
57 | src
58 |
59 |
60 | src
61 |
62 |
63 |
64 |
65 | src
66 |
67 |
68 | src
69 |
70 |
71 | src
72 |
73 |
74 | src
75 |
76 |
77 | src
78 |
79 |
80 | src
81 |
82 |
83 | src
84 |
85 |
86 | src
87 |
88 |
89 | src
90 |
91 |
92 | src
93 |
94 |
95 | src
96 |
97 |
98 | src
99 |
100 |
101 |
--------------------------------------------------------------------------------
/amd_sdk/build/AMD_SDK_Minimal_2013.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {1F80880B-8B89-887C-1405-9F7C800D947C}
6 |
7 |
8 | {2DAB880B-99B4-887C-2230-9F7C8E38947C}
9 |
10 |
11 | {06ADC7FB-7262-40F1-FB56-3AC8670B37F5}
12 |
13 |
14 |
15 |
16 | src\Shaders
17 |
18 |
19 | src\Shaders
20 |
21 |
22 |
23 |
24 | inc
25 |
26 |
27 | inc
28 |
29 |
30 | src
31 |
32 |
33 | src
34 |
35 |
36 | src
37 |
38 |
39 | src
40 |
41 |
42 | src
43 |
44 |
45 | src
46 |
47 |
48 | src
49 |
50 |
51 | src
52 |
53 |
54 | src
55 |
56 |
57 | src
58 |
59 |
60 | src
61 |
62 |
63 |
64 |
65 | src
66 |
67 |
68 | src
69 |
70 |
71 | src
72 |
73 |
74 | src
75 |
76 |
77 | src
78 |
79 |
80 | src
81 |
82 |
83 | src
84 |
85 |
86 | src
87 |
88 |
89 | src
90 |
91 |
92 | src
93 |
94 |
95 | src
96 |
97 |
98 | src
99 |
100 |
101 |
--------------------------------------------------------------------------------
/amd_sdk/build/AMD_SDK_Minimal_2015.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {1F80880B-8B89-887C-1405-9F7C800D947C}
6 |
7 |
8 | {2DAB880B-99B4-887C-2230-9F7C8E38947C}
9 |
10 |
11 | {06ADC7FB-7262-40F1-FB56-3AC8670B37F5}
12 |
13 |
14 |
15 |
16 | src\Shaders
17 |
18 |
19 | src\Shaders
20 |
21 |
22 |
23 |
24 | inc
25 |
26 |
27 | inc
28 |
29 |
30 | src
31 |
32 |
33 | src
34 |
35 |
36 | src
37 |
38 |
39 | src
40 |
41 |
42 | src
43 |
44 |
45 | src
46 |
47 |
48 | src
49 |
50 |
51 | src
52 |
53 |
54 | src
55 |
56 |
57 | src
58 |
59 |
60 | src
61 |
62 |
63 |
64 |
65 | src
66 |
67 |
68 | src
69 |
70 |
71 | src
72 |
73 |
74 | src
75 |
76 |
77 | src
78 |
79 |
80 | src
81 |
82 |
83 | src
84 |
85 |
86 | src
87 |
88 |
89 | src
90 |
91 |
92 | src
93 |
94 |
95 | src
96 |
97 |
98 | src
99 |
100 |
101 |
--------------------------------------------------------------------------------
/amd_sdk/build/Windows10SDKVS13_x64.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $(ProgramFiles)\Windows Kits\10\bin\x86;$(ExecutablePath)
7 | $(ProgramFiles)\Windows Kits\10\Include\10.0.10240.0\um;$(ProgramFiles)\Windows Kits\10\Include\10.0.10240.0\shared;$(ProgramFiles)\Windows Kits\10\Include\10.0.10240.0\winrt;$(IncludePath)
8 | $(ProgramFiles)\Windows Kits\10\lib\10.0.10240.0\um\x64;$(LibraryPath)
9 | $(ProgramFiles)\Windows Kits\10\Include\10.0.10240.0\um;$(ProgramFiles)\Windows Kits\10\Include\10.0.10240.0\shared;$(ProgramFiles)\Windows Kits\10\Include\10.0.10240.0\winrt;$(ExcludePath)
10 |
11 |
12 |
--------------------------------------------------------------------------------
/amd_sdk/build/Windows81SDKVS12_x64.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $(ProgramFiles)\Windows Kits\8.1\bin\x86;$(ExecutablePath)
7 | $(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(IncludePath)
8 | $(ProgramFiles)\Windows Kits\8.1\lib\winv6.3\um\x64;$(LibraryPath)
9 | $(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(ExcludePath)
10 |
11 |
12 |
--------------------------------------------------------------------------------
/amd_sdk/build/Windows81SDK_x64.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $(VCInstallDir)bin\x86_amd64;$(VCInstallDir)bin;$(WindowsSdkDir)bin\NETFX 4.0 Tools;$(ProgramFiles)\Windows Kits\8.1\bin\x86;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;$(ProgramFiles)\HTML Help Workshop;$(FrameworkSDKDir)\bin;$(MSBuildToolsPath32);$(VSInstallDir);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)
7 | $(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(FrameworkSDKDir)\include;
8 | $(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(ProgramFiles)\Windows Kits\8.1\lib\winv6.3\um\x64;$(FrameworkSDKDir)\lib\x64
9 | $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(FrameworkSDKDir)\include;$(MSBuildToolsPath32);$(VCInstallDir)atlmfc\lib;$(VCInstallDir)lib;
10 |
11 |
12 |
--------------------------------------------------------------------------------
/amd_sdk/build/Windows8SDK_x64.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $(VCInstallDir)bin\x86_amd64;$(VCInstallDir)bin;$(WindowsSdkDir)bin\NETFX 4.0 Tools;$(ProgramFiles)\Windows Kits\8.0\bin\x86;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;$(ProgramFiles)\HTML Help Workshop;$(FrameworkSDKDir)\bin;$(MSBuildToolsPath32);$(VSInstallDir);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)
7 | $(ProgramFiles)\Windows Kits\8.0\Include\um;$(ProgramFiles)\Windows Kits\8.0\Include\shared;$(ProgramFiles)\Windows Kits\8.0\Include\winrt;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(FrameworkSDKDir)\include;
8 | $(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(ProgramFiles)\Windows Kits\8.0\lib\win8\um\x64;$(FrameworkSDKDir)\lib\x64
9 | $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(ProgramFiles)\Windows Kits\8.0\Include\um;$(ProgramFiles)\Windows Kits\8.0\Include\shared;$(ProgramFiles)\Windows Kits\8.0\Include\winrt;$(FrameworkSDKDir)\include;$(MSBuildToolsPath32);$(VCInstallDir)atlmfc\lib;$(VCInstallDir)lib;
10 |
11 |
12 |
--------------------------------------------------------------------------------
/amd_sdk/inc/AMD_SDK.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | //--------------------------------------------------------------------------------------
24 | // File: AMD_SDK.h
25 | //
26 | // Library include file, to drag in all AMD SDK helper classes and functions.
27 | //--------------------------------------------------------------------------------------
28 | #ifndef AMD_SDK_H
29 | #define AMD_SDK_H
30 |
31 | #define VENDOR_ID_AMD (0x1002)
32 | #define VENDOR_ID_NVIDIA (0x10DE)
33 | #define VENDOR_ID_INTEL (0x8086)
34 |
35 | // DXUT helper code
36 | #include "..\\..\\DXUT\\Core\\DXUT.h"
37 | #include "..\\..\\DXUT\\Core\\DXUTmisc.h"
38 | #include "..\\..\\DXUT\\Optional\\DXUTgui.h"
39 | #include "..\\..\\DXUT\\Optional\\SDKmisc.h"
40 | #include "..\\..\\DXUT\\Optional\\SDKMesh.h"
41 |
42 | // AMD helper classes and functions
43 | #include "..\\src\\Timer.h"
44 | #include "..\\src\\ShaderCache.h"
45 | #include "..\\src\\HelperFunctions.h"
46 | #include "..\\src\\Sprite.h"
47 | #include "..\\src\\Magnify.h"
48 | #include "..\\src\\MagnifyTool.h"
49 | #include "..\\src\\HUD.h"
50 | #include "..\\src\\Geometry.h"
51 | #include "..\\src\\LineRender.h"
52 | #include "..\\src\\AMD_Mesh.h"
53 |
54 | #ifndef ARRAYSIZE
55 | #define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0]))
56 | #endif
57 |
58 | // Profile helpers for timing and marking up as D3D perf blocks
59 | #define AMD_PROFILE_RED D3DCOLOR_XRGB( 255, 0, 0 )
60 | #define AMD_PROFILE_GREEN D3DCOLOR_XRGB( 0, 255, 0 )
61 | #define AMD_PROFILE_BLUE D3DCOLOR_XRGB( 0, 0, 255 )
62 |
63 | #define AMDProfileBegin( col, name ) DXUT_BeginPerfEvent( col, name ); TIMER_Begin( col, name )
64 | #define AMDProfileEnd() TIMER_End() DXUT_EndPerfEvent();
65 |
66 | struct AMDProfileEventClass
67 | {
68 | AMDProfileEventClass( unsigned int col, LPCWSTR name ) { AMDProfileBegin( col, name ); }
69 | ~AMDProfileEventClass() { AMDProfileEnd() }
70 | };
71 |
72 | #define AMDProfileEvent( col, name ) AMDProfileEventClass _amd_profile_event( col, name )
73 |
74 | #endif // AMD_SDK_H
75 |
--------------------------------------------------------------------------------
/amd_sdk/inc/ShaderCacheSampleHelper.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | //--------------------------------------------------------------------------------------
24 | // File: ShaderCacheSampleHelper.h
25 | //
26 | // Helpers to implement the DXUT related ShaderCache interface in samples.
27 | //--------------------------------------------------------------------------------------
28 | #ifndef AMD_SDK_SHADER_CACHE_SAMPLE_HELPER_H
29 | #define AMD_SDK_SHADER_CACHE_SAMPLE_HELPER_H
30 |
31 |
32 | class CDXUTControl;
33 | class CDXUTTextHelper;
34 | typedef long HRESULT;
35 | typedef unsigned int UINT;
36 |
37 | namespace AMD
38 | {
39 |
40 | class HUD;
41 | class ShaderCache;
42 |
43 | //--------------------------------------------------------------------------------------
44 | // UI control IDs
45 | //--------------------------------------------------------------------------------------
46 | extern const int g_MaxApplicationControlID;
47 |
48 | enum SHADER_CACHE_SAMPLE_HELPER_IDC
49 | {
50 | AMD_IDC_START = 0,
51 | AMD_IDC_BUTTON_SHOW_SHADERCACHE_UI = AMD_IDC_START,
52 | AMD_IDC_BUTTON_RECOMPILESHADERS_CHANGED,
53 | AMD_IDC_BUTTON_RECOMPILESHADERS_GLOBAL,
54 | AMD_IDC_BUTTON_RECREATE_SHADERS,
55 | AMD_IDC_CHECKBOX_AUTORECOMPILE_SHADERS,
56 | AMD_IDC_CHECKBOX_SHOW_SHADER_ERRORS,
57 | AMD_IDC_CHECKBOX_SHOW_ISA_GPR_PRESSURE,
58 | AMD_IDC_STATIC_TARGET_ISA,
59 | AMD_IDC_STATIC_TARGET_ISA_INFO,
60 | AMD_IDC_COMBOBOX_TARGET_ISA,
61 | AMD_IDC_END
62 | };
63 |
64 | template< typename T >
65 | T GetEnum( T i_AMDEnum )
66 | {
67 | return static_cast< T > ( g_MaxApplicationControlID + i_AMDEnum );
68 | }
69 |
70 | void InitApp( ShaderCache& r_ShaderCache, HUD& r_HUD, int& iY, const bool i_bAdvancedShaderCacheGUI_VisibleByDefault = false );
71 | void ProcessUIChanges();
72 | void RenderHUDUpdates( CDXUTTextHelper* i_pTxtHelper );
73 | void __stdcall OnGUIEvent( UINT nEvent, int nControlID, CDXUTControl* pControl, void* pUserContext );
74 |
75 | } // namespace AMD
76 |
77 | #endif
78 |
--------------------------------------------------------------------------------
/amd_sdk/media/AMD.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/GPUParticles11/1f2ef4f0cf2025238c7823eede0ec0db7346efab/amd_sdk/media/AMD.dds
--------------------------------------------------------------------------------
/amd_sdk/media/AMD.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/GPUParticles11/1f2ef4f0cf2025238c7823eede0ec0db7346efab/amd_sdk/media/AMD.ico
--------------------------------------------------------------------------------
/amd_sdk/media/amd_logo_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/GPUParticles11/1f2ef4f0cf2025238c7823eede0ec0db7346efab/amd_sdk/media/amd_logo_black.png
--------------------------------------------------------------------------------
/amd_sdk/premake/premake5.lua:
--------------------------------------------------------------------------------
1 | dofile ("../../premake/amd_premake_util.lua")
2 |
3 | workspace "AMD_SDK"
4 | configurations { "Debug", "Release" }
5 | platforms { "x64" }
6 | location "../build"
7 | filename ("AMD_SDK" .. _AMD_VS_SUFFIX)
8 | startproject "AMD_SDK"
9 |
10 | filter "platforms:x64"
11 | system "Windows"
12 | architecture "x64"
13 |
14 | project "AMD_SDK"
15 | kind "StaticLib"
16 | language "C++"
17 | location "../build"
18 | filename ("AMD_SDK" .. _AMD_VS_SUFFIX)
19 | uuid "EBB939DC-98E4-49DF-B1F1-D2E80A11F60A"
20 | targetdir "../lib"
21 | objdir "../build/%{_AMD_SAMPLE_DIR_LAYOUT}"
22 | warnings "Extra"
23 | floatingpoint "Fast"
24 |
25 | -- Specify WindowsTargetPlatformVersion here for VS2015
26 | windowstarget (_AMD_WIN_SDK_VERSION)
27 |
28 | files { "../inc/**.h", "../src/**.h", "../src/**.cpp", "../src/**.hlsl" }
29 |
30 | filter "configurations:Debug"
31 | defines { "WIN32", "_DEBUG", "DEBUG", "PROFILE", "_WINDOWS", "_LIB", "_WIN32_WINNT=0x0601" }
32 | flags { "Symbols", "FatalWarnings", "Unicode" }
33 | targetsuffix ("_Debug" .. _AMD_VS_SUFFIX)
34 |
35 | filter "configurations:Release"
36 | defines { "WIN32", "NDEBUG", "_WINDOWS", "_LIB", "_WIN32_WINNT=0x0601" }
37 | flags { "LinkTimeOptimization", "Symbols", "FatalWarnings", "Unicode" }
38 | targetsuffix ("_Release" .. _AMD_VS_SUFFIX)
39 | optimize "On"
40 |
--------------------------------------------------------------------------------
/amd_sdk/premake/premake5_minimal.lua:
--------------------------------------------------------------------------------
1 | dofile ("../../premake/amd_premake_util.lua")
2 |
3 | workspace "AMD_SDK_Minimal"
4 | configurations { "Debug", "Release" }
5 | platforms { "x64" }
6 | location "../build"
7 | filename ("AMD_SDK_Minimal" .. _AMD_VS_SUFFIX)
8 | startproject "AMD_SDK_Minimal"
9 |
10 | filter "platforms:x64"
11 | system "Windows"
12 | architecture "x64"
13 |
14 | project "AMD_SDK_Minimal"
15 | kind "StaticLib"
16 | language "C++"
17 | location "../build"
18 | filename ("AMD_SDK_Minimal" .. _AMD_VS_SUFFIX)
19 | uuid "EBB939DC-98E4-49DF-B1F1-D2E80A11F60A"
20 | targetdir "../lib"
21 | objdir "../build/%{_AMD_SAMPLE_DIR_LAYOUT_MINIMAL}"
22 | warnings "Extra"
23 | floatingpoint "Fast"
24 |
25 | -- Specify WindowsTargetPlatformVersion here for VS2015
26 | windowstarget (_AMD_WIN_SDK_VERSION)
27 |
28 | files { "../inc/**.h", "../src/**.h", "../src/**.cpp", "../src/**.hlsl" }
29 | defines { "AMD_SDK_MINIMAL" }
30 |
31 | filter "configurations:Debug"
32 | defines { "WIN32", "_DEBUG", "DEBUG", "PROFILE", "_WINDOWS", "_LIB", "_WIN32_WINNT=0x0601" }
33 | flags { "Symbols", "FatalWarnings", "Unicode" }
34 | targetsuffix ("_Debug" .. _AMD_VS_SUFFIX)
35 |
36 | filter "configurations:Release"
37 | defines { "WIN32", "NDEBUG", "_WINDOWS", "_LIB", "_WIN32_WINNT=0x0601" }
38 | flags { "LinkTimeOptimization", "Symbols", "FatalWarnings", "Unicode" }
39 | targetsuffix ("_Release" .. _AMD_VS_SUFFIX)
40 | optimize "On"
41 |
--------------------------------------------------------------------------------
/amd_sdk/src/AMD_Mesh.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | //--------------------------------------------------------------------------------------
24 | // File: AMD_Mesh.h
25 | //
26 | // Convenience wrapper for loading and drawing models with Assimp or DXUT sdkmesh.
27 | //--------------------------------------------------------------------------------------
28 | #ifndef AMD_SDK_MESH_H
29 | #define AMD_SDK_MESH_H
30 |
31 | #include
32 | #include
33 |
34 | #ifndef AMD_SAFE_RELEASE
35 | #define AMD_SAFE_RELEASE(p) { if (p) { p->Release(); p = NULL; } }
36 | #endif
37 |
38 | class CDXUTSDKMesh;
39 |
40 | namespace AMD
41 | {
42 | class Mesh
43 | {
44 | ID3D11Buffer * _b1d_vertex;
45 | ID3D11Buffer * _b1d_index;
46 | std::vector _t2d;
47 |
48 | struct MaterialGroup
49 | {
50 | int _first_index;
51 | int _index_count;
52 | int _texture_index;
53 |
54 | MaterialGroup()
55 | : _first_index(0)
56 | , _index_count(0)
57 | , _texture_index(0)
58 | {}
59 | };
60 |
61 | struct Vertex
62 | {
63 | float position[3];
64 | float normal[3];
65 | float uv[2];
66 | };
67 |
68 | std::vector _material_group;
69 |
70 | char _name[128];
71 | int _id;
72 |
73 | public:
74 | CDXUTSDKMesh m_sdkMesh;
75 | bool m_isSdkMesh;
76 |
77 | Mesh();
78 | ~Mesh();
79 |
80 | std::vector _vertex;
81 | std::vector _index;
82 | std::vector _srv;
83 |
84 | HRESULT Create(ID3D11Device * pDevice, const char * path, const char * name, bool sdkmesh = false);
85 |
86 | HRESULT Render(ID3D11DeviceContext * pContext);
87 | HRESULT Release();
88 |
89 | ID3D11ShaderResourceView ** srv();
90 | };
91 |
92 | } // namespace AMD
93 |
94 | #endif
95 |
--------------------------------------------------------------------------------
/amd_sdk/src/Geometry.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | //--------------------------------------------------------------------------------------
24 | // File: Geometry.cpp
25 | //
26 | // Classes for geometric primitives and collision and visibility testing
27 | //--------------------------------------------------------------------------------------
28 | #include "..\\..\\DXUT\\Core\\DXUT.h"
29 | #include "Geometry.h"
30 |
31 | using namespace DirectX;
32 |
33 | //--------------------------------------------------------------------------------------
34 | // Helper function to normalize a plane
35 | //--------------------------------------------------------------------------------------
36 | static void NormalizePlane( XMFLOAT4* pPlaneEquation )
37 | {
38 | float mag;
39 |
40 | mag = sqrtf( pPlaneEquation->x * pPlaneEquation->x +
41 | pPlaneEquation->y * pPlaneEquation->y +
42 | pPlaneEquation->z * pPlaneEquation->z );
43 |
44 | pPlaneEquation->x = pPlaneEquation->x / mag;
45 | pPlaneEquation->y = pPlaneEquation->y / mag;
46 | pPlaneEquation->z = pPlaneEquation->z / mag;
47 | pPlaneEquation->w = pPlaneEquation->w / mag;
48 | }
49 |
50 |
51 | //--------------------------------------------------------------------------------------
52 | // Extract all 6 plane equations from frustum denoted by supplied matrix
53 | //--------------------------------------------------------------------------------------
54 | void ExtractPlanesFromFrustum( XMFLOAT4* pPlaneEquation, const XMMATRIX* pMatrix, bool bNormalize )
55 | {
56 | XMFLOAT4X4 TempMat;
57 | XMStoreFloat4x4( &TempMat, *pMatrix);
58 |
59 | // Left clipping plane
60 | pPlaneEquation[0].x = TempMat._14 + TempMat._11;
61 | pPlaneEquation[0].y = TempMat._24 + TempMat._21;
62 | pPlaneEquation[0].z = TempMat._34 + TempMat._31;
63 | pPlaneEquation[0].w = TempMat._44 + TempMat._41;
64 |
65 | // Right clipping plane
66 | pPlaneEquation[1].x = TempMat._14 - TempMat._11;
67 | pPlaneEquation[1].y = TempMat._24 - TempMat._21;
68 | pPlaneEquation[1].z = TempMat._34 - TempMat._31;
69 | pPlaneEquation[1].w = TempMat._44 - TempMat._41;
70 |
71 | // Top clipping plane
72 | pPlaneEquation[2].x = TempMat._14 - TempMat._12;
73 | pPlaneEquation[2].y = TempMat._24 - TempMat._22;
74 | pPlaneEquation[2].z = TempMat._34 - TempMat._32;
75 | pPlaneEquation[2].w = TempMat._44 - TempMat._42;
76 |
77 | // Bottom clipping plane
78 | pPlaneEquation[3].x = TempMat._14 + TempMat._12;
79 | pPlaneEquation[3].y = TempMat._24 + TempMat._22;
80 | pPlaneEquation[3].z = TempMat._34 + TempMat._32;
81 | pPlaneEquation[3].w = TempMat._44 + TempMat._42;
82 |
83 | // Near clipping plane
84 | pPlaneEquation[4].x = TempMat._13;
85 | pPlaneEquation[4].y = TempMat._23;
86 | pPlaneEquation[4].z = TempMat._33;
87 | pPlaneEquation[4].w = TempMat._43;
88 |
89 | // Far clipping plane
90 | pPlaneEquation[5].x = TempMat._14 - TempMat._13;
91 | pPlaneEquation[5].y = TempMat._24 - TempMat._23;
92 | pPlaneEquation[5].z = TempMat._34 - TempMat._33;
93 | pPlaneEquation[5].w = TempMat._44 - TempMat._43;
94 |
95 | // Normalize the plane equations, if requested
96 | if ( bNormalize )
97 | {
98 | NormalizePlane( &pPlaneEquation[0] );
99 | NormalizePlane( &pPlaneEquation[1] );
100 | NormalizePlane( &pPlaneEquation[2] );
101 | NormalizePlane( &pPlaneEquation[3] );
102 | NormalizePlane( &pPlaneEquation[4] );
103 | NormalizePlane( &pPlaneEquation[5] );
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/amd_sdk/src/Geometry.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | //--------------------------------------------------------------------------------------
24 | // File: Geometry.h
25 | //
26 | // Classes for geometric primitives and collision and visibility testing.
27 | //--------------------------------------------------------------------------------------
28 | #ifndef AMD_SDK_GEOMETRY_H
29 | #define AMD_SDK_GEOMETRY_H
30 |
31 | namespace AMD
32 | {
33 | void ExtractPlanesFromFrustum( DirectX::XMFLOAT4* pPlaneEquation, const DirectX::XMMATRIX* pMatrix, bool bNormalize = true );
34 | }
35 |
36 | #endif
37 |
--------------------------------------------------------------------------------
/amd_sdk/src/HUD.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | //--------------------------------------------------------------------------------------
24 | // File: HUD.h
25 | //
26 | // Class definition for the AMD standard HUD interface.
27 | //--------------------------------------------------------------------------------------
28 | #ifndef AMD_SDK_HUD_H
29 | #define AMD_SDK_HUD_H
30 |
31 |
32 | namespace AMD
33 | {
34 |
35 | class HUD
36 | {
37 | public:
38 |
39 | // AMD standard HUD defines for GUI spacing
40 | static const int iElementDelta = 25;
41 | static const int iGroupDelta = ( iElementDelta * 2 );
42 | static const int iDialogWidth = 250;
43 | static const int iElementHeight = 24;
44 | static const int iElementWidth = 170;
45 | static const int iElementOffset = ( iDialogWidth - iElementWidth ) / 2;
46 | static const int iElementDropHeight = 35;
47 |
48 | // Public access to the CDXUTDialog is allowed for ease of use in the sample
49 | CDXUTDialog m_GUI;
50 |
51 | // Constructor / destructor
52 | HUD();
53 | ~HUD();
54 |
55 | // Various hook functions
56 | HRESULT OnCreateDevice( ID3D11Device* pd3dDevice );
57 | void OnDestroyDevice();
58 | void OnResizedSwapChain( const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc );
59 | void OnRender( float fElapsedTime );
60 |
61 | private:
62 |
63 | // The private AMD logo texture, and sprite object
64 | Sprite m_Sprite;
65 | ID3D11ShaderResourceView* m_pLogoSRV;
66 | };
67 |
68 |
69 | class Slider : public CDXUTControl
70 | {
71 | public:
72 |
73 | Slider( CDXUTDialog& dialog, int id, int& y, const wchar_t* label, int min, int max, int& value );
74 | Slider( CDXUTDialog& dialog, int id, int& y, const wchar_t* label, float min, float max, float step, float& value );
75 | virtual ~Slider() {}
76 |
77 | void OnGuiEvent();
78 | void SetEnabled( bool enable );
79 | void SetVisible( bool visible );
80 | void SetValue( int value );
81 | void SetValue( float value );
82 |
83 | private:
84 |
85 | Slider& operator=( const Slider& );
86 |
87 | int m_Min, m_Max;
88 | float m_MinFloat, m_MaxFloat;
89 |
90 | bool m_UseFloat;
91 | int& m_Value;
92 | float& m_ValueFloat;
93 |
94 | const wchar_t* m_szLabel;
95 | CDXUTSlider* m_pSlider;
96 | CDXUTStatic* m_pLabel;
97 | };
98 |
99 | } // namespace AMD
100 |
101 | #endif
102 |
--------------------------------------------------------------------------------
/amd_sdk/src/LineRender.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | //--------------------------------------------------------------------------------------
24 | // File: LineRender.h
25 | //
26 | // Helper to render 3d colored lines.
27 | //--------------------------------------------------------------------------------------
28 | #ifndef AMD_SDK_LINE_RENDER_H
29 | #define AMD_SDK_LINE_RENDER_H
30 |
31 | // forward declarations
32 | namespace DirectX
33 | {
34 | struct BoundingBox;
35 | }
36 |
37 | namespace AMD
38 | {
39 |
40 | class LineRender
41 | {
42 | public:
43 |
44 | LineRender();
45 | ~LineRender();
46 |
47 | void OnCreateDevice( ID3D11Device* pDevice, ID3D11DeviceContext* pImmediateContext, int nMaxLines );
48 | void OnDestroyDevice();
49 |
50 | void AddLine( const DirectX::XMFLOAT3& p0, const DirectX::XMFLOAT3& p1, const D3DCOLOR& color );
51 | void AddLines( const DirectX::XMFLOAT3* pPoints, int nNumLines, const D3DCOLOR& color );
52 | void AddBox( const DirectX::BoundingBox& box, const D3DCOLOR& color );
53 |
54 | void Render( const DirectX::XMMATRIX& viewProj );
55 |
56 | private:
57 |
58 | struct Vertex
59 | {
60 | DirectX::XMFLOAT3 m_Position;
61 | DWORD m_Color;
62 | };
63 |
64 | struct ConstantBuffer
65 | {
66 | DirectX::XMMATRIX m_ViewProj;
67 | };
68 |
69 | ID3D11DeviceContext* m_pImmediateContext;
70 | ID3D11InputLayout* m_pInputLayout;
71 | ID3D11VertexShader* m_pVertexShader;
72 | ID3D11PixelShader* m_pPixelShader;
73 | ID3D11Buffer* m_pConstantBuffer;
74 | ID3D11Buffer* m_pVertexBuffer;
75 | Vertex* m_pCPUCopy;
76 | int m_MaxLines;
77 | int m_NumLines;
78 | };
79 |
80 | }
81 |
82 | #endif
83 |
--------------------------------------------------------------------------------
/amd_sdk/src/Magnify.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | //--------------------------------------------------------------------------------------
24 | // File: Magnify.h
25 | //
26 | // Magnify class definition. This class magnifies a region of a given surface
27 | // and renders a scaled sprite at the given position on the screen.
28 | //--------------------------------------------------------------------------------------
29 | #ifndef AMD_SDK_MAGNIFY_H
30 | #define AMD_SDK_MAGNIFY_H
31 |
32 | namespace AMD
33 | {
34 |
35 | class Magnify
36 | {
37 | public:
38 |
39 | // Constructor / destructor
40 | Magnify();
41 | ~Magnify();
42 |
43 | // Hooks for the DX SDK Framework
44 | HRESULT OnCreateDevice( ID3D11Device* pd3dDevice );
45 | void OnDestroyDevice();
46 | void OnResizedSwapChain( const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc );
47 |
48 | // Set methods
49 | void SetPixelRegion( int nPixelRegion );
50 | void SetScale( int nScale );
51 | void SetDepthRangeMin( float fDepthRangeMin );
52 | void SetDepthRangeMax( float fDepthRangeMax );
53 | void SetSourceResource( ID3D11Resource* pSourceResource, DXGI_FORMAT Format,
54 | int nWidth, int nHeight, int nSamples );
55 | void SetSubSampleIndex( int nSubSampleIndex );
56 |
57 | // Captures a region, at the current cursor position, for magnification
58 | void Capture( POINT& Point );
59 |
60 | // Render the magnified region, at the capture location
61 | void RenderBackground();
62 | void RenderMagnifiedRegion();
63 |
64 | private:
65 |
66 | // Private methods
67 | void SetPosition( int nPositionX, int nPositionY );
68 | void CreateInternalResources();
69 |
70 | private:
71 |
72 | // Magnification settings
73 | int m_nPositionX;
74 | int m_nPositionY;
75 | int m_nPixelRegion;
76 | int m_nHalfPixelRegion;
77 | int m_nScale;
78 | float m_fDepthRangeMin;
79 | float m_fDepthRangeMax;
80 | int m_nBackBufferWidth;
81 | int m_nBackBufferHeight;
82 | int m_nSubSampleIndex;
83 |
84 | // Helper class for plotting the magnified region
85 | Sprite m_Sprite;
86 |
87 | // Source resource data
88 | ID3D11Resource* m_pSourceResource;
89 | ID3D11Texture2D* m_pResolvedSourceResource;
90 | ID3D11Texture2D* m_pCopySourceResource;
91 | ID3D11ShaderResourceView* m_pResolvedSourceResourceSRV;
92 | ID3D11ShaderResourceView* m_pCopySourceResourceSRV;
93 | ID3D11ShaderResourceView* m_pSourceResourceSRV1;
94 | DXGI_FORMAT m_SourceResourceFormat;
95 | int m_nSourceResourceWidth;
96 | int m_nSourceResourceHeight;
97 | int m_nSourceResourceSamples;
98 | DXGI_FORMAT m_DepthFormat;
99 | DXGI_FORMAT m_DepthSRVFormat;
100 | bool m_bDepthFormat;
101 | };
102 |
103 | } // namespace AMD
104 |
105 | #endif // AMD_SDK_MAGNIFY_H
106 |
--------------------------------------------------------------------------------
/amd_sdk/src/MagnifyTool.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | //--------------------------------------------------------------------------------------
24 | // File: MagnifyTool.h
25 | //
26 | // MagnifyTool class definition. This class implements a user interface based upon
27 | // the DXUT framework for the Magnify class.
28 | //--------------------------------------------------------------------------------------
29 | #ifndef AMD_SDK_MAGNIFY_TOOL_H
30 | #define AMD_SDK_MAGNIFY_TOOL_H
31 |
32 | namespace AMD
33 | {
34 |
35 | // GUI defines
36 | enum MAGNIFY_TOOL_IDC
37 | {
38 | IDC_MAGNIFY_STATIC_CAPTION = 19 + 1024,
39 | IDC_MAGNIFY_CHECKBOX_ENABLE,
40 | IDC_MAGNIFY_CHECKBOX_STICKY,
41 | IDC_MAGNIFY_STATIC_PIXEL_REGION,
42 | IDC_MAGNIFY_SLIDER_PIXEL_REGION,
43 | IDC_MAGNIFY_STATIC_SCALE,
44 | IDC_MAGNIFY_SLIDER_SCALE
45 | };
46 |
47 |
48 | class MagnifyTool
49 | {
50 | public:
51 |
52 | // Constructor / destructor
53 | MagnifyTool();
54 | ~MagnifyTool();
55 |
56 | // Set methods
57 | void SetSourceResources( ID3D11Resource* pSourceRTResource, DXGI_FORMAT RTFormat,
58 | int nWidth, int nHeight, int nSamples );
59 | void SetPixelRegion( int nPixelRegion ) { m_Magnify.SetPixelRegion( nPixelRegion ); }
60 | void SetScale( int nScale ) { m_Magnify.SetScale( nScale ); }
61 |
62 | // Hooks for the DX SDK Framework
63 | void InitApp( CDXUTDialog* pUI, int& iStartHeight, bool bSupportStickyMode = false );
64 | HRESULT OnCreateDevice( ID3D11Device* pd3dDevice );
65 | void OnResizedSwapChain( ID3D11Device* pd3dDevice, IDXGISwapChain *pSwapChain,
66 | const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext,
67 | int nPositionX, int nPositionY );
68 | void OnDestroyDevice();
69 | void OnGUIEvent( UINT nEvent, int nControlID, CDXUTControl* pControl, void* pUserContext );
70 | bool IsEnabled();
71 |
72 | // Render
73 | void Render();
74 |
75 | private:
76 |
77 | // UI helper methods
78 | void EnableTool( bool bEnable );
79 | void EnableUI( bool bEnable );
80 |
81 | private:
82 |
83 | // The DXUT dialog
84 | CDXUTDialog* m_pMagnifyUI;
85 |
86 | // Pointer to the Magnify class
87 | AMD::Magnify m_Magnify;
88 |
89 | // The source resources
90 | ID3D11Resource* m_pSourceRTResource;
91 | DXGI_FORMAT m_RTFormat;
92 | int m_nWidth;
93 | int m_nHeight;
94 | int m_nSamples;
95 | bool m_bReleaseRTOnResize;
96 | bool m_bMouseDownLastFrame;
97 | bool m_bStickyShowing;
98 | POINT m_StickyPoint;
99 | };
100 |
101 | } // namespace AMD
102 |
103 | #endif // AMD_SDK_MAGNIFY_TOOL_H
104 |
--------------------------------------------------------------------------------
/amd_sdk/src/Shaders/Line.hlsl:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | cbuffer Constants : register ( b0 )
24 | {
25 | matrix viewProj;
26 | };
27 |
28 |
29 | struct VertexInput
30 | {
31 | float4 pos : POSITION;
32 | float4 color : COLOR;
33 | };
34 |
35 |
36 | void LineVS( in VertexInput input, out float4 color : COLOR0, out float4 screenpos : SV_Position )
37 | {
38 | color = input.color;
39 | screenpos = mul( float4( input.pos.xyz, 1 ), viewProj );
40 | }
41 |
42 |
43 | float4 LinePS( in float4 color : COLOR0 ) : SV_Target
44 | {
45 | return color;
46 | };
47 |
--------------------------------------------------------------------------------
/amd_sdk/src/Sprite.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | //--------------------------------------------------------------------------------------
24 | // File: Sprite.h
25 | //
26 | // Sprite class definition. This class provides functionality to render sprites, at a
27 | // given position and scale.
28 | //--------------------------------------------------------------------------------------
29 | #ifndef AMD_SDK_SPRITE_H
30 | #define AMD_SDK_SPRITE_H
31 |
32 | namespace AMD
33 | {
34 |
35 | class Sprite
36 | {
37 | public:
38 |
39 | Sprite();
40 | ~Sprite();
41 |
42 | HRESULT OnCreateDevice( ID3D11Device* pd3dDevice );
43 | void OnDestroyDevice();
44 | void OnResizedSwapChain( const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc );
45 |
46 | HRESULT RenderSprite( ID3D11ShaderResourceView* pTextureView, int nStartPosX,
47 | int nStartPosY, int nWidth, int nHeight, bool bAlpha, bool bBordered );
48 |
49 | HRESULT RenderSpriteMS( ID3D11ShaderResourceView* pTextureView, int nStartPosX,
50 | int nStartPosY, int nWidth, int nHeight, int nTextureWidth, int nTextureHeight,
51 | bool bAlpha, bool bBordered, int nSampleIndex );
52 |
53 | HRESULT RenderSpriteAsDepth( ID3D11ShaderResourceView* pTextureView, int nStartPosX,
54 | int nStartPosY, int nWidth, int nHeight, bool bBordered, float fDepthRangeMin,
55 | float fDepthRangeMax );
56 |
57 | HRESULT RenderSpriteAsDepthMS( ID3D11ShaderResourceView* pTextureView, int nStartPosX,
58 | int nStartPosY, int nWidth, int nHeight, int nTextureWidth, int nTextureHeight,
59 | bool bBordered, float fDepthRangeMin, float fDepthRangeMax, int nSampleIndex );
60 |
61 | HRESULT RenderSpriteVolume( ID3D11ShaderResourceView* pTextureView, int nStartPosX, int nStartPosY, int nMaxWidth, int nSliceSize, bool bBordered );
62 |
63 | void SetSpriteColor( DirectX::XMVECTOR Color );
64 | void SetBorderColor( DirectX::XMVECTOR Color );
65 | void SetUVs( float fU1, float fV1, float fU2, float fV2 );
66 | void EnableScissorTest( bool enable ) { m_EnableScissorTest = enable; }
67 | void SetPointSample( bool pointSample ) { m_PointSampleMode = pointSample; }
68 |
69 | private:
70 |
71 | void RenderBorder();
72 | void Render();
73 |
74 | // VBs
75 | ID3D11InputLayout* m_pVertexLayout;
76 | ID3D11Buffer* m_pVertexBuffer;
77 | ID3D11InputLayout* m_pBorderVertexLayout;
78 | ID3D11Buffer* m_pBorderVertexBuffer;
79 |
80 | // CB
81 | ID3D11Buffer* m_pcbSprite;
82 |
83 | // Shaders
84 | ID3D11VertexShader* m_pSpriteVS;
85 | ID3D11VertexShader* m_pSpriteBorderVS;
86 | ID3D11PixelShader* m_pSpritePS;
87 | ID3D11PixelShader* m_pSpriteMSPS;
88 | ID3D11PixelShader* m_pSpriteAsDepthPS;
89 | ID3D11PixelShader* m_pSpriteAsDepthMSPS;
90 | ID3D11PixelShader* m_pSpriteBorderPS;
91 | ID3D11PixelShader* m_pSpriteUntexturedPS;
92 | ID3D11PixelShader* m_pSpriteVolumePS;
93 |
94 | // States
95 | bool m_EnableScissorTest;
96 | bool m_PointSampleMode;
97 | ID3D11SamplerState* m_pSamplePoint;
98 | ID3D11SamplerState* m_pSampleLinear;
99 | ID3D11RasterizerState* m_pRasterState;
100 | ID3D11RasterizerState* m_pRasterStateWithScissor;
101 | ID3D11RasterizerState* m_pEnableCulling;
102 | ID3D11BlendState* m_pNoBlending;
103 | ID3D11BlendState* m_pSrcAlphaBlending;
104 | ID3D11DepthStencilState* m_pDisableDepthTestWrite;
105 | ID3D11DepthStencilState* m_pEnableDepthTestWrite;
106 | };
107 |
108 | } // namespace AMD
109 |
110 | #endif // AMD_SDK_SPRITE_H
111 |
--------------------------------------------------------------------------------
/amd_sdk/src/crc.h:
--------------------------------------------------------------------------------
1 | /**********************************************************************
2 | *
3 | * Filename: crc.h
4 | *
5 | * Description: A header file describing the various CRC standards.
6 | *
7 | * Notes:
8 | *
9 | *
10 | * Copyright (c) 2000 by Michael Barr. This software is placed into
11 | * the public domain and may be used for any purpose. However, this
12 | * notice must not be changed or removed and no warranty is either
13 | * expressed or implied by its publication or distribution.
14 | **********************************************************************/
15 |
16 | #ifndef _crc_h
17 | #define _crc_h
18 |
19 | #ifndef FALSE
20 | #define FALSE 0
21 | #endif
22 | #ifndef TRUE
23 | #define TRUE 1
24 | #endif
25 |
26 | /*
27 | * Select the CRC standard from the list that follows.
28 | */
29 | #define CRC32
30 |
31 |
32 | #if defined(CRC_CCITT)
33 |
34 | typedef unsigned short crc;
35 |
36 | #define CRC_NAME "CRC-CCITT"
37 | #define POLYNOMIAL 0x1021
38 | #define INITIAL_REMAINDER 0xFFFF
39 | #define FINAL_XOR_VALUE 0x0000
40 | #define REFLECT_DATA FALSE
41 | #define REFLECT_REMAINDER FALSE
42 | #define CHECK_VALUE 0x29B1
43 |
44 | #elif defined(CRC16)
45 |
46 | typedef unsigned short crc;
47 |
48 | #define CRC_NAME "CRC-16"
49 | #define POLYNOMIAL 0x8005
50 | #define INITIAL_REMAINDER 0x0000
51 | #define FINAL_XOR_VALUE 0x0000
52 | #define REFLECT_DATA TRUE
53 | #define REFLECT_REMAINDER TRUE
54 | #define CHECK_VALUE 0xBB3D
55 |
56 | #elif defined(CRC32)
57 |
58 | typedef unsigned long crc;
59 |
60 | #define CRC_NAME "CRC-32"
61 | #define POLYNOMIAL 0x04C11DB7
62 | #define INITIAL_REMAINDER 0xFFFFFFFF
63 | #define FINAL_XOR_VALUE 0xFFFFFFFF
64 | #define REFLECT_DATA TRUE
65 | #define REFLECT_REMAINDER TRUE
66 | #define CHECK_VALUE 0xCBF43926
67 |
68 | #else
69 |
70 | #error "One of CRC_CCITT, CRC16, or CRC32 must be #define'd."
71 |
72 | #endif
73 |
74 | void crcInit(void);
75 | crc crcSlow(unsigned char const message[], int nBytes);
76 | crc crcFast(unsigned char const message[], int nBytes);
77 |
78 |
79 | #endif /* _crc_h */
--------------------------------------------------------------------------------
/dxut/.gitattributes:
--------------------------------------------------------------------------------
1 | # This is a windows-only project. Force CRLF.
2 | * text eol=crlf
3 |
4 | # Explicit settings for specific file types.
5 | *.h eol=crlf
6 | *.cpp eol=crlf
7 | *.inl eol=crlf
8 | *.hlsl eol=crlf
9 | *.rc eol=crlf
10 | *.manifest eol=crlf
11 | *.vcxproj eol=crlf
12 | *.filters eol=crlf
13 | *.props eol=crlf
14 | *.sln eol=crlf
15 | *.bat eol=crlf
16 | *.txt eol=crlf
17 | *.lua eol=crlf
18 | *.md eol=crlf
19 | *.pdf binary
20 | *.ppsx binary
21 | *.ico binary
22 | *.png binary
23 | *.dds binary
24 | *.sdkmesh binary
25 | *.dll binary
26 | *.exe binary
27 |
--------------------------------------------------------------------------------
/dxut/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, etc.
2 |
3 | # User-specific files
4 | *.suo
5 | *.user
6 |
7 | # Build results
8 | [Bb]in/
9 |
10 | # Visual Studo 2015 cache/options directory
11 | .vs/
12 |
13 | # Visual C++ cache files
14 | ipch/
15 | *.aps
16 | *.ncb
17 | *.opensdf
18 | *.sdf
19 | *.cachefile
20 |
21 | # Visual Studio profiler
22 | *.psess
23 | *.vsp
24 | *.vspx
25 |
26 | # Installshield output folder
27 | [Ee]xpress/
28 |
29 | # Backup & report files from converting an old project file
30 | # to a newer Visual Studio version. Backup files are not needed,
31 | # because we have git ;-)
32 | _UpgradeReport_Files/
33 | Backup*/
34 | UpgradeLog*.XML
35 | UpgradeLog*.htm
36 |
--------------------------------------------------------------------------------
/dxut/Core/DXUT_2015.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | x64
7 |
8 |
9 | Release
10 | x64
11 |
12 |
13 |
14 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}
15 | true
16 | Win32Proj
17 | DXUT
18 | DXUT
19 | 8.1
20 |
21 |
22 |
23 | StaticLibrary
24 | true
25 | Unicode
26 | v140
27 |
28 |
29 | StaticLibrary
30 | false
31 | Unicode
32 | v140
33 | true
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | Bin\Desktop_2015\x64\Debug\
47 | Bin\Desktop_2015\x64\Debug\
48 | DXUT
49 | .lib
50 |
51 |
52 | Bin\Desktop_2015\x64\Release\
53 | Bin\Desktop_2015\x64\Release\
54 | DXUT
55 | .lib
56 |
57 |
58 |
59 | Use
60 | DXUT.h
61 | Level4
62 | true
63 | WIN32;_DEBUG;DEBUG;PROFILE;_WINDOWS;_LIB;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
64 | ProgramDatabase
65 | Disabled
66 | Fast
67 |
68 |
69 | Windows
70 | true
71 |
72 |
73 | true
74 |
75 |
76 |
77 |
78 | Use
79 | DXUT.h
80 | Level4
81 | true
82 | WIN32;NDEBUG;_WINDOWS;_LIB;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)
83 | ProgramDatabase
84 | Full
85 | true
86 | true
87 | false
88 | true
89 | Fast
90 |
91 |
92 | Windows
93 | true
94 | true
95 | true
96 |
97 |
98 | true
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 | Create
114 | Create
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
--------------------------------------------------------------------------------
/dxut/Core/ScreenGrab.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/GPUParticles11/1f2ef4f0cf2025238c7823eede0ec0db7346efab/dxut/Core/ScreenGrab.cpp
--------------------------------------------------------------------------------
/dxut/Core/ScreenGrab.h:
--------------------------------------------------------------------------------
1 | //--------------------------------------------------------------------------------------
2 | // File: ScreenGrab.h
3 | //
4 | // Function for capturing a 2D texture and saving it to a file (aka a 'screenshot'
5 | // when used on a Direct3D 11 Render Target).
6 | //
7 | // Note these functions are useful as a light-weight runtime screen grabber. For
8 | // full-featured texture capture, DDS writer, and texture processing pipeline,
9 | // see the 'Texconv' sample and the 'DirectXTex' library.
10 | //
11 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
12 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
13 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
14 | // PARTICULAR PURPOSE.
15 | //
16 | // Copyright (c) Microsoft Corporation. All rights reserved.
17 | //
18 | // http://go.microsoft.com/fwlink/?LinkId=248926
19 | // http://go.microsoft.com/fwlink/?LinkId=248929
20 | //--------------------------------------------------------------------------------------
21 |
22 | #ifdef _MSC_VER
23 | #pragma once
24 | #endif
25 |
26 | #include
27 |
28 | #include
29 |
30 | #pragma warning(push)
31 | #pragma warning(disable : 4005)
32 | #include
33 | #pragma warning(pop)
34 |
35 | #include
36 |
37 | namespace DirectX
38 | {
39 | HRESULT SaveDDSTextureToFile( _In_ ID3D11DeviceContext* pContext,
40 | _In_ ID3D11Resource* pSource,
41 | _In_z_ LPCWSTR fileName );
42 |
43 | HRESULT SaveWICTextureToFile( _In_ ID3D11DeviceContext* pContext,
44 | _In_ ID3D11Resource* pSource,
45 | _In_ REFGUID guidContainerFormat,
46 | _In_z_ LPCWSTR fileName,
47 | _In_opt_ const GUID* targetFormat = nullptr,
48 | _In_opt_ std::function setCustomProps = nullptr );
49 | }
--------------------------------------------------------------------------------
/dxut/Core/Windows10SDKVS13_x64.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $(ProgramFiles)\Windows Kits\10\bin\x86;$(ExecutablePath)
7 | $(ProgramFiles)\Windows Kits\10\Include\10.0.10240.0\um;$(ProgramFiles)\Windows Kits\10\Include\10.0.10240.0\shared;$(ProgramFiles)\Windows Kits\10\Include\10.0.10240.0\winrt;$(IncludePath)
8 | $(ProgramFiles)\Windows Kits\10\lib\10.0.10240.0\um\x64;$(LibraryPath)
9 | $(ProgramFiles)\Windows Kits\10\Include\10.0.10240.0\um;$(ProgramFiles)\Windows Kits\10\Include\10.0.10240.0\shared;$(ProgramFiles)\Windows Kits\10\Include\10.0.10240.0\winrt;$(ExcludePath)
10 |
11 |
12 |
--------------------------------------------------------------------------------
/dxut/Core/Windows81SDKVS12_x64.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $(ProgramFiles)\Windows Kits\8.1\bin\x86;$(ExecutablePath)
7 | $(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(IncludePath)
8 | $(ProgramFiles)\Windows Kits\8.1\lib\winv6.3\um\x64;$(LibraryPath)
9 | $(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(ExcludePath)
10 |
11 |
12 |
--------------------------------------------------------------------------------
/dxut/Core/Windows81SDK_x64.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $(VCInstallDir)bin\x86_amd64;$(VCInstallDir)bin;$(WindowsSdkDir)bin\NETFX 4.0 Tools;$(ProgramFiles)\Windows Kits\8.1\bin\x86;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;$(ProgramFiles)\HTML Help Workshop;$(FrameworkSDKDir)\bin;$(MSBuildToolsPath32);$(VSInstallDir);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)
7 | $(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(FrameworkSDKDir)\include;
8 | $(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(ProgramFiles)\Windows Kits\8.1\lib\winv6.3\um\x64;$(FrameworkSDKDir)\lib\x64
9 | $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(FrameworkSDKDir)\include;$(MSBuildToolsPath32);$(VCInstallDir)atlmfc\lib;$(VCInstallDir)lib;
10 |
11 |
12 |
--------------------------------------------------------------------------------
/dxut/Core/Windows8SDK_x64.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $(VCInstallDir)bin\x86_amd64;$(VCInstallDir)bin;$(WindowsSdkDir)bin\NETFX 4.0 Tools;$(ProgramFiles)\Windows Kits\8.0\bin\x86;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;$(ProgramFiles)\HTML Help Workshop;$(FrameworkSDKDir)\bin;$(MSBuildToolsPath32);$(VSInstallDir);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)
7 | $(ProgramFiles)\Windows Kits\8.0\Include\um;$(ProgramFiles)\Windows Kits\8.0\Include\shared;$(ProgramFiles)\Windows Kits\8.0\Include\winrt;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(FrameworkSDKDir)\include;
8 | $(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(ProgramFiles)\Windows Kits\8.0\lib\win8\um\x64;$(FrameworkSDKDir)\lib\x64
9 | $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(ProgramFiles)\Windows Kits\8.0\Include\um;$(ProgramFiles)\Windows Kits\8.0\Include\shared;$(ProgramFiles)\Windows Kits\8.0\Include\winrt;$(FrameworkSDKDir)\include;$(MSBuildToolsPath32);$(VCInstallDir)atlmfc\lib;$(VCInstallDir)lib;
10 |
11 |
12 |
--------------------------------------------------------------------------------
/dxut/Core/dxerr.h:
--------------------------------------------------------------------------------
1 | //--------------------------------------------------------------------------------------
2 | // File: DXErr.h
3 | //
4 | // DirectX Error Library
5 | //
6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
7 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
8 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
9 | // PARTICULAR PURPOSE.
10 | //
11 | // Copyright (c) Microsoft Corporation. All rights reserved.
12 | //--------------------------------------------------------------------------------------
13 |
14 | // This version only supports UNICODE.
15 |
16 | #pragma once
17 |
18 | #include
19 | #include
20 |
21 | #ifdef __cplusplus
22 | extern "C" {
23 | #endif
24 |
25 | //--------------------------------------------------------------------------------------
26 | // DXGetErrorString
27 | //--------------------------------------------------------------------------------------
28 | const WCHAR* WINAPI DXGetErrorStringW( _In_ HRESULT hr );
29 |
30 | #define DXGetErrorString DXGetErrorStringW
31 |
32 | //--------------------------------------------------------------------------------------
33 | // DXGetErrorDescription has to be modified to return a copy in a buffer rather than
34 | // the original static string.
35 | //--------------------------------------------------------------------------------------
36 | void WINAPI DXGetErrorDescriptionW( _In_ HRESULT hr, _Out_cap_(count) WCHAR* desc, _In_ size_t count );
37 |
38 | #define DXGetErrorDescription DXGetErrorDescriptionW
39 |
40 | //--------------------------------------------------------------------------------------
41 | // DXTrace
42 | //
43 | // Desc: Outputs a formatted error message to the debug stream
44 | //
45 | // Args: WCHAR* strFile The current file, typically passed in using the
46 | // __FILEW__ macro.
47 | // DWORD dwLine The current line number, typically passed in using the
48 | // __LINE__ macro.
49 | // HRESULT hr An HRESULT that will be traced to the debug stream.
50 | // CHAR* strMsg A string that will be traced to the debug stream (may be NULL)
51 | // BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info.
52 | //
53 | // Return: The hr that was passed in.
54 | //--------------------------------------------------------------------------------------
55 | HRESULT WINAPI DXTraceW( _In_z_ const WCHAR* strFile, _In_ DWORD dwLine, _In_ HRESULT hr, _In_opt_ const WCHAR* strMsg, _In_ bool bPopMsgBox );
56 |
57 | #define DXTrace DXTraceW
58 |
59 | //--------------------------------------------------------------------------------------
60 | //
61 | // Helper macros
62 | //
63 | //--------------------------------------------------------------------------------------
64 | #if defined(DEBUG) || defined(_DEBUG)
65 | #define DXTRACE_MSG(str) DXTrace( __FILEW__, (DWORD)__LINE__, 0, str, false )
66 | #define DXTRACE_ERR(str,hr) DXTrace( __FILEW__, (DWORD)__LINE__, hr, str, false )
67 | #define DXTRACE_ERR_MSGBOX(str,hr) DXTrace( __FILEW__, (DWORD)__LINE__, hr, str, true )
68 | #else
69 | #define DXTRACE_MSG(str) (0L)
70 | #define DXTRACE_ERR(str,hr) (hr)
71 | #define DXTRACE_ERR_MSGBOX(str,hr) (hr)
72 | #endif
73 |
74 | #ifdef __cplusplus
75 | }
76 | #endif //__cplusplus
77 |
--------------------------------------------------------------------------------
/dxut/Core/premake5.lua:
--------------------------------------------------------------------------------
1 | dofile ("../../premake/amd_premake_util.lua")
2 |
3 | workspace "DXUT"
4 | configurations { "Debug", "Release" }
5 | platforms { "x64" }
6 | filename ("DXUT" .. _AMD_VS_SUFFIX)
7 | startproject "DXUT"
8 |
9 | filter "platforms:x64"
10 | system "Windows"
11 | architecture "x64"
12 |
13 | project "DXUT"
14 | kind "StaticLib"
15 | language "C++"
16 | filename ("DXUT" .. _AMD_VS_SUFFIX)
17 | uuid "85344B7F-5AA0-4e12-A065-D1333D11F6CA"
18 | targetdir "Bin/%{_AMD_SAMPLE_DIR_LAYOUT}"
19 | objdir "Bin/%{_AMD_SAMPLE_DIR_LAYOUT}"
20 | warnings "Extra"
21 | floatingpoint "Fast"
22 | pchheader "DXUT.h"
23 | pchsource "DXUT.cpp"
24 |
25 | -- Specify WindowsTargetPlatformVersion here for VS2015
26 | windowstarget (_AMD_WIN_SDK_VERSION)
27 |
28 | files { "*.h", "*.cpp" }
29 |
30 | filter "configurations:Debug"
31 | defines { "WIN32", "_DEBUG", "DEBUG", "PROFILE", "_WINDOWS", "_LIB", "_WIN32_WINNT=0x0601" }
32 | flags { "Symbols", "FatalWarnings", "Unicode" }
33 |
34 | filter "configurations:Release"
35 | defines { "WIN32", "NDEBUG", "_WINDOWS", "_LIB", "_WIN32_WINNT=0x0601" }
36 | flags { "LinkTimeOptimization", "Symbols", "FatalWarnings", "Unicode" }
37 | optimize "On"
38 |
--------------------------------------------------------------------------------
/dxut/MIT.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Microsoft Corp
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this
6 | software and associated documentation files (the "Software"), to deal in the Software
7 | without restriction, including without limitation the rights to use, copy, modify,
8 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9 | permit persons to whom the Software is furnished to do so, subject to the following
10 | conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all copies
13 | or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
17 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
19 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
20 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
22 |
--------------------------------------------------------------------------------
/dxut/Optional/DXUTres.h:
--------------------------------------------------------------------------------
1 | //----------------------------------------------------------------------------
2 | // File: dxutres.h
3 | //
4 | // Functions to create DXUT media from arrays in memory
5 | //
6 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
7 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
8 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
9 | // PARTICULAR PURPOSE.
10 | //
11 | // Copyright (c) Microsoft Corporation. All rights reserved.
12 | //
13 | // http://go.microsoft.com/fwlink/?LinkId=320437
14 | //-----------------------------------------------------------------------------
15 | #pragma once
16 |
17 | HRESULT WINAPI DXUTCreateGUITextureFromInternalArray( _In_ ID3D11Device* pd3dDevice, _Outptr_ ID3D11Texture2D** ppTexture );
18 |
--------------------------------------------------------------------------------
/dxut/Optional/ImeUi.h:
--------------------------------------------------------------------------------
1 | //--------------------------------------------------------------------------------------
2 | // File: ImeUi.h
3 | //
4 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
5 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
6 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
7 | // PARTICULAR PURPOSE.
8 | //
9 | // Copyright (c) Microsoft Corporation. All rights reserved.
10 | //
11 | // http://go.microsoft.com/fwlink/?LinkId=320437
12 | //--------------------------------------------------------------------------------------
13 | #pragma once
14 |
15 | #include
16 |
17 | class CImeUiFont_Base
18 | {
19 | public:
20 | virtual void SetHeight( _In_ UINT uHeight )
21 | {
22 | UNREFERENCED_PARAMETER(uHeight);
23 | }; // for backward compatibility
24 | virtual void SetColor( _In_ DWORD color ) = 0;
25 | virtual void SetPosition( _In_ int x, _In_ int y ) = 0;
26 | virtual void GetTextExtent( _In_z_ LPCTSTR szText, _Out_ DWORD* puWidth, _Out_ DWORD* puHeight ) = 0;
27 | virtual void DrawText( _In_z_ LPCTSTR pszText ) = 0;
28 | };
29 |
30 | typedef struct
31 | {
32 | // symbol (Henkan-kyu)
33 | DWORD symbolColor;
34 | DWORD symbolColorOff;
35 | DWORD symbolColorText;
36 | BYTE symbolHeight;
37 | BYTE symbolTranslucence;
38 | BYTE symbolPlacement;
39 | CImeUiFont_Base* symbolFont;
40 |
41 | // candidate list
42 | DWORD candColorBase;
43 | DWORD candColorBorder;
44 | DWORD candColorText;
45 |
46 | // composition string
47 | DWORD compColorInput;
48 | DWORD compColorTargetConv;
49 | DWORD compColorConverted;
50 | DWORD compColorTargetNotConv;
51 | DWORD compColorInputErr;
52 | BYTE compTranslucence;
53 | DWORD compColorText;
54 |
55 | // caret
56 | BYTE caretWidth;
57 | BYTE caretYMargin;
58 | } IMEUI_APPEARANCE;
59 |
60 | typedef struct // D3DTLVERTEX compatible
61 | {
62 | float sx;
63 | float sy;
64 | float sz;
65 | float rhw;
66 | DWORD color;
67 | DWORD specular;
68 | float tu;
69 | float tv;
70 | } IMEUI_VERTEX;
71 |
72 | // IME States
73 | #define IMEUI_STATE_OFF 0
74 | #define IMEUI_STATE_ON 1
75 | #define IMEUI_STATE_ENGLISH 2
76 |
77 | // IME const
78 | #define MAX_CANDLIST 10
79 |
80 | // IME Flags
81 | #define IMEUI_FLAG_SUPPORT_CARET 0x00000001
82 |
83 | bool ImeUi_Initialize( _In_ HWND hwnd, _In_ bool bDisable = false );
84 | void ImeUi_Uninitialize();
85 | void ImeUi_SetAppearance( _In_opt_ const IMEUI_APPEARANCE* pia );
86 | void ImeUi_GetAppearance( _Out_opt_ IMEUI_APPEARANCE* pia );
87 | bool ImeUi_IgnoreHotKey( _In_ const MSG* pmsg );
88 | LPARAM ImeUi_ProcessMessage( _In_ HWND hWnd, _In_ UINT uMsg, _In_ WPARAM wParam, _Inout_ LPARAM& lParam, _Out_ bool* trapped );
89 | void ImeUi_SetScreenDimension( _In_ UINT width, _In_ UINT height );
90 | void ImeUi_RenderUI( _In_ bool bDrawCompAttr = true, _In_ bool bDrawOtherUi = true );
91 | void ImeUi_SetCaretPosition( _In_ UINT x, _In_ UINT y );
92 | void ImeUi_SetCompStringAppearance( _In_ CImeUiFont_Base* pFont, _In_ DWORD color, _In_ const RECT* prc );
93 | bool ImeUi_GetCaretStatus();
94 | void ImeUi_SetInsertMode( _In_ bool bInsert );
95 | void ImeUi_SetState( _In_ DWORD dwState );
96 | DWORD ImeUi_GetState();
97 | void ImeUi_EnableIme( _In_ bool bEnable );
98 | bool ImeUi_IsEnabled();
99 | void ImeUi_FinalizeString( _In_ bool bSend = false );
100 | void ImeUi_ToggleLanguageBar( _In_ BOOL bRestore );
101 | bool ImeUi_IsSendingKeyMessage();
102 | void ImeUi_SetWindow( _In_ HWND hwnd );
103 | UINT ImeUi_GetInputCodePage();
104 | DWORD ImeUi_GetFlags();
105 | void ImeUi_SetFlags( _In_ DWORD dwFlags, _In_ bool bSet );
106 |
107 | WORD ImeUi_GetPrimaryLanguage();
108 | DWORD ImeUi_GetImeId( _In_ UINT uIndex );
109 | WORD ImeUi_GetLanguage();
110 | LPTSTR ImeUi_GetIndicatior();
111 | bool ImeUi_IsShowReadingWindow();
112 | bool ImeUi_IsShowCandListWindow();
113 | bool ImeUi_IsVerticalCand();
114 | bool ImeUi_IsHorizontalReading();
115 | TCHAR* ImeUi_GetCandidate( _In_ UINT idx );
116 | TCHAR* ImeUi_GetCompositionString();
117 | DWORD ImeUi_GetCandidateSelection();
118 | DWORD ImeUi_GetCandidateCount();
119 | BYTE* ImeUi_GetCompStringAttr();
120 | DWORD ImeUi_GetImeCursorChars();
121 |
122 | extern void ( CALLBACK*ImeUiCallback_DrawRect )( _In_ int x1, _In_ int y1, _In_ int x2, _In_ int y2, _In_ DWORD color );
123 | extern void* ( __cdecl*ImeUiCallback_Malloc )( _In_ size_t bytes );
124 | extern void ( __cdecl*ImeUiCallback_Free )( _In_ void* ptr );
125 | extern void ( CALLBACK*ImeUiCallback_DrawFans )( _In_ const IMEUI_VERTEX* paVertex, _In_ UINT uNum );
126 | extern void ( CALLBACK*ImeUiCallback_OnChar )( _In_ WCHAR wc );
127 |
--------------------------------------------------------------------------------
/dxut/Optional/Windows10SDKVS13_x64.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $(ProgramFiles)\Windows Kits\10\bin\x86;$(ExecutablePath)
7 | $(ProgramFiles)\Windows Kits\10\Include\10.0.10240.0\um;$(ProgramFiles)\Windows Kits\10\Include\10.0.10240.0\shared;$(ProgramFiles)\Windows Kits\10\Include\10.0.10240.0\winrt;$(IncludePath)
8 | $(ProgramFiles)\Windows Kits\10\lib\10.0.10240.0\um\x64;$(LibraryPath)
9 | $(ProgramFiles)\Windows Kits\10\Include\10.0.10240.0\um;$(ProgramFiles)\Windows Kits\10\Include\10.0.10240.0\shared;$(ProgramFiles)\Windows Kits\10\Include\10.0.10240.0\winrt;$(ExcludePath)
10 |
11 |
12 |
--------------------------------------------------------------------------------
/dxut/Optional/Windows81SDKVS12_x64.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $(ProgramFiles)\Windows Kits\8.1\bin\x86;$(ExecutablePath)
7 | $(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(IncludePath)
8 | $(ProgramFiles)\Windows Kits\8.1\lib\winv6.3\um\x64;$(LibraryPath)
9 | $(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(ExcludePath)
10 |
11 |
12 |
--------------------------------------------------------------------------------
/dxut/Optional/Windows81SDK_x64.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $(VCInstallDir)bin\x86_amd64;$(VCInstallDir)bin;$(WindowsSdkDir)bin\NETFX 4.0 Tools;$(ProgramFiles)\Windows Kits\8.1\bin\x86;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;$(ProgramFiles)\HTML Help Workshop;$(FrameworkSDKDir)\bin;$(MSBuildToolsPath32);$(VSInstallDir);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)
7 | $(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(FrameworkSDKDir)\include;
8 | $(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(ProgramFiles)\Windows Kits\8.1\lib\winv6.3\um\x64;$(FrameworkSDKDir)\lib\x64
9 | $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(FrameworkSDKDir)\include;$(MSBuildToolsPath32);$(VCInstallDir)atlmfc\lib;$(VCInstallDir)lib;
10 |
11 |
12 |
--------------------------------------------------------------------------------
/dxut/Optional/Windows8SDK_x64.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $(VCInstallDir)bin\x86_amd64;$(VCInstallDir)bin;$(WindowsSdkDir)bin\NETFX 4.0 Tools;$(ProgramFiles)\Windows Kits\8.0\bin\x86;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;$(ProgramFiles)\HTML Help Workshop;$(FrameworkSDKDir)\bin;$(MSBuildToolsPath32);$(VSInstallDir);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)
7 | $(ProgramFiles)\Windows Kits\8.0\Include\um;$(ProgramFiles)\Windows Kits\8.0\Include\shared;$(ProgramFiles)\Windows Kits\8.0\Include\winrt;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(FrameworkSDKDir)\include;
8 | $(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(ProgramFiles)\Windows Kits\8.0\lib\win8\um\x64;$(FrameworkSDKDir)\lib\x64
9 | $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(ProgramFiles)\Windows Kits\8.0\Include\um;$(ProgramFiles)\Windows Kits\8.0\Include\shared;$(ProgramFiles)\Windows Kits\8.0\Include\winrt;$(FrameworkSDKDir)\include;$(MSBuildToolsPath32);$(VCInstallDir)atlmfc\lib;$(VCInstallDir)lib;
10 |
11 |
12 |
--------------------------------------------------------------------------------
/dxut/Optional/directx.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/GPUParticles11/1f2ef4f0cf2025238c7823eede0ec0db7346efab/dxut/Optional/directx.ico
--------------------------------------------------------------------------------
/dxut/Optional/premake5.lua:
--------------------------------------------------------------------------------
1 | dofile ("../../premake/amd_premake_util.lua")
2 |
3 | workspace "DXUTOpt"
4 | configurations { "Debug", "Release" }
5 | platforms { "x64" }
6 | filename ("DXUTOpt" .. _AMD_VS_SUFFIX)
7 | startproject "DXUTOpt"
8 |
9 | filter "platforms:x64"
10 | system "Windows"
11 | architecture "x64"
12 |
13 | project "DXUTOpt"
14 | kind "StaticLib"
15 | language "C++"
16 | filename ("DXUTOpt" .. _AMD_VS_SUFFIX)
17 | uuid "61B333C2-C4F7-4cc1-A9BF-83F6D95588EB"
18 | targetdir "Bin/%{_AMD_SAMPLE_DIR_LAYOUT}"
19 | objdir "Bin/%{_AMD_SAMPLE_DIR_LAYOUT}"
20 | warnings "Extra"
21 | floatingpoint "Fast"
22 | pchheader "DXUT.h"
23 | pchsource "DXUTres.cpp"
24 |
25 | -- Specify WindowsTargetPlatformVersion here for VS2015
26 | windowstarget (_AMD_WIN_SDK_VERSION)
27 |
28 | files { "*.h", "*.cpp" }
29 | includedirs { "../Core" }
30 |
31 | filter "configurations:Debug"
32 | defines { "WIN32", "_DEBUG", "DEBUG", "PROFILE", "_WINDOWS", "_LIB", "_WIN32_WINNT=0x0601" }
33 | flags { "Symbols", "FatalWarnings", "Unicode" }
34 |
35 | filter "configurations:Release"
36 | defines { "WIN32", "NDEBUG", "_WINDOWS", "_LIB", "_WIN32_WINNT=0x0601" }
37 | flags { "LinkTimeOptimization", "Symbols", "FatalWarnings", "Unicode" }
38 | optimize "On"
39 |
--------------------------------------------------------------------------------
/dxut/ReadMe.txt:
--------------------------------------------------------------------------------
1 | Modified version of Microsoft DXUT. The unmodified version can be found on GitHub - https://github.com/Microsoft/DXUT
2 |
3 | DXUT is distributed under the terms of the MIT License. See MIT.txt.
4 |
5 |
6 | --------------------
7 | DXUT FOR DIRECT3D 11
8 | --------------------
9 |
10 | Copyright (c) Microsoft Corporation. All rights reserved.
11 |
12 | November 30, 2015
13 |
14 | DXUT is a "GLUT"-like framework for Direct3D 11.x Win32 desktop applications; primarily samples, demos, and prototypes.
15 |
16 | The source is written for Visual Studio 2012, 2013, or 2015. It is recommended that you
17 | make use of the Windows 8.1 SDK and Windows 7 Service Pack 1 or later.
18 |
19 | These components are designed to work without requiring any content from the DirectX SDK. For details,
20 | see "Where is the DirectX SDK?" .
21 |
22 | All content and source code for this package are subject to the terms of the MIT License.
23 | .
24 |
25 | For the latest version of DXUT11, more detailed documentation, etc., please visit the project site.
26 |
27 | http://go.microsoft.com/fwlink/?LinkId=320437
28 |
29 |
30 | -------
31 | SAMPLES
32 | -------
33 |
34 | Direct3D Tutorial08 - 10
35 | http://code.msdn.microsoft.com/DXUT-Tutorial-Win32-Sample-fe15e440
36 |
37 | BasicHLSL11, EmptyProject11, SimpleSample11
38 | http://code.msdn.microsoft.com/Basic-DXUT-Win32-Samples-e59c0682
39 |
40 | DXUT+DirectXTK Simple Sample
41 | http://code.msdn.microsoft.com/DXUTDirectXTK-Simple-Win32-9cf797e9
42 |
43 | Note: These samples are also hosted on GitHub - https://github.com/walbourn/directx-sdk-samples
44 |
45 |
46 | ----------
47 | DISCLAIMER
48 | ----------
49 |
50 | DXUT is being provided as a porting aid for older code that makes use of the legacy DirectX SDK, the deprecated D3DX9/D3DX11
51 | library, and the DXUT11 framework. It is a cleaned up version of the original DXUT11 that will build with the Windows 8.x SDK
52 | and does not make use of any legacy DirectX SDK or DirectSetup deployed components.
53 |
54 | The DXUT framework is for use in Win32 desktop applications. It not usable for Windows Store apps on Windows 8.x or Windows RT.
55 | It does not support Windows phone or Xbox One.
56 |
57 | This version of DXUT only supports Direct3D 11, and therefore is not compatible with Windows XP or early versions of Windows Vista.
58 |
59 |
60 | ---------------
61 | RELEASE HISTORY
62 | ---------------
63 |
64 | November 30, 2015 (11.11)
65 | Updated DDSTextureLoader, ScreenGrab, DXERR
66 | Updated for VS 2015 Update 1 and Windows 10 SDK (10586)
67 |
68 | July 29, 2015 (11.10)
69 | Updated for VS 2015 and Windows 10 SDK RTM
70 | Retired VS 2010 projects
71 |
72 | June 16, 2015 (11.09)
73 | Optional support for Direct3D 11.3 (define USE_DIRECT3D11_3 in VS 2015 projects)
74 |
75 | April 14, 2015 (11.08)
76 | Fix for auto-gen of volume textures
77 | More updates for VS 2015
78 |
79 | November 24, 2014 (11.07)
80 | Minor fix for Present usage
81 | Minor fix for CBaseCamera::GetInput
82 | Minor fix for WIC usage of IWICFormatConverter
83 | Updates for Visual Studio 2015 Technical Preview
84 |
85 | July 28, 2014 (11.06)
86 | Optional support for Direct3D 11.2 (define USE_DIRECT3D11_2 in VS 2013 projects)
87 | Fixes for various UI and F2 device settings dialog issues
88 | Fixes for device and format enumeration
89 | Changed default resolution to 800x600
90 | Code review fixes
91 |
92 | January 24, 2014 (11.05)
93 | Added use of DXGI debugging when available
94 | Resolved CRT heap leak report
95 | Fixed compile bug in DXUTLockFreePipe
96 | Fixed bug reported in DXUT's sprite implementation
97 | Code cleanup (removed DXGI_1_2_FORMATS control define; ScopedObject typedef removed)
98 |
99 | October 21, 2013 (11.04)
100 | Updated for Visual Studio 2013 and Windows 8.1 SDK RTM
101 | Minor fixes for systems which only have a "Microsoft Basic Renderer" device
102 |
103 | September 2013 (11.03)
104 | Removed dependencies on the D3DX9 and D3DX11 libraries, so DXUT no longer requires the legacy DirectX SDK to build.
105 | It does require the d3dcompiler.h header from the Windows 8.x SDK.
106 | Includes standalone DDSTextureLoader, WICTexureLoader, ScreenGrab, and DxErr modules.
107 | Removed support for Direct3D 9 and Windows XP
108 | Deleted the DXUTDevice9.h/.cpp, SDKSound.h/.cpp, and SDKWaveFile.h/.cpp files
109 | Deleted legacy support for MCE relaunch
110 | General C++ code cleanups (nullptr, auto keyword, C++ style casting, Safer CRT, etc.) which are
111 | compatible with Visual C++ 2010 and 2012
112 | SAL2 annotation and /analyze cleanup
113 | Added DXUTCompileFromFile, DXUTCreateShaderResourceViewFromFile, DXUTCreateTextureFromFile, DXUTSaveTextureToFile helpers
114 | Added '-forcewarp' command-line switch
115 | Added support for DXGI 1.1 and 1.2 formats
116 | Added Direct3D 11.1 Device/Context state
117 | Support Feature Level 11.1 when available
118 |
119 | June 2010 (11.02)
120 | The DirectX SDK (June 2010) included an update to DXUT11. This is the last version to support Visual Studio 2008,
121 | Windows XP, or Direct3D 9. The source code is located in Samples\C++\DXUT11.
122 |
123 | February 2010 (11.01)
124 | An update was shipped with the DirectX SDK (February 2010). This is the last version to support Visual Studio 2005.
125 | The source code is located in Samples\C++\DXUT11.
126 |
127 | August 2009 (11.00)
128 | The initial release of DXUT11 was in DirectX SDK (August 2009). The source code is located in Samples\C++\DXUT11.
129 | This was a port of the original DXUT which supported Direct3D 10 / Direct3D 9 applications on Windows XP and Windows Vista.
130 |
--------------------------------------------------------------------------------
/gpuparticles11/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, etc.
2 |
3 | # User-specific files
4 | *.suo
5 | *.user
6 |
7 | # Build results
8 | [Dd]esktop_*/
9 | GPUParticles11_Debug_*.*
10 | GPUParticles11_Release_*.*
11 | bin/*.*
12 |
13 | # Visual Studo 2015 cache/options directory
14 | .vs/
15 |
16 | # Visual C++ cache files
17 | ipch/
18 | *.aps
19 | *.ncb
20 | *.opensdf
21 | *.sdf
22 | *.cachefile
23 | *.opendb
24 | *.VC.db
25 |
26 | # Visual Studio profiler
27 | *.psess
28 | *.vsp
29 | *.vspx
30 |
31 | # Installshield output folder
32 | [Ee]xpress/
33 |
34 | # Backup & report files from converting an old project file
35 | # to a newer Visual Studio version. Backup files are not needed,
36 | # because we have git ;-)
37 | _UpgradeReport_Files/
38 | Backup*/
39 | UpgradeLog*.XML
40 | UpgradeLog*.htm
41 |
42 | # Shader cache
43 | [Bb]in/Shaders/
44 | HashDigest.html
45 |
--------------------------------------------------------------------------------
/gpuparticles11/build/GPUParticles11_2012.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2012
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GPUParticles11", "GPUParticles11_2012.vcxproj", "{FAA25C2D-E670-5033-CF04-C159BB712C98}"
5 | EndProject
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AMD_SDK_Minimal", "..\..\AMD_SDK\build\AMD_SDK_Minimal_2012.vcxproj", "{EBB939DC-98E4-49DF-B1F1-D2E80A11F60A}"
7 | EndProject
8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DXUT", "..\..\DXUT\Core\DXUT_2012.vcxproj", "{85344B7F-5AA0-4E12-A065-D1333D11F6CA}"
9 | EndProject
10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DXUTOpt", "..\..\DXUT\Optional\DXUTOpt_2012.vcxproj", "{61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}"
11 | EndProject
12 | Global
13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 | Debug|x64 = Debug|x64
15 | Release|x64 = Release|x64
16 | EndGlobalSection
17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
18 | {FAA25C2D-E670-5033-CF04-C159BB712C98}.Debug|x64.ActiveCfg = Debug|x64
19 | {FAA25C2D-E670-5033-CF04-C159BB712C98}.Debug|x64.Build.0 = Debug|x64
20 | {FAA25C2D-E670-5033-CF04-C159BB712C98}.Release|x64.ActiveCfg = Release|x64
21 | {FAA25C2D-E670-5033-CF04-C159BB712C98}.Release|x64.Build.0 = Release|x64
22 | {EBB939DC-98E4-49DF-B1F1-D2E80A11F60A}.Debug|x64.ActiveCfg = Debug|x64
23 | {EBB939DC-98E4-49DF-B1F1-D2E80A11F60A}.Debug|x64.Build.0 = Debug|x64
24 | {EBB939DC-98E4-49DF-B1F1-D2E80A11F60A}.Release|x64.ActiveCfg = Release|x64
25 | {EBB939DC-98E4-49DF-B1F1-D2E80A11F60A}.Release|x64.Build.0 = Release|x64
26 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|x64.ActiveCfg = Debug|x64
27 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|x64.Build.0 = Debug|x64
28 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|x64.ActiveCfg = Release|x64
29 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|x64.Build.0 = Release|x64
30 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|x64.ActiveCfg = Debug|x64
31 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|x64.Build.0 = Debug|x64
32 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|x64.ActiveCfg = Release|x64
33 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|x64.Build.0 = Release|x64
34 | EndGlobalSection
35 | GlobalSection(SolutionProperties) = preSolution
36 | HideSolutionNode = FALSE
37 | EndGlobalSection
38 | EndGlobal
39 |
--------------------------------------------------------------------------------
/gpuparticles11/build/GPUParticles11_2012.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {00A967FA-6C69-E330-35A4-2CAEA123280D}
6 |
7 |
8 | {EFAC8DF2-5B8C-0C8E-64A4-9764D00273EF}
9 |
10 |
11 |
12 |
13 | ResourceFiles
14 |
15 |
16 | Shaders
17 |
18 |
19 | Shaders
20 |
21 |
22 | Shaders
23 |
24 |
25 | Shaders
26 |
27 |
28 | Shaders
29 |
30 |
31 | Shaders
32 |
33 |
34 | Shaders
35 |
36 |
37 | Shaders
38 |
39 |
40 | Shaders
41 |
42 |
43 | Shaders
44 |
45 |
46 | Shaders
47 |
48 |
49 | Shaders
50 |
51 |
52 | Shaders
53 |
54 |
55 | Shaders
56 |
57 |
58 | Shaders
59 |
60 |
61 | Shaders
62 |
63 |
64 |
65 |
66 |
67 |
68 | ResourceFiles
69 |
70 |
71 | Shaders
72 |
73 |
74 | Shaders
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 | ResourceFiles
88 |
89 |
90 |
--------------------------------------------------------------------------------
/gpuparticles11/build/GPUParticles11_2013.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GPUParticles11", "GPUParticles11_2013.vcxproj", "{FAA25C2D-E670-5033-CF04-C159BB712C98}"
5 | EndProject
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AMD_SDK_Minimal", "..\..\AMD_SDK\build\AMD_SDK_Minimal_2013.vcxproj", "{EBB939DC-98E4-49DF-B1F1-D2E80A11F60A}"
7 | EndProject
8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DXUT", "..\..\DXUT\Core\DXUT_2013.vcxproj", "{85344B7F-5AA0-4E12-A065-D1333D11F6CA}"
9 | EndProject
10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DXUTOpt", "..\..\DXUT\Optional\DXUTOpt_2013.vcxproj", "{61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}"
11 | EndProject
12 | Global
13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 | Debug|x64 = Debug|x64
15 | Release|x64 = Release|x64
16 | EndGlobalSection
17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
18 | {FAA25C2D-E670-5033-CF04-C159BB712C98}.Debug|x64.ActiveCfg = Debug|x64
19 | {FAA25C2D-E670-5033-CF04-C159BB712C98}.Debug|x64.Build.0 = Debug|x64
20 | {FAA25C2D-E670-5033-CF04-C159BB712C98}.Release|x64.ActiveCfg = Release|x64
21 | {FAA25C2D-E670-5033-CF04-C159BB712C98}.Release|x64.Build.0 = Release|x64
22 | {EBB939DC-98E4-49DF-B1F1-D2E80A11F60A}.Debug|x64.ActiveCfg = Debug|x64
23 | {EBB939DC-98E4-49DF-B1F1-D2E80A11F60A}.Debug|x64.Build.0 = Debug|x64
24 | {EBB939DC-98E4-49DF-B1F1-D2E80A11F60A}.Release|x64.ActiveCfg = Release|x64
25 | {EBB939DC-98E4-49DF-B1F1-D2E80A11F60A}.Release|x64.Build.0 = Release|x64
26 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|x64.ActiveCfg = Debug|x64
27 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|x64.Build.0 = Debug|x64
28 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|x64.ActiveCfg = Release|x64
29 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|x64.Build.0 = Release|x64
30 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|x64.ActiveCfg = Debug|x64
31 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|x64.Build.0 = Debug|x64
32 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|x64.ActiveCfg = Release|x64
33 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|x64.Build.0 = Release|x64
34 | EndGlobalSection
35 | GlobalSection(SolutionProperties) = preSolution
36 | HideSolutionNode = FALSE
37 | EndGlobalSection
38 | EndGlobal
39 |
--------------------------------------------------------------------------------
/gpuparticles11/build/GPUParticles11_2013.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {00A967FA-6C69-E330-35A4-2CAEA123280D}
6 |
7 |
8 | {EFAC8DF2-5B8C-0C8E-64A4-9764D00273EF}
9 |
10 |
11 |
12 |
13 | ResourceFiles
14 |
15 |
16 | Shaders
17 |
18 |
19 | Shaders
20 |
21 |
22 | Shaders
23 |
24 |
25 | Shaders
26 |
27 |
28 | Shaders
29 |
30 |
31 | Shaders
32 |
33 |
34 | Shaders
35 |
36 |
37 | Shaders
38 |
39 |
40 | Shaders
41 |
42 |
43 | Shaders
44 |
45 |
46 | Shaders
47 |
48 |
49 | Shaders
50 |
51 |
52 | Shaders
53 |
54 |
55 | Shaders
56 |
57 |
58 | Shaders
59 |
60 |
61 | Shaders
62 |
63 |
64 |
65 |
66 |
67 |
68 | ResourceFiles
69 |
70 |
71 | Shaders
72 |
73 |
74 | Shaders
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 | ResourceFiles
88 |
89 |
90 |
--------------------------------------------------------------------------------
/gpuparticles11/build/GPUParticles11_2015.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GPUParticles11", "GPUParticles11_2015.vcxproj", "{FAA25C2D-E670-5033-CF04-C159BB712C98}"
5 | EndProject
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AMD_SDK_Minimal", "..\..\AMD_SDK\build\AMD_SDK_Minimal_2015.vcxproj", "{EBB939DC-98E4-49DF-B1F1-D2E80A11F60A}"
7 | EndProject
8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DXUT", "..\..\DXUT\Core\DXUT_2015.vcxproj", "{85344B7F-5AA0-4E12-A065-D1333D11F6CA}"
9 | EndProject
10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DXUTOpt", "..\..\DXUT\Optional\DXUTOpt_2015.vcxproj", "{61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}"
11 | EndProject
12 | Global
13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 | Debug|x64 = Debug|x64
15 | Release|x64 = Release|x64
16 | EndGlobalSection
17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
18 | {FAA25C2D-E670-5033-CF04-C159BB712C98}.Debug|x64.ActiveCfg = Debug|x64
19 | {FAA25C2D-E670-5033-CF04-C159BB712C98}.Debug|x64.Build.0 = Debug|x64
20 | {FAA25C2D-E670-5033-CF04-C159BB712C98}.Release|x64.ActiveCfg = Release|x64
21 | {FAA25C2D-E670-5033-CF04-C159BB712C98}.Release|x64.Build.0 = Release|x64
22 | {EBB939DC-98E4-49DF-B1F1-D2E80A11F60A}.Debug|x64.ActiveCfg = Debug|x64
23 | {EBB939DC-98E4-49DF-B1F1-D2E80A11F60A}.Debug|x64.Build.0 = Debug|x64
24 | {EBB939DC-98E4-49DF-B1F1-D2E80A11F60A}.Release|x64.ActiveCfg = Release|x64
25 | {EBB939DC-98E4-49DF-B1F1-D2E80A11F60A}.Release|x64.Build.0 = Release|x64
26 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|x64.ActiveCfg = Debug|x64
27 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Debug|x64.Build.0 = Debug|x64
28 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|x64.ActiveCfg = Release|x64
29 | {85344B7F-5AA0-4E12-A065-D1333D11F6CA}.Release|x64.Build.0 = Release|x64
30 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|x64.ActiveCfg = Debug|x64
31 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Debug|x64.Build.0 = Debug|x64
32 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|x64.ActiveCfg = Release|x64
33 | {61B333C2-C4F7-4CC1-A9BF-83F6D95588EB}.Release|x64.Build.0 = Release|x64
34 | EndGlobalSection
35 | GlobalSection(SolutionProperties) = preSolution
36 | HideSolutionNode = FALSE
37 | EndGlobalSection
38 | EndGlobal
39 |
--------------------------------------------------------------------------------
/gpuparticles11/build/GPUParticles11_2015.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {00A967FA-6C69-E330-35A4-2CAEA123280D}
6 |
7 |
8 | {EFAC8DF2-5B8C-0C8E-64A4-9764D00273EF}
9 |
10 |
11 |
12 |
13 | ResourceFiles
14 |
15 |
16 | Shaders
17 |
18 |
19 | Shaders
20 |
21 |
22 | Shaders
23 |
24 |
25 | Shaders
26 |
27 |
28 | Shaders
29 |
30 |
31 | Shaders
32 |
33 |
34 | Shaders
35 |
36 |
37 | Shaders
38 |
39 |
40 | Shaders
41 |
42 |
43 | Shaders
44 |
45 |
46 | Shaders
47 |
48 |
49 | Shaders
50 |
51 |
52 | Shaders
53 |
54 |
55 | Shaders
56 |
57 |
58 | Shaders
59 |
60 |
61 | Shaders
62 |
63 |
64 |
65 |
66 |
67 |
68 | ResourceFiles
69 |
70 |
71 | Shaders
72 |
73 |
74 | Shaders
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 | ResourceFiles
88 |
89 |
90 |
--------------------------------------------------------------------------------
/gpuparticles11/build/Windows10SDKVS13_x64.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $(ProgramFiles)\Windows Kits\10\bin\x86;$(ExecutablePath)
7 | $(ProgramFiles)\Windows Kits\10\Include\10.0.10240.0\um;$(ProgramFiles)\Windows Kits\10\Include\10.0.10240.0\shared;$(ProgramFiles)\Windows Kits\10\Include\10.0.10240.0\winrt;$(IncludePath)
8 | $(ProgramFiles)\Windows Kits\10\lib\10.0.10240.0\um\x64;$(LibraryPath)
9 | $(ProgramFiles)\Windows Kits\10\Include\10.0.10240.0\um;$(ProgramFiles)\Windows Kits\10\Include\10.0.10240.0\shared;$(ProgramFiles)\Windows Kits\10\Include\10.0.10240.0\winrt;$(ExcludePath)
10 |
11 |
12 |
--------------------------------------------------------------------------------
/gpuparticles11/build/Windows81SDKVS12_x64.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $(ProgramFiles)\Windows Kits\8.1\bin\x86;$(ExecutablePath)
7 | $(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(IncludePath)
8 | $(ProgramFiles)\Windows Kits\8.1\lib\winv6.3\um\x64;$(LibraryPath)
9 | $(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(ExcludePath)
10 |
11 |
12 |
--------------------------------------------------------------------------------
/gpuparticles11/build/Windows81SDK_x64.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $(VCInstallDir)bin\x86_amd64;$(VCInstallDir)bin;$(WindowsSdkDir)bin\NETFX 4.0 Tools;$(ProgramFiles)\Windows Kits\8.1\bin\x86;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;$(ProgramFiles)\HTML Help Workshop;$(FrameworkSDKDir)\bin;$(MSBuildToolsPath32);$(VSInstallDir);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)
7 | $(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(FrameworkSDKDir)\include;
8 | $(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(ProgramFiles)\Windows Kits\8.1\lib\winv6.3\um\x64;$(FrameworkSDKDir)\lib\x64
9 | $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(FrameworkSDKDir)\include;$(MSBuildToolsPath32);$(VCInstallDir)atlmfc\lib;$(VCInstallDir)lib;
10 |
11 |
12 |
--------------------------------------------------------------------------------
/gpuparticles11/build/Windows8SDK_x64.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $(VCInstallDir)bin\x86_amd64;$(VCInstallDir)bin;$(WindowsSdkDir)bin\NETFX 4.0 Tools;$(ProgramFiles)\Windows Kits\8.0\bin\x86;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;$(ProgramFiles)\HTML Help Workshop;$(FrameworkSDKDir)\bin;$(MSBuildToolsPath32);$(VSInstallDir);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH)
7 | $(ProgramFiles)\Windows Kits\8.0\Include\um;$(ProgramFiles)\Windows Kits\8.0\Include\shared;$(ProgramFiles)\Windows Kits\8.0\Include\winrt;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(FrameworkSDKDir)\include;
8 | $(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(ProgramFiles)\Windows Kits\8.0\lib\win8\um\x64;$(FrameworkSDKDir)\lib\x64
9 | $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(ProgramFiles)\Windows Kits\8.0\Include\um;$(ProgramFiles)\Windows Kits\8.0\Include\shared;$(ProgramFiles)\Windows Kits\8.0\Include\winrt;$(FrameworkSDKDir)\include;$(MSBuildToolsPath32);$(VCInstallDir)atlmfc\lib;$(VCInstallDir)lib;
10 |
11 |
12 |
--------------------------------------------------------------------------------
/gpuparticles11/doc/GPUParticles.ppsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/GPUParticles11/1f2ef4f0cf2025238c7823eede0ec0db7346efab/gpuparticles11/doc/GPUParticles.ppsx
--------------------------------------------------------------------------------
/gpuparticles11/media/MSH1024.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/GPUParticles11/1f2ef4f0cf2025238c7823eede0ec0db7346efab/gpuparticles11/media/MSH1024.bmp
--------------------------------------------------------------------------------
/gpuparticles11/media/Thumbnail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/GPUParticles11/1f2ef4f0cf2025238c7823eede0ec0db7346efab/gpuparticles11/media/Thumbnail.png
--------------------------------------------------------------------------------
/gpuparticles11/media/atlas.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/GPUParticles11/1f2ef4f0cf2025238c7823eede0ec0db7346efab/gpuparticles11/media/atlas.dds
--------------------------------------------------------------------------------
/gpuparticles11/media/readme.txt:
--------------------------------------------------------------------------------
1 | The media files in the tank and ui subfolders are from the Microsoft DirectX SDK Samples:
2 | https://github.com/walbourn/directx-sdk-samples
3 |
4 | (The files in tank are from the softparticles media folder in the Microsoft DirectX SDK Samples.)
5 |
6 | They are distributed under the terms of the MIT License.
--------------------------------------------------------------------------------
/gpuparticles11/media/tank/MIT.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Microsoft Corp
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this
6 | software and associated documentation files (the "Software"), to deal in the Software
7 | without restriction, including without limitation the rights to use, copy, modify,
8 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9 | permit persons to whom the Software is furnished to do so, subject to the following
10 | conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all copies
13 | or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
17 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
19 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
20 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
22 |
--------------------------------------------------------------------------------
/gpuparticles11/media/tank/TankScene.sdkmesh:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/GPUParticles11/1f2ef4f0cf2025238c7823eede0ec0db7346efab/gpuparticles11/media/tank/TankScene.sdkmesh
--------------------------------------------------------------------------------
/gpuparticles11/media/tank/colorgradient.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/GPUParticles11/1f2ef4f0cf2025238c7823eede0ec0db7346efab/gpuparticles11/media/tank/colorgradient.dds
--------------------------------------------------------------------------------
/gpuparticles11/media/tank/desert_sky.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/GPUParticles11/1f2ef4f0cf2025238c7823eede0ec0db7346efab/gpuparticles11/media/tank/desert_sky.dds
--------------------------------------------------------------------------------
/gpuparticles11/media/tank/desertsky.sdkmesh:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/GPUParticles11/1f2ef4f0cf2025238c7823eede0ec0db7346efab/gpuparticles11/media/tank/desertsky.sdkmesh
--------------------------------------------------------------------------------
/gpuparticles11/media/tank/ground_diff.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/GPUParticles11/1f2ef4f0cf2025238c7823eede0ec0db7346efab/gpuparticles11/media/tank/ground_diff.dds
--------------------------------------------------------------------------------
/gpuparticles11/media/tank/ground_norm.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/GPUParticles11/1f2ef4f0cf2025238c7823eede0ec0db7346efab/gpuparticles11/media/tank/ground_norm.dds
--------------------------------------------------------------------------------
/gpuparticles11/media/tank/left_engine_diff.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/GPUParticles11/1f2ef4f0cf2025238c7823eede0ec0db7346efab/gpuparticles11/media/tank/left_engine_diff.dds
--------------------------------------------------------------------------------
/gpuparticles11/media/tank/left_engine_norm.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/GPUParticles11/1f2ef4f0cf2025238c7823eede0ec0db7346efab/gpuparticles11/media/tank/left_engine_norm.dds
--------------------------------------------------------------------------------
/gpuparticles11/media/tank/turret_diff.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/GPUParticles11/1f2ef4f0cf2025238c7823eede0ec0db7346efab/gpuparticles11/media/tank/turret_diff.dds
--------------------------------------------------------------------------------
/gpuparticles11/media/tank/turret_norm.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/GPUParticles11/1f2ef4f0cf2025238c7823eede0ec0db7346efab/gpuparticles11/media/tank/turret_norm.dds
--------------------------------------------------------------------------------
/gpuparticles11/media/ui/Font.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/GPUParticles11/1f2ef4f0cf2025238c7823eede0ec0db7346efab/gpuparticles11/media/ui/Font.dds
--------------------------------------------------------------------------------
/gpuparticles11/media/ui/MIT.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Microsoft Corp
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this
6 | software and associated documentation files (the "Software"), to deal in the Software
7 | without restriction, including without limitation the rights to use, copy, modify,
8 | merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9 | permit persons to whom the Software is furnished to do so, subject to the following
10 | conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all copies
13 | or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
17 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
18 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
19 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
20 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
22 |
--------------------------------------------------------------------------------
/gpuparticles11/media/ui/dxutcontrols.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/GPUParticles11/1f2ef4f0cf2025238c7823eede0ec0db7346efab/gpuparticles11/media/ui/dxutcontrols.dds
--------------------------------------------------------------------------------
/gpuparticles11/premake/premake5.lua:
--------------------------------------------------------------------------------
1 | _AMD_SAMPLE_NAME = "GPUParticles11"
2 |
3 | dofile ("../../premake/amd_premake_util.lua")
4 |
5 | workspace (_AMD_SAMPLE_NAME)
6 | configurations { "Debug", "Release" }
7 | platforms { "x64" }
8 | location "../build"
9 | filename (_AMD_SAMPLE_NAME .. _AMD_VS_SUFFIX)
10 | startproject (_AMD_SAMPLE_NAME)
11 |
12 | filter "platforms:x64"
13 | system "Windows"
14 | architecture "x64"
15 |
16 | externalproject "AMD_SDK_Minimal"
17 | kind "StaticLib"
18 | language "C++"
19 | location "../../AMD_SDK/build"
20 | filename ("AMD_SDK_Minimal" .. _AMD_VS_SUFFIX)
21 | uuid "EBB939DC-98E4-49DF-B1F1-D2E80A11F60A"
22 |
23 | externalproject "DXUT"
24 | kind "StaticLib"
25 | language "C++"
26 | location "../../DXUT/Core"
27 | filename ("DXUT" .. _AMD_VS_SUFFIX)
28 | uuid "85344B7F-5AA0-4E12-A065-D1333D11F6CA"
29 |
30 | externalproject "DXUTOpt"
31 | kind "StaticLib"
32 | language "C++"
33 | location "../../DXUT/Optional"
34 | filename ("DXUTOpt" .. _AMD_VS_SUFFIX)
35 | uuid "61B333C2-C4F7-4CC1-A9BF-83F6D95588EB"
36 |
37 | project (_AMD_SAMPLE_NAME)
38 | kind "WindowedApp"
39 | language "C++"
40 | location "../build"
41 | filename (_AMD_SAMPLE_NAME .. _AMD_VS_SUFFIX)
42 | targetdir "../bin"
43 | objdir "../build/%{_AMD_SAMPLE_DIR_LAYOUT}"
44 | warnings "Extra"
45 | floatingpoint "Fast"
46 |
47 | -- Specify WindowsTargetPlatformVersion here for VS2015
48 | windowstarget (_AMD_WIN_SDK_VERSION)
49 |
50 | -- Copy DLLs to the local bin directory
51 | postbuildcommands { amdSamplePostbuildCommands() }
52 | postbuildmessage "Copying dependencies..."
53 |
54 | files { "../src/**.h", "../src/**.cpp", "../src/**.rc", "../src/**.manifest", "../src/**.hlsl" }
55 | includedirs { "../src/ResourceFiles" }
56 | links { "AMD_SDK_Minimal", "DXUT", "DXUTOpt", "d3dcompiler", "dxguid", "winmm", "comctl32", "Usp10", "Shlwapi" }
57 |
58 | filter "configurations:Debug"
59 | defines { "WIN32", "_DEBUG", "DEBUG", "PROFILE", "_WINDOWS", "_WIN32_WINNT=0x0601" }
60 | flags { "Symbols", "FatalWarnings", "Unicode", "WinMain" }
61 | targetsuffix ("_Debug" .. _AMD_VS_SUFFIX)
62 |
63 | filter "configurations:Release"
64 | defines { "WIN32", "NDEBUG", "PROFILE", "_WINDOWS", "_WIN32_WINNT=0x0601" }
65 | flags { "LinkTimeOptimization", "Symbols", "FatalWarnings", "Unicode", "WinMain" }
66 | targetsuffix ("_Release" .. _AMD_VS_SUFFIX)
67 | optimize "On"
68 |
--------------------------------------------------------------------------------
/gpuparticles11/src/ParticleHelpers.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 | #ifndef __PARTICLE_HELPERS_H__
23 | #define __PARTICLE_HELPERS_H__
24 |
25 |
26 | #include "..\\..\\DXUT\\Core\\DXUT.h"
27 |
28 |
29 | inline float RandomVariance( float median, float variance )
30 | {
31 | float fUnitRandomValue = (float)rand() / (float)RAND_MAX;
32 | float fRange = variance * fUnitRandomValue;
33 | return median - variance + (2.0f * fRange);
34 | }
35 |
36 |
37 | inline float RandomFromAndTo( float lowest, float highest )
38 | {
39 | float fUnitRandomValue = (float)rand() / (float)RAND_MAX;
40 | float fRange = (highest - lowest) * fUnitRandomValue;
41 | return lowest + fRange;
42 | }
43 |
44 |
45 |
46 | #endif
--------------------------------------------------------------------------------
/gpuparticles11/src/ParticleSystem.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 | #ifndef __PARTICLE_SYSTEM_H__
23 | #define __PARTICLE_SYSTEM_H__
24 |
25 |
26 | #include "..\\..\\DXUT\\Core\\DXUT.h"
27 | #include "..\\..\\AMD_SDK\\inc\\AMD_SDK.h"
28 |
29 |
30 | // Implementation-agnostic particle system interface
31 | struct IParticleSystem
32 | {
33 | // The rendering technique to use
34 | enum Technique
35 | {
36 | Technique_Rasterize,
37 | Technique_Tiled,
38 | Technique_Overdraw,
39 | Technique_Max
40 | };
41 |
42 | // The coarse culling mode to use, if any
43 | enum CoarseCullingMode
44 | {
45 | CoarseCullingOff,
46 | CoarseCulling4x2,
47 | CoarseCulling8x8,
48 | CoarseCulling16x16,
49 | NumCoarseCullingModes
50 | };
51 |
52 | // Per-frame stats from the particle system
53 | struct Stats
54 | {
55 | int m_MaxParticles;
56 | int m_NumActiveParticles;
57 | int m_NumDead;
58 | };
59 |
60 | enum Flags
61 | {
62 | PF_Sort = 1 << 0, // Sort the particles
63 | PF_CheapLighting = 1 << 1, // Perform minimal lighting on the particles to ease ALU load
64 | PF_NoLighting = 1 << 2, // Do no lighting at all, just display the particle texture on the billboard
65 | PF_CullMaxZ = 1 << 3, // Do per-tile MaxZ culling if applicable
66 | PF_Streaks = 1 << 4, // Streak the particles based on velocity
67 | PF_UseGeometryShader = 1 << 5, // Use the GS to do the billboarding, otherwise uses the VS for better performance
68 | PF_ScreenSpaceCulling = 1 << 6 // Do the tile culling in screen space to avoid potential false positives with frustum culling
69 | };
70 |
71 | // Per-emitter parameters
72 | struct EmitterParams
73 | {
74 | DirectX::XMVECTOR m_Position; // World position of the emitter
75 | DirectX::XMVECTOR m_Velocity; // Velocity of each particle from the emitter
76 | DirectX::XMVECTOR m_PositionVariance; // Variance in position of each particle
77 | int m_NumToEmit; // Number of particles to emit this frame
78 | float m_ParticleLifeSpan; // How long the particles should live
79 | float m_StartSize; // Size of particles at spawn time
80 | float m_EndSize; // Size of particle when they reach retirement age
81 | float m_Mass; // Mass of particle
82 | float m_VelocityVariance; // Variance in velocity of each particle
83 | int m_TextureIndex; // Index of the texture in the atlas
84 | bool m_Streaks; // Streak the particles in the direction of travel
85 | };
86 |
87 | // Create a GPU particle system. Add more factory functions to create other types of system eg CPU-updated system
88 | static IParticleSystem* CreateGPUSystem( AMD::ShaderCache& shadercache );
89 |
90 | virtual ~IParticleSystem() {}
91 |
92 | virtual void OnCreateDevice( ID3D11Device* pDevice, ID3D11DeviceContext* pImmediateContext ) = 0;
93 | virtual void OnResizedSwapChain( const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc ) = 0;
94 | virtual void OnReleasingSwapChain() = 0;
95 | virtual void OnDestroyDevice() = 0;
96 |
97 | // Completely resets the state of all particles. Handy for changing scenes etc
98 | virtual void Reset() = 0;
99 |
100 | // Render the system given a frame delta.
101 | virtual void Render( float frameTime, int flags, Technique technique, CoarseCullingMode coarseCullingMode, const EmitterParams* pEmitters, int nNumEmitters, ID3D11ShaderResourceView* depthSRV ) = 0;
102 |
103 | // Retrive the statistics about this frame's particles
104 | virtual const Stats& GetStats() const = 0;
105 | };
106 |
107 |
108 | #endif
--------------------------------------------------------------------------------
/gpuparticles11/src/ResourceFiles/GPUParticles11.rc:
--------------------------------------------------------------------------------
1 | // Microsoft Visual C++ generated resource script.
2 | //
3 | #include "resource.h"
4 |
5 | #define APSTUDIO_READONLY_SYMBOLS
6 | /////////////////////////////////////////////////////////////////////////////
7 | //
8 | // Generated from the TEXTINCLUDE 2 resource.
9 | //
10 | #define IDC_STATIC -1
11 | #include
12 |
13 |
14 |
15 | /////////////////////////////////////////////////////////////////////////////
16 | #undef APSTUDIO_READONLY_SYMBOLS
17 |
18 | /////////////////////////////////////////////////////////////////////////////
19 | // English (U.S.) resources
20 |
21 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
22 | #ifdef _WIN32
23 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
24 | #pragma code_page(1252)
25 | #endif //_WIN32
26 |
27 | /////////////////////////////////////////////////////////////////////////////
28 | //
29 | // Icon
30 | //
31 |
32 | // Icon with lowest ID value placed first to ensure application icon
33 | // remains consistent on all systems.
34 | IDI_MAIN_ICON ICON "..\\..\\AMD_SDK\\media\\AMD.ico"
35 |
36 | #ifdef APSTUDIO_INVOKED
37 | /////////////////////////////////////////////////////////////////////////////
38 | //
39 | // TEXTINCLUDE
40 | //
41 |
42 | 1 TEXTINCLUDE
43 | BEGIN
44 | "resource.h\0"
45 | END
46 |
47 | 2 TEXTINCLUDE
48 | BEGIN
49 | "#define IDC_STATIC -1\r\n"
50 | "#include \r\n"
51 | "\r\n"
52 | "\r\n"
53 | "\0"
54 | END
55 |
56 | 3 TEXTINCLUDE
57 | BEGIN
58 | "\r\n"
59 | "\0"
60 | END
61 |
62 | #endif // APSTUDIO_INVOKED
63 |
64 | #endif // English (U.S.) resources
65 | /////////////////////////////////////////////////////////////////////////////
66 |
67 |
68 |
69 | #ifndef APSTUDIO_INVOKED
70 | /////////////////////////////////////////////////////////////////////////////
71 | //
72 | // Generated from the TEXTINCLUDE 3 resource.
73 | //
74 |
75 |
76 | /////////////////////////////////////////////////////////////////////////////
77 | #endif // not APSTUDIO_INVOKED
78 |
79 |
--------------------------------------------------------------------------------
/gpuparticles11/src/ResourceFiles/dpiaware.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | True/PM
5 |
6 |
7 |
--------------------------------------------------------------------------------
/gpuparticles11/src/ResourceFiles/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by GPUParticles11.rc
4 | //
5 | #define IDI_MAIN_ICON 101
6 |
7 | // Next default values for new objects
8 | //
9 | #ifdef APSTUDIO_INVOKED
10 | #ifndef APSTUDIO_READONLY_SYMBOLS
11 | #define _APS_NEXT_RESOURCE_VALUE 113
12 | #define _APS_NEXT_COMMAND_VALUE 40029
13 | #define _APS_NEXT_CONTROL_VALUE 1000
14 | #define _APS_NEXT_SYMED_VALUE 101
15 | #endif
16 | #endif
17 |
--------------------------------------------------------------------------------
/gpuparticles11/src/Shaders/FullscreenQuad.hlsl:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 | #include "Globals.h"
23 |
24 | struct VS_OUTPUT
25 | {
26 | float2 TexCoord : TEXCOORD0;
27 | float4 Position : SV_POSITION;
28 | };
29 |
30 | Texture2D g_Texture : register( t0 );
31 |
32 |
33 | VS_OUTPUT FSQuadVS( uint VertexId : SV_VertexID )
34 | {
35 | VS_OUTPUT Output;
36 |
37 | float2 corner = float2( (VertexId << 1) & 2, VertexId & 2 );
38 | Output.Position = float4( corner * float2( 2.0, -2.0 ) + float2( -1.0, 1.0 ), 0.0, 1.0 );
39 | Output.TexCoord = corner;
40 |
41 | return Output;
42 | }
43 |
44 |
45 | float4 FSQuadPS( float2 TexCoord : TEXCOORD0 ) : SV_Target
46 | {
47 | return g_Texture.Sample( g_samWrapLinear, TexCoord );
48 | }
--------------------------------------------------------------------------------
/gpuparticles11/src/Shaders/InitDeadList.hlsl:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | // A simple compute shader that adds each particle to the dead list UAV
24 |
25 | AppendStructuredBuffer g_DeadListToAddTo : register( u0 );
26 |
27 | [numthreads(256,1,1)]
28 | void CS_InitDeadList( uint3 id : SV_DispatchThreadID )
29 | {
30 | g_DeadListToAddTo.Append( id.x );
31 | }
--------------------------------------------------------------------------------
/gpuparticles11/src/Shaders/InitSortArgsCS.hlsl:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | RWBuffer g_DispatchArgs : register( u0 );
24 |
25 | cbuffer NumElementsCB : register( b0 )
26 | {
27 | int4 g_NumElements;
28 | };
29 |
30 |
31 | [numthreads(1, 1, 1)]
32 | void InitDispatchArgs( uint3 id : SV_DispatchThreadID )
33 | {
34 | g_DispatchArgs[ 0 ] = ((g_NumElements-1) >> 9) + 1;
35 | g_DispatchArgs[ 1 ] = 1;
36 | g_DispatchArgs[ 2 ] = 1;
37 | g_DispatchArgs[ 3 ] = 0;
38 | }
--------------------------------------------------------------------------------
/gpuparticles11/src/Shaders/ParticleEmit.hlsl:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 | #include "Globals.h"
23 |
24 |
25 | // A texture filled with random values for generating some variance in our particles when we spawn them
26 | Texture2D g_RandomBuffer : register( t0 );
27 |
28 | // The particle buffers to fill with new particles
29 | RWStructuredBuffer g_ParticleBufferA : register( u0 );
30 | RWStructuredBuffer g_ParticleBufferB : register( u1 );
31 |
32 | // The dead list interpretted as a consume buffer. So every time we consume an index from this list, it automatically decrements the atomic counter (ie the number of dead particles)
33 | ConsumeStructuredBuffer g_DeadListToAllocFrom : register( u2 );
34 |
35 |
36 | cbuffer EmitterConstantBuffer : register( b1 )
37 | {
38 | float4 g_vEmitterPosition;
39 | float4 g_vEmitterVelocity;
40 | float4 g_PositionVariance;
41 |
42 | int g_MaxParticlesThisFrame;
43 | float g_ParticleLifeSpan;
44 | float g_StartSize;
45 | float g_EndSize;
46 |
47 | float g_VelocityVariance;
48 | float g_Mass;
49 | uint g_EmitterIndex;
50 | uint g_EmitterStreaks;
51 |
52 | uint g_TextureIndex;
53 | uint g_pads[ 3 ];
54 | };
55 |
56 |
57 | // Emit particles, one per thread, in blocks of 1024 at a time
58 | [numthreads(1024,1,1)]
59 | void CS_Emit( uint3 id : SV_DispatchThreadID )
60 | {
61 | // Check to make sure we don't emit more particles than we specified
62 | if ( id.x < g_NumDeadParticles && id.x < g_MaxParticlesThisFrame )
63 | {
64 | // Initialize the particle data to zero to avoid any unexpected results
65 | GPUParticlePartA pa = (GPUParticlePartA)0;
66 | GPUParticlePartB pb = (GPUParticlePartB)0;
67 |
68 | // Generate some random numbers from reading the random texture
69 | float2 uv = float2( id.x / 1024.0, g_ElapsedTime );
70 | float3 randomValues0 = g_RandomBuffer.SampleLevel( g_samWrapLinear, uv, 0 ).xyz;
71 |
72 | float2 uv2 = float2( (id.x + 1) / 1024.0, g_ElapsedTime );
73 | float3 randomValues1 = g_RandomBuffer.SampleLevel( g_samWrapLinear, uv2, 0 ).xyz;
74 |
75 | float velocityMagnitude = length( g_vEmitterVelocity.xyz );
76 |
77 | pb.m_Position = g_vEmitterPosition.xyz + ( randomValues0.xyz * g_PositionVariance.xyz );
78 |
79 | pa.m_EmitterProperties = WriteEmitterProperties( g_EmitterIndex, g_TextureIndex, g_EmitterStreaks ? true : false );
80 | pa.m_Rotation = 0;
81 | pa.m_IsSleeping = 0;
82 | pa.m_CollisionCount = 0;
83 |
84 | pb.m_Mass = g_Mass;
85 | pb.m_Velocity = g_vEmitterVelocity.xyz + ( randomValues1.xyz * velocityMagnitude * g_VelocityVariance );
86 | pb.m_Lifespan = g_ParticleLifeSpan;
87 | pb.m_Age = pb.m_Lifespan;
88 | pb.m_StartSize = g_StartSize;
89 | pb.m_EndSize = g_EndSize;
90 |
91 | // The index into the global particle list obtained from the dead list.
92 | // Calling consume will decrement the counter in this buffer.
93 | uint index = g_DeadListToAllocFrom.Consume();
94 |
95 | // Write the new particle state into the global particle buffer
96 | g_ParticleBufferA[ index ] = pa;
97 | g_ParticleBufferB[ index ] = pb;
98 | }
99 | }
--------------------------------------------------------------------------------
/gpuparticles11/src/Shaders/ParticleRenderQuad.hlsl:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 | #include "Globals.h"
23 |
24 |
25 | struct VS_OUTPUT
26 | {
27 | float4 Position : SV_POSITION;
28 | };
29 |
30 | // The UAV for tiled rendering
31 | Buffer g_RenderBuffer : register( t0 );
32 |
33 |
34 | VS_OUTPUT QuadVS( uint VertexId : SV_VertexID )
35 | {
36 | VS_OUTPUT Output;
37 |
38 | float2 corner = float2( (VertexId << 1) & 2, VertexId & 2 );
39 | Output.Position = float4( corner * float2( 2.0, -2.0 ) + float2( -1.0, 1.0 ), 0.0, 1.0 );
40 |
41 | return Output;
42 | }
43 |
44 |
45 | float4 QuadPS( float4 Position : SV_POSITION ) : SV_Target
46 | {
47 | float4 colour = 1;
48 |
49 | // Get XY coordinates for pixel
50 | float x = Position.x - (g_ScreenWidth / 2);
51 | float y = Position.y;
52 |
53 | // Get the pixel index into the UAV
54 | uint pixelIndex = x + (y * g_ScreenWidth);
55 |
56 | // Load the pixel value from the UAV
57 | float4 particleValue = g_RenderBuffer.Load( pixelIndex );
58 |
59 | colour = particleValue;
60 |
61 | return colour;
62 | }
--------------------------------------------------------------------------------
/gpuparticles11/src/Shaders/ParticleSort.hlsl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/GPUParticles11/1f2ef4f0cf2025238c7823eede0ec0db7346efab/gpuparticles11/src/Shaders/ParticleSort.hlsl
--------------------------------------------------------------------------------
/gpuparticles11/src/Shaders/RenderScene.hlsl:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #include "Globals.h"
24 |
25 |
26 | struct VS_RenderSceneInput
27 | {
28 | float3 f3Position : POSITION;
29 | float3 f3Normal : NORMAL;
30 | float2 f2TexCoord : TEXCOORD0;
31 | float3 f3Tangent : TANGENT;
32 | };
33 |
34 | struct PS_RenderSceneInput
35 | {
36 | float4 f4Position : SV_Position;
37 | float2 f2TexCoord : TEXCOORD0;
38 | float3 f3Normal : NORMAL;
39 | float3 f3Tangent : TANGENT;
40 | float3 f3WorldPos : TEXCOORD2;
41 | };
42 |
43 | Texture2D g_txDiffuse : register( t2 );
44 | Texture2D g_txNormal : register( t3 );
45 |
46 | //=================================================================================================================================
47 | // This shader computes standard transform and lighting
48 | //=================================================================================================================================
49 | PS_RenderSceneInput VS_RenderScene( VS_RenderSceneInput I )
50 | {
51 | PS_RenderSceneInput O;
52 |
53 | // Transform the position from object space to homogeneous projection space
54 | O.f4Position = mul( float4( I.f3Position, 1.0f ), g_mViewProjection );
55 |
56 | // Transform the normal, tangent and position from object space to world space
57 | //O.f3WorldPos = mul( I.f3Position, (float3x3)g_f4x4World );
58 | //O.f3Normal = normalize( mul( I.f3Normal, (float3x3)g_f4x4World ) );
59 | //O.f3Tangent = normalize( mul( I.f3Tangent, (float3x3)g_f4x4World ) );
60 | O.f3WorldPos = I.f3Position;
61 | O.f3Normal = normalize( I.f3Normal );
62 | O.f3Tangent = normalize( I.f3Tangent );
63 |
64 | // Pass through tex coords
65 | O.f2TexCoord = I.f2TexCoord;
66 |
67 | return O;
68 | }
69 |
70 |
71 | //=================================================================================================================================
72 | // This shader outputs the pixel's color by passing through the lit
73 | // diffuse material color
74 | //=================================================================================================================================
75 | float4 PS_RenderScene( PS_RenderSceneInput I ) : SV_Target0
76 | {
77 | float4 f4Diffuse = g_txDiffuse.Sample( g_samWrapLinear, I.f2TexCoord );
78 | float fSpecMask = f4Diffuse.a;
79 | float3 f3Norm = g_txNormal.Sample( g_samWrapLinear, I.f2TexCoord ).xyz;
80 | f3Norm *= 2.0f;
81 | f3Norm -= float3( 1.0f, 1.0f, 1.0f );
82 |
83 | float3 f3Binorm = normalize( cross( I.f3Normal, I.f3Tangent ) );
84 | float3x3 f3x3BasisMatrix = float3x3( f3Binorm, I.f3Tangent, I.f3Normal );
85 | f3Norm = normalize( mul( f3Norm, f3x3BasisMatrix ) );
86 |
87 | // Diffuse lighting
88 | float4 f4Lighting = saturate( dot( f3Norm, g_SunDirection.xyz ) ) * g_SunColor;
89 | f4Lighting += g_AmbientColor;
90 |
91 | // Calculate specular power
92 | float3 f3ViewDir = normalize( g_EyePosition.xyz - I.f3WorldPos );
93 | float3 f3HalfAngle = normalize( f3ViewDir + g_SunDirection.xyz );
94 | float4 f4SpecPower1 = pow( saturate( dot( f3HalfAngle, f3Norm ) ), 32 ) * g_SunColor;
95 |
96 | return f4Lighting * f4Diffuse + ( f4SpecPower1 * fSpecMask );
97 | }
98 |
99 |
100 |
101 | //--------------------------------------------------------------------------------------
102 | // PS for the sky
103 | //--------------------------------------------------------------------------------------
104 | float4 PS_Sky( PS_RenderSceneInput I ) : SV_Target
105 | {
106 | float4 f4O;
107 |
108 | // Bog standard textured rendering
109 | f4O.xyz = g_txDiffuse.Sample( g_samWrapLinear, I.f2TexCoord ).xyz;
110 | f4O.w = 1.0f;
111 |
112 | return f4O;
113 | }
--------------------------------------------------------------------------------
/gpuparticles11/src/Shaders/ShaderConstants.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | // This file is shared between the HLSL and C++ code for convenience
24 |
25 | // Fine-grained culling and rendering tile size
26 | #define TILE_RES_X 32
27 | #define TILE_RES_Y 32
28 |
29 | // Maximum number of emitters supported
30 | #define NUM_EMITTERS 4
31 |
32 | // Maximum number of particles that can be stored per tile. Storing more will increase the amount of LDS and thus potentially reduce the number of waves in flight
33 | #define NUM_PARTICLES_PER_TILE 1023
34 |
35 | // The per-tile buffer size is the maximum number of particles that can be stored, plus another UINT to store the number of particles in that tile
36 | #define PARTICLES_TILE_BUFFER_SIZE (NUM_PARTICLES_PER_TILE+1)
37 |
38 | // The number of threads in the coarse culling thread group
39 | #define COARSE_CULLING_THREADS 256 // 512 and 1024 are fractionally slower
--------------------------------------------------------------------------------
/gpuparticles11/src/Shaders/SortCS.hlsl:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 |
23 | #if( SORT_SIZE>4096 )
24 | // won't work for arrays>4096
25 | #error due to LDS size SORT_SIZE must be 4096 or smaller
26 | #else
27 | #define ITEMS_PER_GROUP ( SORT_SIZE )
28 | #endif
29 |
30 | #define HALF_SIZE (SORT_SIZE/2)
31 | #define ITERATIONS (HALF_SIZE > 1024 ? HALF_SIZE/1024 : 1)
32 | #define NUM_THREADS (HALF_SIZE/ITERATIONS)
33 | #define INVERSION (16*2 + 8*3)
34 |
35 | //--------------------------------------------------------------------------------------
36 | // Constant Buffers
37 | //--------------------------------------------------------------------------------------
38 | cbuffer NumElementsCB : register( b0 )
39 | {
40 | int4 g_NumElements;
41 | };
42 |
43 | //--------------------------------------------------------------------------------------
44 | // Structured Buffers
45 | //--------------------------------------------------------------------------------------
46 | RWStructuredBuffer Data : register( u0 );
47 |
48 |
49 | //--------------------------------------------------------------------------------------
50 | // Bitonic Sort Compute Shader
51 | //--------------------------------------------------------------------------------------
52 | groupshared float2 g_LDS[SORT_SIZE];
53 |
54 |
55 | [numthreads(NUM_THREADS, 1, 1)]
56 | void BitonicSortLDS( uint3 Gid : SV_GroupID,
57 | uint3 DTid : SV_DispatchThreadID,
58 | uint3 GTid : SV_GroupThreadID,
59 | uint GI : SV_GroupIndex )
60 | {
61 | int GlobalBaseIndex = (Gid.x * SORT_SIZE) + GTid.x;
62 | int LocalBaseIndex = GI;
63 |
64 | int numElementsInThreadGroup = min( SORT_SIZE, g_NumElements.x - (Gid.x * SORT_SIZE) );
65 |
66 | // Load shared data
67 | int i;
68 | [unroll]for( i = 0; i<2*ITERATIONS; ++i )
69 | {
70 | if( GI+i*NUM_THREADS>1; nMergeSubSize>0; nMergeSubSize=nMergeSubSize>>1 )
79 | {
80 | [unroll]for( i = 0; i>1 ? index_high + (2*nMergeSubSize-1) - index_low : index_high + nMergeSubSize + index_low;
88 | if( nSwapElem b.x )
94 | {
95 | g_LDS[index] = b;
96 | g_LDS[nSwapElem] = a;
97 | }
98 | }
99 | GroupMemoryBarrierWithGroupSync();
100 | }
101 | }
102 | }
103 |
104 | // Store shared data
105 | [unroll]for( i = 0; i<2*ITERATIONS; ++i )
106 | {
107 | if( GI+i*NUM_THREADS2048 )
24 | #error
25 | #endif
26 |
27 | #define NUM_THREADS (SORT_SIZE/2)
28 | #define INVERSION (16*2 + 8*3)
29 |
30 | //--------------------------------------------------------------------------------------
31 | // Constant Buffers
32 | //--------------------------------------------------------------------------------------
33 | cbuffer NumElementsCB : register( b0 )
34 | {
35 | int4 g_NumElements;
36 | };
37 |
38 | //--------------------------------------------------------------------------------------
39 | // Structured Buffers
40 | //--------------------------------------------------------------------------------------
41 | RWStructuredBuffer Data : register( u0 );
42 |
43 |
44 | //--------------------------------------------------------------------------------------
45 | // Bitonic Sort Compute Shader
46 | //--------------------------------------------------------------------------------------
47 | groupshared float2 g_LDS[SORT_SIZE];
48 |
49 |
50 | [numthreads(NUM_THREADS, 1, 1)]
51 | void BitonicInnerSort( uint3 Gid : SV_GroupID,
52 | uint3 DTid : SV_DispatchThreadID,
53 | uint3 GTid : SV_GroupThreadID,
54 | uint GI : SV_GroupIndex )
55 | {
56 | int4 tgp;
57 |
58 | tgp.x = Gid.x * 256;
59 | tgp.y = 0;
60 | tgp.z = g_NumElements.x;
61 | tgp.w = min( 512, max( 0, g_NumElements.x - Gid.x * 512 ) );
62 |
63 | int GlobalBaseIndex = tgp.y + tgp.x*2 + GTid.x;
64 | int LocalBaseIndex = GI;
65 | int i;
66 |
67 | // Load shared data
68 | [unroll]for( i = 0; i<2; ++i )
69 | {
70 | if( GI+i*NUM_THREADS>1; nMergeSubSize>0; nMergeSubSize=nMergeSubSize>>1 )
77 | {
78 | int tmp_index = GI;
79 | int index_low = tmp_index & (nMergeSubSize-1);
80 | int index_high = 2*(tmp_index-index_low);
81 | int index = index_high + index_low;
82 |
83 | unsigned int nSwapElem = index_high + nMergeSubSize + index_low;
84 |
85 | if( nSwapElem b.x)
91 | {
92 | g_LDS[index] = b;
93 | g_LDS[nSwapElem] = a;
94 | }
95 | }
96 | GroupMemoryBarrierWithGroupSync();
97 | }
98 |
99 | // Store shared data
100 | [unroll]for( i = 0; i<2; ++i )
101 | {
102 | if( GI+i*NUM_THREADS Data : register( u0 );
27 |
28 | //--------------------------------------------------------------------------------------
29 | // Bitonic Sort Compute Shader
30 | //--------------------------------------------------------------------------------------
31 | cbuffer NumElementsCB : register( b0 )
32 | {
33 | int4 g_NumElements;
34 | };
35 |
36 | cbuffer SortConstants : register( b1 )
37 | {
38 | int4 job_params;
39 | };
40 |
41 | [numthreads(256, 1, 1)]
42 | void BitonicSortStep( uint3 Gid : SV_GroupID,
43 | uint3 GTid : SV_GroupThreadID )
44 | {
45 | int4 tgp;
46 |
47 | tgp.x = Gid.x * 256;
48 | tgp.y = 0;
49 | tgp.z = g_NumElements.x;
50 | tgp.w = min( 512, max( 0, g_NumElements.x - Gid.x * 512 ) );
51 |
52 | uint localID = tgp.x + GTid.x; // calculate threadID within this sortable-array
53 |
54 | uint index_low = localID & (job_params.x-1);
55 | uint index_high = 2*(localID-index_low);
56 |
57 | uint index = tgp.y + index_high + index_low;
58 | uint nSwapElem = tgp.y + index_high + job_params.y + job_params.z*index_low;
59 |
60 | if( nSwapElem b.x)
66 | {
67 | Data[index] = b;
68 | Data[nSwapElem] = a;
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/gpuparticles11/src/Shaders/Terrain.hlsl:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 | #include "Globals.h"
23 |
24 |
25 | struct VS_INPUT
26 | {
27 | float3 Position : POSITION;
28 | float3 Normal : NORMAL;
29 | float2 TexCoord : TEXCOORD0;
30 | };
31 |
32 | struct VS_OUTPUT
33 | {
34 | float4 Position : SV_POSITION;
35 | float3 Normal : NORMAL;
36 | };
37 |
38 |
39 | VS_OUTPUT TerrainVS( VS_INPUT input )
40 | {
41 | VS_OUTPUT Output;
42 |
43 | Output.Position = mul( float4( input.Position, 1 ), g_mViewProjection );
44 | Output.Normal = input.Normal;
45 |
46 | return Output;
47 | }
48 |
49 |
50 | float4 TerrainPS( VS_OUTPUT In ) : SV_TARGET
51 | {
52 | float ndotl = saturate( dot( In.Normal, g_SunDirection ) );
53 | float4 albedo = float4( 0.5, 0.5, 0.6, 1 );
54 |
55 | float4 color = 1;
56 |
57 | color.rgb = albedo.rgb * ( ndotl * g_SunColor.rgb + g_AmbientColor.rgb );
58 | return color;
59 | }
--------------------------------------------------------------------------------
/gpuparticles11/src/SortLib.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | // copies of the Software, and to permit persons to whom the Software is
9 | // furnished to do so, subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in
12 | // all copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 | // THE SOFTWARE.
21 | //
22 | #pragma once
23 |
24 | class SortLib
25 | {
26 | public:
27 | SortLib();
28 | virtual ~SortLib();
29 |
30 | HRESULT init( ID3D11Device* device, ID3D11DeviceContext* context );
31 | void run( unsigned int maxSize, ID3D11UnorderedAccessView* sortBufferUAV, ID3D11Buffer* itemCountBuffer );
32 | void release();
33 |
34 | private:
35 | bool sortInitial ( unsigned int maxSize );
36 | bool sortIncremental ( unsigned int presorted, unsigned int maxSize );
37 |
38 | #ifdef _DEBUG
39 | void manualValidate ( unsigned int maxSize, ID3D11UnorderedAccessView* pUAV );
40 | #endif
41 |
42 | private:
43 |
44 | ID3D11Device* m_device;
45 | ID3D11DeviceContext* m_context;
46 | ID3D11Buffer* m_pcbDispatchInfo; // constant buffer containing dispatch specific information
47 |
48 | ID3D11ComputeShader* m_pCSSortStep; // CS port of the VS/PS bitonic sort
49 | ID3D11ComputeShader* m_pCSSort512; // CS implementation to sort a number of 512 element sized arrays using a single dispatch
50 | ID3D11ComputeShader* m_pCSSortInner512; // CS implementation of the "down" pass from 512 to 1
51 | ID3D11ComputeShader* m_pCSInitArgs; // CS to write indirect args for Dispatch calls
52 |
53 | ID3D11Buffer* m_pIndirectSortArgsBuffer;
54 | ID3D11UnorderedAccessView* m_pIndirectSortArgsBufferUAV;
55 | };
56 |
--------------------------------------------------------------------------------
/gpuparticles11/src/Terrain.h:
--------------------------------------------------------------------------------
1 | //--------------------------------------------------------------------------------------
2 | // Terrain.h
3 | // PIX Workshop GDC2007
4 | // Copyright (c) Microsoft Corporation. All rights reserved.
5 | //--------------------------------------------------------------------------------------
6 | #pragma once
7 |
8 | struct TERRAIN_VERTEX
9 | {
10 | DirectX::XMFLOAT3 pos;
11 | DirectX::XMFLOAT3 norm;
12 | DirectX::XMFLOAT2 uv;
13 | };
14 |
15 |
16 | struct BOUNDING_BOX
17 | {
18 | DirectX::XMFLOAT3 min;
19 | DirectX::XMFLOAT3 max;
20 | };
21 |
22 | struct TERRAIN_TILE
23 | {
24 | ID3D11Buffer* pVB10;
25 | UINT NumVertices;
26 | TERRAIN_VERTEX* pRawVertices;
27 | BOUNDING_BOX BBox;
28 | };
29 |
30 | class CTerrain
31 | {
32 | private:
33 | // LPDIRECT3DDEVICE9 m_pDev;
34 | ID3D11Device* m_pDev10;
35 | ID3D11DeviceContext* m_pContext;
36 | UINT m_SqrtNumTiles;
37 | UINT m_NumTiles;
38 | UINT m_NumSidesPerTile;
39 | TERRAIN_TILE* m_pTiles;
40 | float m_fWorldScale;
41 | float m_fHeightScale;
42 | UINT m_HeightMapX;
43 | UINT m_HeightMapY;
44 | float* m_pHeightBits;
45 |
46 | UINT m_NumIndices;
47 | ID3D11Buffer* m_pTerrainIB10;
48 | UINT* m_pTerrainRawIndices;
49 |
50 | public:
51 | CTerrain();
52 | ~CTerrain();
53 |
54 | void OnDestroyDevice();
55 | HRESULT OnCreateDevice( ID3D11Device* pDev, ID3D11DeviceContext* pContext );
56 |
57 | HRESULT LoadTerrain( WCHAR* strHeightMap, UINT SqrtNumTiles, UINT NumSidesPerTile,
58 | float fWorldScale, float fHeightScale );
59 | float GetHeightForTile( UINT iTile, DirectX::XMFLOAT3 pPos );
60 | float GetHeightOnMap( DirectX::XMVECTOR pos );
61 | DirectX::XMFLOAT3 GetNormalOnMap( DirectX::XMVECTOR pPos );
62 | void RenderTile( TERRAIN_TILE* pTile );
63 |
64 | float GetWorldScale()
65 | {
66 | return m_fWorldScale;
67 | }
68 |
69 | ID3D11Buffer* GetTerrainIB10()
70 | {
71 | return m_pTerrainIB10;
72 | }
73 | UINT GetNumTiles()
74 | {
75 | return m_NumTiles;
76 | }
77 | TERRAIN_TILE* GetTile( UINT iTile )
78 | {
79 | return &m_pTiles[iTile];
80 | }
81 |
82 | protected:
83 | DirectX::XMFLOAT2 GetUVForPosition( DirectX::XMVECTOR pPos );
84 | HRESULT LoadBMPImage( WCHAR* strHeightMap );
85 | HRESULT GenerateTile( TERRAIN_TILE* pTile, BOUNDING_BOX* pBBox );
86 | HRESULT CreateTileResources( TERRAIN_TILE* pTile );
87 | };
88 |
89 | float RPercent();
90 |
91 | //--------------------------------------------------------------------------------------
92 | template void QuickDepthSort( T* indices, float* depths, int lo, int hi )
93 | {
94 | // lo is the lower index, hi is the upper index
95 | // of the region of array a that is to be sorted
96 | int i = lo, j = hi;
97 | float h;
98 | T index;
99 | float x = depths[( lo + hi ) / 2];
100 |
101 | // partition
102 | do
103 | {
104 | while( depths[i] < x ) i++;
105 | while( depths[j] > x ) j--;
106 | if( i <= j )
107 | {
108 | h = depths[i]; depths[i] = depths[j]; depths[j] = h;
109 | index = indices[i]; indices[i] = indices[j]; indices[j] = index;
110 | i++; j--;
111 | }
112 | } while( i <= j );
113 |
114 | // recursion
115 | if( lo < j ) QuickDepthSort( indices, depths, lo, j );
116 | if( i < hi ) QuickDepthSort( indices, depths, i, hi );
117 | }
118 |
--------------------------------------------------------------------------------
/premake/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2003-2015 Jason Perkins and individual contributors.
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without modification,
5 | are permitted provided that the following conditions are met:
6 |
7 | 1. Redistributions of source code must retain the above copyright notice,
8 | this list of conditions and the following disclaimer.
9 |
10 | 2. Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | 3. Neither the name of Premake nor the names of its contributors may be
15 | used to endorse or promote products derived from this software without
16 | specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/premake/amd_premake_util.lua:
--------------------------------------------------------------------------------
1 | -- amd_premake_util.lua
2 | -- utility code shared by AMD build scripts
3 |
4 | -- _ACTION is a premake global variable and for our usage will be vs2012, vs2013, etc.
5 | -- Strip "vs" from this string to make a suffix for solution and project files.
6 | _AMD_VS_SUFFIX = "_" .. string.gsub(_ACTION, "vs", "")
7 |
8 | -- _ACTION is a premake global variable and for our usage will be vs2012, vs2013, etc.
9 | -- Make an allcaps version. We use this for some directory names.
10 | _AMD_ACTION_ALL_CAPS = string.upper(_ACTION)
11 |
12 | -- Specify build output directory structure here: e.g. Desktop_2012\x64\DLL_Debug
13 | _AMD_SAMPLE_DIR_LAYOUT = "Desktop%{_AMD_VS_SUFFIX}/%{cfg.platform}/%{cfg.buildcfg}"
14 | _AMD_LIBRARY_DIR_LAYOUT = "%{_AMD_ACTION_ALL_CAPS}/%{cfg.platform}/%{cfg.buildcfg}"
15 |
16 | -- Some projects have a "minimal dependencies" build. Give them a different output
17 | -- directory structure to avoid collisions with the full-dependencies version.
18 | _AMD_SAMPLE_DIR_LAYOUT_MINIMAL = "Desktop%{_AMD_VS_SUFFIX}/minimal/%{cfg.platform}/%{cfg.buildcfg}"
19 | _AMD_LIBRARY_DIR_LAYOUT_MINIMAL = "%{_AMD_ACTION_ALL_CAPS}/minimal/%{cfg.platform}/%{cfg.buildcfg}"
20 |
21 | -- Specify WindowsTargetPlatformVersion here for VS2015
22 | _AMD_WIN_SDK_VERSION = "8.1"
23 |
24 | -- command lines for Visual Studio build events
25 | _AMD_COPY_WIN_8_0_SDK_REDIST_TO_BIN = "if not exist \"..\\bin\\d3dcompiler_46.dll\" if exist \"$(ProgramFiles)\\Windows Kits\\8.0\\Redist\\D3D\\x64\\d3dcompiler_46.dll\" xcopy \"$(ProgramFiles)\\Windows Kits\\8.0\\Redist\\D3D\\x64\\d3dcompiler_46.dll\" \"..\\bin\" /H /R /Y > nul"
26 | _AMD_COPY_WIN_8_1_SDK_REDIST_TO_BIN = "if not exist \"..\\bin\\d3dcompiler_47.dll\" if exist \"$(ProgramFiles)\\Windows Kits\\8.1\\Redist\\D3D\\x64\\d3dcompiler_47.dll\" xcopy \"$(ProgramFiles)\\Windows Kits\\8.1\\Redist\\D3D\\x64\\d3dcompiler_47.dll\" \"..\\bin\" /H /R /Y > nul"
27 | _AMD_COPY_AGS_RLS_DLL_TO_BIN = "xcopy \"..\\..\\ags_lib\\lib\\amd_ags_x64.dll\" \"..\\bin\" /H /R /Y > nul"
28 |
29 | -- post-build commands for samples
30 | function amdSamplePostbuildCommands(copyAgs)
31 | local commands = {}
32 | local doCopyAgs = copyAgs or false
33 | -- for VS2012 and earlier, copy d3dcompiler_46.dll from the 8.0 SDK to the local bin directory
34 | if _ACTION <= "vs2012" then
35 | table.insert(commands, _AMD_COPY_WIN_8_0_SDK_REDIST_TO_BIN)
36 | end
37 | -- copy d3dcompiler_47.dll from the 8.1 SDK to the local bin directory
38 | table.insert(commands, _AMD_COPY_WIN_8_1_SDK_REDIST_TO_BIN)
39 | if doCopyAgs then
40 | -- copy the AGS DLLs to the local bin directory
41 | table.insert(commands, _AMD_COPY_AGS_RLS_DLL_TO_BIN)
42 | end
43 | return commands
44 | end
45 |
--------------------------------------------------------------------------------
/premake/premake5.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/GPUParticles11/1f2ef4f0cf2025238c7823eede0ec0db7346efab/premake/premake5.exe
--------------------------------------------------------------------------------
/premake/update_all_vs_files_for_dx11_sample.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | if %1.==. goto usage
4 |
5 | set update_all_arg1=%1
6 |
7 | :: strip off relative path
8 | if "%update_all_arg1:~0,3%" == "..\" set update_all_arg1=%update_all_arg1:~3%
9 |
10 | set update_all_startdir=%cd%
11 | cd %~dp0
12 | call update_vs_files_for_dx11_sample.bat %update_all_arg1% vs2010
13 | call update_vs_files_for_dx11_sample.bat %update_all_arg1% vs2012
14 | call update_vs_files_for_dx11_sample.bat %update_all_arg1% vs2013
15 | call update_vs_files_for_dx11_sample.bat %update_all_arg1% vs2015
16 |
17 | :: we don't keep VS2010 projects for the sample
18 | del /f /q ..\%update_all_arg1%\build\%update_all_arg1%_2010.*
19 |
20 | cd %update_all_startdir%
21 |
22 | goto :EOF
23 |
24 | ::--------------------------
25 | :: usage should be last
26 | ::--------------------------
27 |
28 | :usage
29 | echo usage: %0 sample_dir_name
30 | echo or: %0 ..\sample_dir_name
31 | echo example: %0 forwardplus11
32 | echo or: %0 ..\forwardplus11
33 |
--------------------------------------------------------------------------------
/premake/update_vs_files_for_dx11_sample.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | if %1.==. goto usage
4 | if %2.==. goto usage
5 |
6 | set arg1=%1
7 | set arg2=%2
8 |
9 | :: strip off relative path
10 | if "%arg1:~0,3%" == "..\" set arg1=%arg1:~3%
11 |
12 | set startdir=%cd%
13 | cd %~dp0
14 |
15 | if exist ..\amd_lib\premake (
16 | echo --- amd_lib ---
17 | cd ..\amd_lib\premake
18 | call :createvsfiles %arg2%
19 | call :createvsfileswithminimaldependencies %arg2%
20 | cd %~dp0
21 | )
22 |
23 | if exist ..\amd_sdk\premake (
24 | echo --- amd_sdk ---
25 | cd ..\amd_sdk\premake
26 | call :createvsfiles %arg2%
27 | call :createvsfileswithminimaldependencies %arg2%
28 | cd %~dp0
29 | )
30 |
31 | echo --- dxut core ---
32 | cd ..\dxut\Core
33 | call :createvsfiles %arg2%
34 |
35 | echo --- dxut optional ---
36 | cd ..\Optional
37 | call :createvsfiles %arg2%
38 | cd ..\..\
39 | :: we don't keep solution files for amd_lib, amd_sdk, or dxut
40 | call :cleanslnfiles
41 |
42 | echo --- %arg1% ---
43 | cd %arg1%\premake
44 | call :createvsfiles %arg2%
45 |
46 | cd %startdir%
47 |
48 | goto :EOF
49 |
50 | ::--------------------------
51 | :: SUBROUTINES
52 | ::--------------------------
53 |
54 | :: run premake for passed-in action (e.g. vs2012, vs2013, vs2015)
55 | :createvsfiles
56 | ..\..\premake\premake5.exe %1
57 | goto :EOF
58 |
59 | :: run premake for passed-in action (e.g. vs2012, vs2013, vs2015)
60 | :: minimal-dependencies version
61 | :createvsfileswithminimaldependencies
62 | ..\..\premake\premake5.exe --file=premake5_minimal.lua %1
63 | goto :EOF
64 |
65 | :: delete unnecessary sln files
66 | :cleanslnfiles
67 | if exist amd_lib\build\nul del /f /q amd_lib\build\AMD_LIB_*.sln
68 | if exist amd_sdk\build\nul del /f /q amd_sdk\build\AMD_SDK_*.sln
69 | del /f /q dxut\Core\DXUT_*.sln
70 | del /f /q dxut\Optional\DXUTOpt_*.sln
71 | goto :EOF
72 |
73 | ::--------------------------
74 | :: usage should be last
75 | ::--------------------------
76 |
77 | :usage
78 | echo usage: %0 sample_dir_name premake_action
79 | echo or: %0 ..\sample_dir_name premake_action
80 | echo example: %0 forwardplus11 vs2012
81 | echo or: %0 ..\forwardplus11 vs2012
82 |
--------------------------------------------------------------------------------