├── .gitattributes
├── .gitignore
├── CHANGELOG.txt
├── LICENSE.txt
├── README.md
├── doc
├── LiquidVR.pdf
└── liquidvr-logo-black.png
├── inc
├── LiquidVR.h
└── LiquidVRVariant.h
└── samples
├── AffinityGPUControl
├── build
│ ├── AffinityGPUControl_2013.vcxproj
│ └── AffinityGPUControl_2013.vcxproj.filters
├── doc
│ └── AffinityGPUControl.pdf
├── inc
│ └── resource.h
├── media
│ ├── Froblin
│ │ ├── Froblin.sdkmesh
│ │ ├── Froblin_CO_01.dds
│ │ └── Froblin_NM.dds
│ ├── SoftParticles
│ │ ├── LICENSE
│ │ ├── TankScene.sdkmesh
│ │ ├── colorgradient.dds
│ │ ├── desert_sky.dds
│ │ ├── desertsky.sdkmesh
│ │ ├── ground_diff.dds
│ │ ├── ground_norm.dds
│ │ ├── left_engine_diff.dds
│ │ ├── left_engine_norm.dds
│ │ ├── smokevol1.dds
│ │ ├── turret_diff.dds
│ │ └── turret_norm.dds
│ └── UI
│ │ ├── Font.dds
│ │ └── dxutcontrols.dds
├── shaders
│ └── Source
│ │ ├── Color.hlsl
│ │ ├── Simple_PS.hlsl
│ │ ├── Simple_VS.hlsl
│ │ └── Utility.hlsl
└── src
│ ├── AffinityGPUControl.cpp
│ └── AffinityGPUControl.rc
├── LateLatch
├── build
│ ├── LateLatch.vcxproj
│ └── LateLatch.vcxproj.filters
├── doc
│ └── LateLatch.pdf
├── inc
│ ├── LateLatch.h
│ ├── LateLatchCharacter.h
│ ├── MouseInput.h
│ └── Resource.h
├── media
│ ├── Froblin
│ │ ├── Froblin.sdkmesh
│ │ ├── Froblin_CO_01.dds
│ │ └── Froblin_NM.dds
│ ├── SoftParticles
│ │ ├── LICENSE
│ │ ├── TankScene.sdkmesh
│ │ ├── colorgradient.dds
│ │ ├── desert_sky.dds
│ │ ├── desertsky.sdkmesh
│ │ ├── ground_diff.dds
│ │ ├── ground_norm.dds
│ │ ├── left_engine_diff.dds
│ │ ├── left_engine_norm.dds
│ │ ├── smokevol1.dds
│ │ ├── turret_diff.dds
│ │ └── turret_norm.dds
│ └── UI
│ │ ├── Font.dds
│ │ └── dxutcontrols.dds
├── shaders
│ └── Source
│ │ ├── Color.hlsl
│ │ ├── SimpleLateLatch_VS.hlsl
│ │ ├── Simple_PS.hlsl
│ │ ├── Simple_VS.hlsl
│ │ └── Utility.hlsl
└── src
│ ├── LateLatch.cpp
│ ├── LateLatch.rc
│ ├── LateLatchCharacter.cpp
│ └── MouseInput.cpp
├── LiquidVR_Samples_VS2013.sln
├── LiquidVR_Vulkan_Samples_VS2013.sln
├── MotionVectors
├── MotionVectors.cpp
├── build
│ ├── MotionVectors.vcxproj
│ └── MotionVectors.vcxproj.filters
└── convert_output_646x720.nv12.yuv
├── SimpleASyncCompute
├── SimpleASyncCompute.cpp
├── build
│ ├── SimpleASyncCompute.vcxproj
│ └── SimpleASyncCompute.vcxproj.filters
└── doc
│ └── SimpleAsyncCompute Sample.pdf
├── SimpleLateLatch
├── MouseInput.cpp
├── MouseInput.h
├── SimpleLateLatch.cpp
├── build
│ ├── SimpleLateLatch.vcxproj
│ └── SimpleLateLatch.vcxproj.filters
└── doc
│ └── SimpleLateLatch Sample.pdf
├── SimpleMGPU
├── SimpleMGPU.cpp
├── build
│ ├── SimpleMGPU.vcxproj
│ └── SimpleMGPU.vcxproj.filters
└── doc
│ └── SimpleMGPU Sample.pdf
├── SimpleVulkanAsync
├── GridShader.hlsl
├── SimpleVulkanAsync.cpp
├── SimpleVulkanAsync.h
├── build
│ ├── SimpleVulkanAsync.vcxproj
│ └── SimpleVulkanAsync.vcxproj.filters
├── compile.bat
├── cube1.frag
└── cube1.vert
├── SimpleVulkanInterop
├── SimpleVulkanInterop.cpp
├── VulkanRender.cpp
├── VulkanRender.h
├── build
│ ├── SimpleVulkanInterop.vcxproj
│ └── SimpleVulkanInterop.vcxproj.filters
├── compile.bat
├── cube.frag
└── cube.vert
├── amd_sdk
├── build
│ ├── AMD_SDK_2013.vcxproj
│ └── AMD_SDK_2013.vcxproj.filters
├── inc
│ ├── AMD_SDK.h
│ ├── Geometry.h
│ ├── HUD.h
│ ├── HelperFunctions.h
│ ├── LineRender.h
│ ├── Magnify.h
│ ├── MagnifyTool.h
│ ├── ShaderCache.h
│ ├── ShaderCacheSampleHelper.h
│ ├── Sprite.h
│ └── Timer.h
├── media
│ ├── AMD.dds
│ └── AMD.ico
├── shaders
│ ├── Line.hlsl
│ ├── SeparableFilter
│ │ ├── FilterCommon.hlsl
│ │ ├── FilterKernel.hlsl
│ │ ├── HorizontalFilter.hlsl
│ │ └── VerticalFilter.hlsl
│ └── Sprite.hlsl
└── src
│ ├── Geometry.cpp
│ ├── HUD.cpp
│ ├── HelperFunctions.cpp
│ ├── LineRender.cpp
│ ├── Magnify.cpp
│ ├── MagnifyTool.cpp
│ ├── ShaderCache.cpp
│ ├── ShaderCacheSampleHelper.cpp
│ ├── Sprite.cpp
│ └── Timer.cpp
├── common
├── inc
│ ├── ApplicationContext.h
│ ├── Background.h
│ ├── BarrelDistortionShader.h
│ ├── Character.h
│ ├── ClearView.h
│ ├── D3DHelper.h
│ ├── GridGeneratorShader.h
│ ├── ImageShader2D.h
│ ├── LvrLogger.h
│ └── MGPUAffinity.h
└── src
│ ├── ApplicationContext.cpp
│ ├── Background.cpp
│ ├── BarrelDistortionShader.cpp
│ ├── Character.cpp
│ ├── ClearView.cpp
│ ├── D3DHelper.cpp
│ ├── GridGeneratorShader.cpp
│ ├── ImageShader2D.cpp
│ ├── LvrLogger.cpp
│ └── MGPUAffinity.cpp
└── dxut
├── Core
├── DDSTextureLoader.cpp
├── DDSTextureLoader.h
├── DXUT.cpp
├── DXUT.h
├── DXUTDevice11.cpp
├── DXUTDevice11.h
├── DXUTmisc.cpp
├── DXUTmisc.h
├── ScreenGrab.cpp
├── ScreenGrab.h
├── WICTextureLoader.cpp
├── WICTextureLoader.h
├── build
│ ├── DXUT_2013.vcxproj
│ └── DXUT_2013.vcxproj.filters
├── dpiaware.manifest
├── dxerr.cpp
└── dxerr.h
├── Optional
├── DXUTLockFreePipe.h
├── 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
├── build
│ ├── DXUTOpt_2013.vcxproj
│ └── DXUTOpt_2013.vcxproj.filters
└── directx.ico
├── Windows81SDKVS12_x32.props
├── Windows81SDKVS12_x64.props
├── Windows81SDK_x32.props
├── Windows81SDK_x64.props
└── Windows8SDK_x64.props
/.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 |
--------------------------------------------------------------------------------
/.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 | [Oo]bj/
10 | [Ll]ib/
11 |
12 | # Visual Studo 2015 cache/options directory
13 | .vs/
14 |
15 | # Visual C++ cache files
16 | ipch/
17 | *.aps
18 | *.ncb
19 | *.opensdf
20 | *.sdf
21 | *.cachefile
22 | *.opendb
23 | *.VC.db
24 |
25 | # Visual Studio profiler
26 | *.psess
27 | *.vsp
28 | *.vspx
29 |
30 | # Installshield output folder
31 | [Ee]xpress/
32 |
33 | # Backup & report files from converting an old project file
34 | # to a newer Visual Studio version. Backup files are not needed,
35 | # because we have git ;-)
36 | _UpgradeReport_Files/
37 | Backup*/
38 | UpgradeLog*.XML
39 | UpgradeLog*.htm
40 |
41 | # Shader cache
42 | Cache/
43 | HashDigest.html
44 |
--------------------------------------------------------------------------------
/CHANGELOG.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 |
21 | Compatible Drivers:
22 | ===================
23 | 16.60
24 |
25 | Changes:
26 |
27 | build 1.0.10.0 November 29, 2016
28 | - Motion Estimator fiji support
29 |
30 | build 1.0.9.0 November 16, 2016
31 | - d2d change
32 |
33 | build 1.0.8.0 September 12, 2016
34 | - Vulkan/Motion Estimation changes
35 |
36 | build 1.0.7.0 August 23, 2016
37 | - added Vulkan interop support
38 | - added Motion Estimator
39 |
40 | build 1.0.6.0 July 12, 2016
41 | - d2d change
42 |
43 | build 1.0.5.0 July 29, 2016
44 | - transfer optimization in SimpleMGPU sample
45 |
46 | build 1.0.5.0 June 01, 2016
47 | - latest Shim changes for MGPU
48 |
49 | build 1.0.5.0 Apr 28, 2016
50 | - HDCP status API for D2D
51 | - Fixed D2D11 device / context shims for corner cases in MGPU scenario
52 |
53 | build 1.0.4.4 Mar 23, 2016
54 | - extern "C" around ALVRQueryVersion
55 | - HDCP on hidden displays,
56 | - fixed the conditon of error return in SignalSemaphoreOnVsync
57 | - async compute shader profiling
58 |
59 | build 1.0.4.3 Feb 16, 2016
60 | - SimpleD2D sample extended to use vsync events
61 |
62 | build 1.0.4.2 Feb 02, 2016
63 | - basic power management added
64 |
65 | build 1.0.3.20 Jan 18, 2016
66 | - initial version
67 |
--------------------------------------------------------------------------------
/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 | # LiquidVR™ SDK
2 |
3 |
4 | LiquidVR™ provides a Direct3D 11 based interface for applications to access the following GPU features: Async Compute, Multi-GPU Affinity, Late-Latch, and GPU-to-GPU Resource Copies[1](#liquidvr-footnote1),[2](#liquidvr-footnote2).
5 |
6 | * **Async Compute** : Provides in Direct3D 11 a subset of functionality similar to async-compute functionality in Direct3D 12.
7 | * **Multi-GPU Affinity** : Provides explicit multi-GPU control via ability to send Direct3D 11 API calls to one or more GPUs via an affinity mask.
8 | * **Late-Latch** : Provides ability to reduce input or tracking latency by reading constant data updated by the CPU after the original Direct3D 11 calls.
9 | * **GPU-to-GPU Resource Copies** : Provides ability to copy resources between GPUs with explicit control over synchronization.
10 |
11 | In Version 1.1 (driver 17.4.1 / 17.10.1061), we added support for:
12 | * Motion Estimation: Calculates the motion estimation generated from two surface frames. Motion estimation works on specific GPUs and can be used for ASW.
13 | * Vulkan Interoperability: Provides conversion for buffers, surfaces and semaphores.
14 |
15 | ### Installation
16 | The LiquidVR run-time is automatically installed by the current AMD drivers. All that is needed for usage in an application is the `LiquidVR.h` header file in the `inc` folder.
17 |
18 | ### Prerequisites
19 | * AMD Radeon™ GCN-based GPU (recommend R9 290 series or higher for VR)[3](#liquidvr-footnote3)
20 | * Windows® 7, Windows® 8.1, or Windows® 10
21 | * Radeon Software Crimson Edition drivers or later
22 | * Building the SDK samples requires Visual Studio® 2013
23 |
24 | ### Getting Started
25 | * A Visual Studio solution for the samples can be found in the `samples` directory.
26 | * Additional documentation can be found in the `doc` directory.
27 |
28 | ### Attribution
29 | * AMD, the AMD Arrow logo, Radeon, LiquidVR, and combinations thereof are either registered trademarks or trademarks of Advanced Micro Devices, Inc. in the United States and/or other countries.
30 | * Microsoft, Direct3D, DirectX, Visual Studio, and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.
31 |
32 | ### Notes
33 | 1: The LiquidVR features are available even if a VR device is not installed on a system.
34 |
35 | 2: LiquidVR also contains a Direct-to-Display (D2D) interface, but it is not application accessible because it is instead directly used by the head-mounted display (HMD) vendors.
36 |
37 | 3: All Radeon GPUs based on the Graphics Core Next (GCN) architecture support the current LiquidVR feature set. However, the recommended performance requirements for the best VR experience will vary between different HMD/content platforms. For details on recommended hardware for a particular HMD vendor, see the FAQ here: http://www.amd.com/liquidvr
38 |
--------------------------------------------------------------------------------
/doc/LiquidVR.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/doc/LiquidVR.pdf
--------------------------------------------------------------------------------
/doc/liquidvr-logo-black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/doc/liquidvr-logo-black.png
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/build/AffinityGPUControl_2013.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | common
10 |
11 |
12 | common
13 |
14 |
15 | common
16 |
17 |
18 | common
19 |
20 |
21 | common
22 |
23 |
24 |
25 |
26 | {c3a6eec2-b661-4c06-be48-7c4839b633a3}
27 |
28 |
29 | {6fbe4649-843c-4e5c-910c-11ace87ceec3}
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | Shaders
38 |
39 |
40 | Shaders
41 |
42 |
43 | Shaders
44 |
45 |
46 | Shaders
47 |
48 |
49 |
50 |
51 | common
52 |
53 |
54 | common
55 |
56 |
57 | common
58 |
59 |
60 | common
61 |
62 |
63 | common
64 |
65 |
66 |
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/doc/AffinityGPUControl.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/AffinityGPUControl/doc/AffinityGPUControl.pdf
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/inc/resource.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 | //{{NO_DEPENDENCIES}}
24 | // Microsoft Visual C++ generated include file.
25 | // Used by SimpleSample.rc
26 | //
27 | #define IDI_MAIN_ICON 101
28 |
29 | // Next default values for new objects
30 | //
31 | #ifdef APSTUDIO_INVOKED
32 | #ifndef APSTUDIO_READONLY_SYMBOLS
33 | #define _APS_NEXT_RESOURCE_VALUE 113
34 | #define _APS_NEXT_COMMAND_VALUE 40029
35 | #define _APS_NEXT_CONTROL_VALUE 1000
36 | #define _APS_NEXT_SYMED_VALUE 101
37 | #endif
38 | #endif
39 |
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/media/Froblin/Froblin.sdkmesh:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/AffinityGPUControl/media/Froblin/Froblin.sdkmesh
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/media/Froblin/Froblin_CO_01.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/AffinityGPUControl/media/Froblin/Froblin_CO_01.dds
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/media/Froblin/Froblin_NM.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/AffinityGPUControl/media/Froblin/Froblin_NM.dds
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/media/SoftParticles/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 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 |
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/media/SoftParticles/TankScene.sdkmesh:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/AffinityGPUControl/media/SoftParticles/TankScene.sdkmesh
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/media/SoftParticles/colorgradient.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/AffinityGPUControl/media/SoftParticles/colorgradient.dds
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/media/SoftParticles/desert_sky.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/AffinityGPUControl/media/SoftParticles/desert_sky.dds
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/media/SoftParticles/desertsky.sdkmesh:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/AffinityGPUControl/media/SoftParticles/desertsky.sdkmesh
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/media/SoftParticles/ground_diff.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/AffinityGPUControl/media/SoftParticles/ground_diff.dds
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/media/SoftParticles/ground_norm.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/AffinityGPUControl/media/SoftParticles/ground_norm.dds
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/media/SoftParticles/left_engine_diff.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/AffinityGPUControl/media/SoftParticles/left_engine_diff.dds
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/media/SoftParticles/left_engine_norm.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/AffinityGPUControl/media/SoftParticles/left_engine_norm.dds
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/media/SoftParticles/smokevol1.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/AffinityGPUControl/media/SoftParticles/smokevol1.dds
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/media/SoftParticles/turret_diff.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/AffinityGPUControl/media/SoftParticles/turret_diff.dds
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/media/SoftParticles/turret_norm.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/AffinityGPUControl/media/SoftParticles/turret_norm.dds
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/media/UI/Font.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/AffinityGPUControl/media/UI/Font.dds
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/media/UI/dxutcontrols.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/AffinityGPUControl/media/UI/dxutcontrols.dds
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/shaders/Source/Color.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 | // Globals
24 | //--------------------------------------------------------------------------------------
25 | cbuffer cbColor : register( b0 )
26 | {
27 | float4 g_vColor : packoffset( c0 );
28 | };
29 |
30 | //--------------------------------------------------------------------------------------
31 | // Input / Output structures
32 | //--------------------------------------------------------------------------------------
33 | struct VS_RenderQuadInput
34 | {
35 | float3 f3Position : POSITION;
36 | float2 f2TexCoord : TEXCOORD0;
37 | };
38 |
39 | struct PS_RenderQuadInput
40 | {
41 | float4 f4Position : SV_Position;
42 | float2 f2TexCoord : TEXCOORD0;
43 | };
44 |
45 | //--------------------------------------------------------------------------------------
46 | // Pixel Shader
47 | //--------------------------------------------------------------------------------------
48 | float4 PSColor(PS_RenderQuadInput Input) : SV_TARGET
49 | {
50 | return g_vColor;
51 | }
52 | //--------------------------------------------------------------------------------------
53 | // Vertex Shader
54 | //--------------------------------------------------------------------------------------
55 | PS_RenderQuadInput VSColor(VS_RenderQuadInput I)
56 | {
57 | PS_RenderQuadInput O;
58 |
59 | O.f4Position.x = I.f3Position.x;
60 | O.f4Position.y = I.f3Position.y;
61 | O.f4Position.z = I.f3Position.z;
62 | O.f4Position.w = 1.0f;
63 |
64 | O.f2TexCoord = I.f2TexCoord;
65 |
66 | return O;
67 | }
68 |
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/shaders/Source/Simple_PS.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 | // Globals
24 | //--------------------------------------------------------------------------------------
25 | cbuffer cbPerObject : register( b0 )
26 | {
27 | float4 g_vObjectColor : packoffset( c0 );
28 | };
29 |
30 | cbuffer cbPerFrame : register( b1 )
31 | {
32 | float3 g_vLightDir : packoffset( c0 );
33 | float g_fAmbient : packoffset( c0.w );
34 | };
35 |
36 | //--------------------------------------------------------------------------------------
37 | // Textures and Samplers
38 | //--------------------------------------------------------------------------------------
39 | Texture2D g_txDiffuse : register( t0 );
40 | SamplerState g_samLinear : register( s0 );
41 |
42 | //--------------------------------------------------------------------------------------
43 | // Input / Output structures
44 | //--------------------------------------------------------------------------------------
45 | struct PS_INPUT
46 | {
47 | float4 Pos : SV_POSITION;
48 | float4 Diffuse : COLOR0;
49 | float2 Tex : TEXCOORD1;
50 | };
51 | //--------------------------------------------------------------------------------------
52 | // Pixel Shader
53 | //--------------------------------------------------------------------------------------
54 | float4 PSMain( PS_INPUT Input ) : SV_TARGET
55 | {
56 | float4 outputColor = g_txDiffuse.Sample(g_samLinear, Input.Tex) * g_vObjectColor * Input.Diffuse;
57 | //float4 outputColor = g_txDiffuse.Sample(g_samLinear, Input.Tex) * Input.Diffuse;
58 | outputColor.w = 1;
59 | return outputColor;
60 | }
61 |
62 |
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/shaders/Source/Simple_VS.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 | //--------------------------------------------------------------------------------------
24 | // Globals
25 | //--------------------------------------------------------------------------------------
26 | cbuffer cbPerObject : register( b0 )
27 | {
28 | // matrix g_mViewProjection : packoffset( c0 );
29 | // matrix g_mWorld : packoffset( c4 );
30 | matrix g_mViewProjection ;
31 | matrix g_mWorld ;
32 | };
33 |
34 |
35 | cbuffer cbObjectPosition : register(b1)
36 | {
37 | matrix g_mPosition : packoffset(c0);
38 | };
39 |
40 | cbuffer cbStatic : register(b2)
41 | {
42 | float3 g_vLightDir : packoffset(c0);
43 | float g_fAmbient : packoffset(c0.w);
44 | };
45 |
46 | //--------------------------------------------------------------------------------------
47 | // Input / Output structures
48 | //--------------------------------------------------------------------------------------
49 | struct VS_INPUT
50 | {
51 | float3 Pos : POSITION; //position
52 | float3 Norm : NORMAL; //normal
53 | float2 Tex : TEXCOORD0; //texture coordinate
54 | };
55 |
56 | struct VS_OUTPUT
57 | {
58 | float4 Pos : SV_POSITION;
59 | float4 Diffuse : COLOR0;
60 | float2 Tex : TEXCOORD1;
61 | };
62 |
63 | //--------------------------------------------------------------------------------------
64 | // Vertex Shader
65 | //--------------------------------------------------------------------------------------
66 | VS_OUTPUT VSMain( VS_INPUT Input )
67 | {
68 | /*
69 | VS_OUTPUT Output;
70 |
71 | Output.vPosition = mul(Input.vPosition, mul(mul(g_mWorld, g_mPosition), g_mWorldViewProjection));
72 | Output.vNormal = mul(Input.vNormal, (float3x3)mul(g_mWorld, g_mPosition ));
73 | Output.vTexcoord = Input.vTexcoord;
74 |
75 | return Output;
76 | */
77 | // matrix world = g_mWorld;
78 | matrix world = mul(g_mWorld, g_mPosition);
79 | matrix worldViewProjection = mul(world, g_mViewProjection);
80 | VS_OUTPUT output = (VS_OUTPUT)0;
81 |
82 | float Puffiness = 0;
83 | Input.Pos += Input.Norm * Puffiness;
84 |
85 | output.Pos = mul(float4(Input.Pos, 1), worldViewProjection);
86 | float3 vNormalWorldSpace = normalize(mul(Input.Norm, (float3x3)world));
87 |
88 | float fLighting = saturate(dot(vNormalWorldSpace, g_vLightDir));
89 | fLighting = max(fLighting, g_fAmbient);
90 | output.Diffuse.rgb = fLighting;
91 | output.Diffuse.a = 1.0f;
92 |
93 | output.Tex = Input.Tex;
94 |
95 | return output;
96 |
97 | }
98 |
99 |
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/shaders/Source/Utility.hlsl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/AffinityGPUControl/shaders/Source/Utility.hlsl
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/src/AffinityGPUControl.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/AffinityGPUControl/src/AffinityGPUControl.cpp
--------------------------------------------------------------------------------
/samples/AffinityGPUControl/src/AffinityGPUControl.rc:
--------------------------------------------------------------------------------
1 | // Microsoft Visual C++ generated resource script.
2 | //
3 | #include "..\inc\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 |
--------------------------------------------------------------------------------
/samples/LateLatch/build/LateLatch.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | common
7 |
8 |
9 | common
10 |
11 |
12 | common
13 |
14 |
15 | common
16 |
17 |
18 | common
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | common
28 |
29 |
30 | common
31 |
32 |
33 | common
34 |
35 |
36 | common
37 |
38 |
39 | common
40 |
41 |
42 |
43 |
44 |
45 |
46 | Shaders
47 |
48 |
49 | Shaders
50 |
51 |
52 | Shaders
53 |
54 |
55 | Shaders
56 |
57 |
58 | Shaders
59 |
60 |
61 |
62 |
63 | {1e7c034c-1917-4ba5-95a7-0527e4126048}
64 |
65 |
66 | {c7e0d092-e2a1-45b4-adc8-8e6480e26b49}
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/samples/LateLatch/doc/LateLatch.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/LateLatch/doc/LateLatch.pdf
--------------------------------------------------------------------------------
/samples/LateLatch/inc/LateLatch.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 | #pragma once
24 |
25 | #include "resource.h"
26 |
--------------------------------------------------------------------------------
/samples/LateLatch/inc/LateLatchCharacter.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 | #pragma once
24 | #include "..\..\common\inc\Character.h"
25 |
26 | #include "../../../inc/LiquidVR.h"
27 |
28 | class LateLatchCharacter : public Character
29 | {
30 | public:
31 | LateLatchCharacter();
32 | virtual ~LateLatchCharacter();
33 |
34 | virtual HRESULT Terminate();
35 | virtual HRESULT Render(ID3D11DeviceContext* pd3dImmediateContext, float fbWidth, float fbHeight);
36 | virtual HRESULT SetPosition(float x, float y);
37 | void SetLateLatch(bool enable) { m_bLateLatch = enable; }
38 | bool GetLateLatch(){ return m_bLateLatch; }
39 | void SetLateLatchLeftEyeOnly(bool enable) { m_bLateLatchLeftEyeOnly = enable; }
40 | bool GetLateLatchLeftEyeOnly(){ return m_bLateLatchLeftEyeOnly; }
41 | UINT GetNumberOfLateLatchBuffers(){ return m_uiNumberOfLateLatchBuffers; }
42 | UINT GetUpdatesPerFrame(){ return m_iUpdatesPerFrame; }
43 |
44 |
45 | protected:
46 | virtual HRESULT AllocVShaderObjects(ID3D11Device* pd3dDevice, ID3D11DeviceContext* pd3dImmediateContext);
47 | virtual WCHAR* GetVShaderName();
48 | virtual HRESULT UpdateVShaderObjects(ID3D11DeviceContext* pd3dImmediateContext, XMMATRIX &worldViewProj, XMMATRIX &mWorld, GpuMask mask);
49 | virtual HRESULT SetupVS(ID3D11DeviceContext* pd3dImmediateContext, GpuMask mask);
50 |
51 | ALVRLateLatchConstantBufferD3D11 *m_pConstantBufferLeft;
52 | ALVRLateLatchConstantBufferD3D11 *m_pConstantBufferRight;
53 |
54 | static UINT m_iCBVSSIndexLatch;
55 | bool m_bLateLatch;
56 | bool m_bLateLatchLeftEyeOnly;
57 | static UINT m_uiNumberOfLateLatchBuffers;
58 | UINT m_iUpdatesPerFrame;
59 | };
--------------------------------------------------------------------------------
/samples/LateLatch/inc/MouseInput.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 | #pragma once
24 |
25 | #define DIRECTINPUT_VERSION 0x0800
26 | #include
27 |
28 |
29 | class MouseInputCallback
30 | {
31 | public:
32 | virtual void MouseEvent(LONG posX, LONG posY, bool bLeftDown, bool bRightDown) = 0;
33 | };
34 |
35 | class MouseInput
36 | {
37 | public:
38 | MouseInput();
39 | ~MouseInput();
40 |
41 | HRESULT Init(HINSTANCE hinst, HWND hWnd, MouseInputCallback *pCallback, UINT mouseEventsPerSecond);
42 | HRESULT Terminate();
43 | void SetEmulation(bool emulation){ m_bEmulation = emulation; }
44 | bool GetEmulation(){ return m_bEmulation; }
45 | protected:
46 | HRESULT InitDirectInput();
47 | HRESULT TryMouseUpdate(bool &bLeftDown);
48 | HRESULT TryMouseEmulate(bool &bLeftDown);
49 | static DWORD WINAPI ThreadProc(_In_ LPVOID lpParameter);
50 | DWORD ThreadRun();
51 |
52 | HWND m_hWnd;
53 | HINSTANCE m_hInstance;
54 | IDirectInput8W *m_pDirectInput8W;
55 | IDirectInputDevice8 *m_pMouseDevice;
56 | bool m_bMouseAcquired;
57 | HANDLE m_hWatchThread;
58 | volatile LONG m_lThreadStop;
59 | MouseInputCallback *m_pCallback;
60 | POINT m_LastMousePos;
61 | UINT m_uiMouseEventsPerSecond;
62 | bool m_bEmulation;
63 | float m_EmulateAngle;
64 | };
--------------------------------------------------------------------------------
/samples/LateLatch/inc/Resource.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 | //{{NO_DEPENDENCIES}}
24 | // Microsoft Visual C++ generated include file.
25 | // Used by DirectToDisplay.rc
26 | //
27 |
28 | #define IDS_APP_TITLE 103
29 |
30 | #define IDR_MAINFRAME 128
31 | #define IDD_DIRECTTODISPLAY_DIALOG 102
32 | #define IDD_ABOUTBOX 103
33 | #define IDM_ABOUT 104
34 | #define IDM_EXIT 105
35 | #define IDI_DIRECTTODISPLAY 107
36 | #define IDI_SMALL 108
37 | #define IDC_DIRECTTODISPLAY 109
38 | #define IDC_MYICON 2
39 | #ifndef IDC_STATIC
40 | #define IDC_STATIC -1
41 | #endif
42 | // Next default values for new objects
43 | //
44 | #ifdef APSTUDIO_INVOKED
45 | #ifndef APSTUDIO_READONLY_SYMBOLS
46 |
47 | #define _APS_NO_MFC 130
48 | #define _APS_NEXT_RESOURCE_VALUE 129
49 | #define _APS_NEXT_COMMAND_VALUE 32771
50 | #define _APS_NEXT_CONTROL_VALUE 1000
51 | #define _APS_NEXT_SYMED_VALUE 110
52 | #endif
53 | #endif
54 |
--------------------------------------------------------------------------------
/samples/LateLatch/media/Froblin/Froblin.sdkmesh:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/LateLatch/media/Froblin/Froblin.sdkmesh
--------------------------------------------------------------------------------
/samples/LateLatch/media/Froblin/Froblin_CO_01.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/LateLatch/media/Froblin/Froblin_CO_01.dds
--------------------------------------------------------------------------------
/samples/LateLatch/media/Froblin/Froblin_NM.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/LateLatch/media/Froblin/Froblin_NM.dds
--------------------------------------------------------------------------------
/samples/LateLatch/media/SoftParticles/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 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 |
--------------------------------------------------------------------------------
/samples/LateLatch/media/SoftParticles/TankScene.sdkmesh:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/LateLatch/media/SoftParticles/TankScene.sdkmesh
--------------------------------------------------------------------------------
/samples/LateLatch/media/SoftParticles/colorgradient.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/LateLatch/media/SoftParticles/colorgradient.dds
--------------------------------------------------------------------------------
/samples/LateLatch/media/SoftParticles/desert_sky.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/LateLatch/media/SoftParticles/desert_sky.dds
--------------------------------------------------------------------------------
/samples/LateLatch/media/SoftParticles/desertsky.sdkmesh:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/LateLatch/media/SoftParticles/desertsky.sdkmesh
--------------------------------------------------------------------------------
/samples/LateLatch/media/SoftParticles/ground_diff.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/LateLatch/media/SoftParticles/ground_diff.dds
--------------------------------------------------------------------------------
/samples/LateLatch/media/SoftParticles/ground_norm.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/LateLatch/media/SoftParticles/ground_norm.dds
--------------------------------------------------------------------------------
/samples/LateLatch/media/SoftParticles/left_engine_diff.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/LateLatch/media/SoftParticles/left_engine_diff.dds
--------------------------------------------------------------------------------
/samples/LateLatch/media/SoftParticles/left_engine_norm.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/LateLatch/media/SoftParticles/left_engine_norm.dds
--------------------------------------------------------------------------------
/samples/LateLatch/media/SoftParticles/smokevol1.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/LateLatch/media/SoftParticles/smokevol1.dds
--------------------------------------------------------------------------------
/samples/LateLatch/media/SoftParticles/turret_diff.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/LateLatch/media/SoftParticles/turret_diff.dds
--------------------------------------------------------------------------------
/samples/LateLatch/media/SoftParticles/turret_norm.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/LateLatch/media/SoftParticles/turret_norm.dds
--------------------------------------------------------------------------------
/samples/LateLatch/media/UI/Font.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/LateLatch/media/UI/Font.dds
--------------------------------------------------------------------------------
/samples/LateLatch/media/UI/dxutcontrols.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/LateLatch/media/UI/dxutcontrols.dds
--------------------------------------------------------------------------------
/samples/LateLatch/shaders/Source/Color.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 |
24 | //--------------------------------------------------------------------------------------
25 | // Globals
26 | //--------------------------------------------------------------------------------------
27 | cbuffer cbColor : register( b0 )
28 | {
29 | float4 g_vColor : packoffset( c0 );
30 | };
31 |
32 | //--------------------------------------------------------------------------------------
33 | // Input / Output structures
34 | //--------------------------------------------------------------------------------------
35 | struct VS_RenderQuadInput
36 | {
37 | float3 f3Position : POSITION;
38 | float2 f2TexCoord : TEXCOORD0;
39 | };
40 |
41 | struct PS_RenderQuadInput
42 | {
43 | float4 f4Position : SV_Position;
44 | float2 f2TexCoord : TEXCOORD0;
45 | };
46 |
47 | //--------------------------------------------------------------------------------------
48 | // Pixel Shader
49 | //--------------------------------------------------------------------------------------
50 | float4 PSColor(PS_RenderQuadInput Input) : SV_TARGET
51 | {
52 | return g_vColor;
53 | }
54 | //--------------------------------------------------------------------------------------
55 | // Vertex Shader
56 | //--------------------------------------------------------------------------------------
57 | PS_RenderQuadInput VSColor(VS_RenderQuadInput I)
58 | {
59 | PS_RenderQuadInput O;
60 |
61 | O.f4Position.x = I.f3Position.x;
62 | O.f4Position.y = I.f3Position.y;
63 | O.f4Position.z = I.f3Position.z;
64 | O.f4Position.w = 1.0f;
65 |
66 | O.f2TexCoord = I.f2TexCoord;
67 |
68 | return O;
69 | }
70 |
--------------------------------------------------------------------------------
/samples/LateLatch/shaders/Source/SimpleLateLatch_VS.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 | //--------------------------------------------------------------------------------------
24 | // Globals
25 | //--------------------------------------------------------------------------------------
26 |
27 | cbuffer cbPerObject : register( b0 )
28 | {
29 | struct World
30 | {
31 | matrix g_mViewProjection;
32 | matrix g_mWorld;
33 | } buffers[512]; // close to the limit
34 | };
35 |
36 | cbuffer cbObjectPosition : register(b1)
37 | {
38 | matrix g_mPosition : packoffset(c0);
39 | };
40 | cbuffer cbStatic : register(b2)
41 | {
42 | float3 g_vLightDir : packoffset(c0);
43 | float g_fAmbient : packoffset(c0.w);
44 | };
45 |
46 | cbuffer cbHeadPointer : register(b3)
47 | {
48 | unsigned int g_head;
49 | };
50 |
51 | //--------------------------------------------------------------------------------------
52 | // Input / Output structures
53 | //--------------------------------------------------------------------------------------
54 | struct VS_INPUT
55 | {
56 | float3 Pos : POSITION; //position
57 | float3 Norm : NORMAL; //normal
58 | float2 Tex : TEXCOORD0; //texture coordinate
59 | };
60 |
61 | struct VS_OUTPUT
62 | {
63 | float4 Pos : SV_POSITION;
64 | float4 Diffuse : COLOR0;
65 | float2 Tex : TEXCOORD1;
66 | };
67 |
68 | //--------------------------------------------------------------------------------------
69 | // Vertex Shader
70 | //--------------------------------------------------------------------------------------
71 | /*
72 | VS_OUTPUT VSMain( VS_INPUT Input )
73 | {
74 | VS_OUTPUT Output;
75 |
76 | World data = buffers[g_head];
77 | // World data = buffers[1];
78 |
79 | Output.vPosition = mul(Input.vPosition, mul(mul(data.g_mWorld, g_mPosition), data.g_mWorldViewProjection));
80 | Output.vNormal = mul(Input.vNormal, (float3x3)mul(data.g_mWorld, g_mPosition));
81 | Output.vTexcoord = Input.vTexcoord;
82 |
83 | return Output;
84 | }
85 | */
86 | VS_OUTPUT VSMain(VS_INPUT Input)
87 | {
88 | /*
89 | VS_OUTPUT Output;
90 |
91 | Output.vPosition = mul(Input.vPosition, mul(mul(g_mWorld, g_mPosition), g_mWorldViewProjection));
92 | Output.vNormal = mul(Input.vNormal, (float3x3)mul(g_mWorld, g_mPosition ));
93 | Output.vTexcoord = Input.vTexcoord;
94 |
95 | return Output;
96 | */
97 | World data = buffers[g_head];
98 | // World data = buffers[0];
99 | matrix world = mul(data.g_mWorld, g_mPosition);
100 | matrix worldViewProjection = mul(world, data.g_mViewProjection);
101 | VS_OUTPUT output = (VS_OUTPUT)0;
102 |
103 | float Puffiness = 0;
104 | Input.Pos += Input.Norm * Puffiness;
105 |
106 | output.Pos = mul(float4(Input.Pos, 1), worldViewProjection);
107 | float3 vNormalWorldSpace = normalize(mul(Input.Norm, (float3x3)world));
108 |
109 | float fLighting = saturate(dot(vNormalWorldSpace, g_vLightDir));
110 | fLighting = max(fLighting, g_fAmbient);
111 | output.Diffuse.rgb = fLighting;
112 | output.Diffuse.a = 1.0f;
113 |
114 | output.Tex = Input.Tex;
115 |
116 | return output;
117 |
118 | }
119 |
120 |
--------------------------------------------------------------------------------
/samples/LateLatch/shaders/Source/Simple_PS.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 | //--------------------------------------------------------------------------------------
24 | // Globals
25 | //--------------------------------------------------------------------------------------
26 | cbuffer cbPerObject : register(b0)
27 | {
28 | float4 g_vObjectColor : packoffset(c0);
29 | };
30 |
31 | cbuffer cbPerFrame : register(b1)
32 | {
33 | float3 g_vLightDir : packoffset(c0);
34 | float g_fAmbient : packoffset(c0.w);
35 | };
36 |
37 | //--------------------------------------------------------------------------------------
38 | // Textures and Samplers
39 | //--------------------------------------------------------------------------------------
40 | Texture2D g_txDiffuse : register(t0);
41 | SamplerState g_samLinear : register(s0);
42 |
43 | //--------------------------------------------------------------------------------------
44 | // Input / Output structures
45 | //--------------------------------------------------------------------------------------
46 | struct PS_INPUT
47 | {
48 | float4 Pos : SV_POSITION;
49 | float4 Diffuse : COLOR0;
50 | float2 Tex : TEXCOORD1;
51 | };
52 | //--------------------------------------------------------------------------------------
53 | // Pixel Shader
54 | //--------------------------------------------------------------------------------------
55 | float4 PSMain(PS_INPUT Input) : SV_TARGET
56 | {
57 | // float4 outputColor = g_txDiffuse.Sample(g_samLinear, Input.Tex) * Input.Diffuse;
58 | float4 outputColor = g_txDiffuse.Sample(g_samLinear, Input.Tex) * g_vObjectColor * Input.Diffuse;
59 | outputColor.w = 1;
60 | return outputColor;
61 | }
62 |
63 |
--------------------------------------------------------------------------------
/samples/LateLatch/shaders/Source/Simple_VS.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 | //--------------------------------------------------------------------------------------
24 | // Globals
25 | //--------------------------------------------------------------------------------------
26 | cbuffer cbPerObject : register( b0 )
27 | {
28 | matrix g_mViewProjection : packoffset( c0 );
29 | matrix g_mWorld : packoffset( c4 );
30 | };
31 |
32 |
33 | cbuffer cbObjectPosition : register(b1)
34 | {
35 | matrix g_mPosition : packoffset(c0);
36 | };
37 |
38 | cbuffer cbStatic : register(b2)
39 | {
40 | float3 g_vLightDir : packoffset(c0);
41 | float g_fAmbient : packoffset(c0.w);
42 | };
43 |
44 | //--------------------------------------------------------------------------------------
45 | // Input / Output structures
46 | //--------------------------------------------------------------------------------------
47 | struct VS_INPUT
48 | {
49 | float3 Pos : POSITION; //position
50 | float3 Norm : NORMAL; //normal
51 | float2 Tex : TEXCOORD0; //texture coordinate
52 | };
53 |
54 | struct VS_OUTPUT
55 | {
56 | float4 Pos : SV_POSITION;
57 | float4 Diffuse : COLOR0;
58 | float2 Tex : TEXCOORD1;
59 | };
60 |
61 | //--------------------------------------------------------------------------------------
62 | // Vertex Shader
63 | //--------------------------------------------------------------------------------------
64 | VS_OUTPUT VSMain( VS_INPUT Input )
65 | {
66 | /*
67 | VS_OUTPUT Output;
68 |
69 | Output.vPosition = mul(Input.vPosition, mul(mul(g_mWorld, g_mPosition), g_mWorldViewProjection));
70 | Output.vNormal = mul(Input.vNormal, (float3x3)mul(g_mWorld, g_mPosition ));
71 | Output.vTexcoord = Input.vTexcoord;
72 |
73 | return Output;
74 | */
75 | // matrix world = g_mWorld;
76 | matrix world = mul(g_mWorld, g_mPosition);
77 | matrix worldViewProjection = mul(world, g_mViewProjection);
78 | VS_OUTPUT output = (VS_OUTPUT)0;
79 |
80 | float Puffiness = 0;
81 | Input.Pos += Input.Norm * Puffiness;
82 |
83 | output.Pos = mul(float4(Input.Pos, 1), worldViewProjection);
84 | float3 vNormalWorldSpace = normalize(mul(Input.Norm, (float3x3)world));
85 |
86 | float fLighting = saturate(dot(vNormalWorldSpace, g_vLightDir));
87 | fLighting = max(fLighting, g_fAmbient);
88 | output.Diffuse.rgb = fLighting;
89 | output.Diffuse.a = 1.0f;
90 |
91 | output.Tex = Input.Tex;
92 |
93 | return output;
94 |
95 | }
96 |
97 |
--------------------------------------------------------------------------------
/samples/LateLatch/shaders/Source/Utility.hlsl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/LateLatch/shaders/Source/Utility.hlsl
--------------------------------------------------------------------------------
/samples/LateLatch/src/LateLatch.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/LateLatch/src/LateLatch.cpp
--------------------------------------------------------------------------------
/samples/LateLatch/src/LateLatch.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/LateLatch/src/LateLatch.rc
--------------------------------------------------------------------------------
/samples/LateLatch/src/LateLatchCharacter.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 | #include "..\inc\LateLatchCharacter.h"
24 | #include "AMD_SDK.h"
25 |
26 | // must match the same in shader code
27 | UINT LateLatchCharacter::m_uiNumberOfLateLatchBuffers = 512; // close to the limit
28 |
29 | UINT LateLatchCharacter::m_iCBVSSIndexLatch = 2;
30 |
31 | //-------------------------------------------------------------------------------------------------
32 | LateLatchCharacter::LateLatchCharacter() :
33 | m_pConstantBufferLeft(NULL),
34 | m_pConstantBufferRight(NULL),
35 | m_bLateLatch(true),
36 | m_iUpdatesPerFrame(0),
37 | m_bLateLatchLeftEyeOnly(true)
38 | {
39 | #ifdef _DEBUG
40 | m_iMaxDraws = 10000; // add more
41 | m_iTodoDraws = 10000;
42 | #else
43 | m_iMaxDraws = 70000; // add more
44 | m_iTodoDraws = 70000;
45 | #endif
46 | m_bShift = false;
47 | m_bRotate = false;
48 | }
49 | //-------------------------------------------------------------------------------------------------
50 | LateLatchCharacter::~LateLatchCharacter()
51 | {
52 |
53 | }
54 | //-------------------------------------------------------------------------------------------------
55 | WCHAR* LateLatchCharacter::GetVShaderName()
56 | {
57 | return L"Shaders\\Source\\SimpleLateLatch_VS.hlsl";
58 | }
59 | //-------------------------------------------------------------------------------------------------
60 | HRESULT LateLatchCharacter::Terminate()
61 | {
62 | if (m_pConstantBufferLeft)
63 | {
64 | m_pConstantBufferLeft->Release();
65 | }
66 | if (m_pConstantBufferRight)
67 | {
68 | m_pConstantBufferRight->Release();
69 | }
70 | return Character::Terminate();
71 | }
72 | //-------------------------------------------------------------------------------------------------
73 | HRESULT LateLatchCharacter::AllocVShaderObjects(ID3D11Device* pd3dDevice, ID3D11DeviceContext* pd3dImmediateContext)
74 | {
75 | HRESULT hr = S_OK;
76 | ALVR_RESULT res = ALVR_OK;
77 | res = m_pContext->m_pLiquidVrDevice->CreateLateLatchConstantBufferD3D11(sizeof(CB_VS_PER_OBJECT), m_uiNumberOfLateLatchBuffers, 0, &m_pConstantBufferLeft);
78 | V_RETURN(hr = res == ALVR_OK ? S_OK : E_FAIL);
79 | res = m_pContext->m_pLiquidVrDevice->CreateLateLatchConstantBufferD3D11(sizeof(CB_VS_PER_OBJECT), m_uiNumberOfLateLatchBuffers, 0, &m_pConstantBufferRight);
80 | V_RETURN(hr = res == ALVR_OK ? S_OK : E_FAIL);
81 | return S_OK;
82 | }
83 | //-------------------------------------------------------------------------------------------------
84 | HRESULT LateLatchCharacter::UpdateVShaderObjects(ID3D11DeviceContext* pd3dImmediateContext, XMMATRIX &viewProj, XMMATRIX &mWorld, GpuMask mask)
85 | {
86 | ALVRLateLatchConstantBufferD3D11 *pConstantBuffer = mask != GPUMASK_RIGHT ? m_pConstantBufferLeft : m_pConstantBufferRight;
87 | CB_VS_PER_OBJECT VSPerObject;
88 | XMStoreFloat4x4(&VSPerObject.m_ViewProj, viewProj);
89 | XMStoreFloat4x4(&VSPerObject.m_World, mWorld);
90 | return pConstantBuffer->Update((uint8_t*)&VSPerObject, 0, sizeof(VSPerObject));
91 | }
92 | //-------------------------------------------------------------------------------------------------
93 | HRESULT LateLatchCharacter::Render(ID3D11DeviceContext* pd3dImmediateContext, float fbWidth, float fbHeight)
94 | {
95 | m_iUpdatesPerFrame = 0;
96 | GpuMask mask = m_pContext->m_Affinity.GetCurrentMask();
97 | m_pContext->m_Affinity.SetRenderGpuMask(GPUMASK_LEFT);
98 | m_pConstantBufferLeft->QueueLatch();
99 | m_pContext->m_Affinity.SetRenderGpuMask(GPUMASK_RIGHT);
100 | m_pConstantBufferRight->QueueLatch();
101 | m_pContext->m_Affinity.SetRenderGpuMask(mask);
102 | return Character::Render(pd3dImmediateContext, fbWidth, fbHeight);
103 | }
104 | //-------------------------------------------------------------------------------------------------
105 | HRESULT LateLatchCharacter::SetPosition(float x, float y)
106 | {
107 | if (m_fPosX == x && m_fPosY == y)
108 | {
109 | return S_OK;
110 | }
111 | Character::SetPosition(x, y);
112 |
113 | if (m_bLateLatch)
114 | {
115 | bool bPortrait = m_pContext->m_fbHeight > m_pContext->m_fbWidth;
116 |
117 | // this is called from a thread - pd3dImmediateContext is NULL - not needed for late Latching;
118 | SetupEye(NULL, GPUMASK_LEFT, bPortrait);
119 | if (!m_bLateLatchLeftEyeOnly)
120 | {
121 | SetupEye(NULL, GPUMASK_RIGHT, bPortrait);
122 | }
123 | m_iUpdatesPerFrame++;
124 | }
125 | return S_OK;
126 | }
127 | //-------------------------------------------------------------------------------------------------
128 | HRESULT LateLatchCharacter::SetupVS(ID3D11DeviceContext* pd3dImmediateContext, GpuMask mask)
129 | {
130 | ALVRLateLatchConstantBufferD3D11 *pConstantBuffer = mask != GPUMASK_RIGHT ? m_pConstantBufferLeft : m_pConstantBufferRight;
131 | ID3D11Buffer* pcbVSPerObject = pConstantBuffer->GetDataD3D11();
132 | ID3D11Buffer* pcbVSIndex = pConstantBuffer->GetIndexD3D11();
133 | pd3dImmediateContext->VSSetConstantBuffers(0, 1, &pcbVSPerObject);
134 | pd3dImmediateContext->VSSetConstantBuffers(2, 1, &m_pcbPSPerFrame);
135 | pd3dImmediateContext->VSSetConstantBuffers(3, 1, &pcbVSIndex);
136 | return S_OK;
137 | }
138 | //-------------------------------------------------------------------------------------------------
139 | //-------------------------------------------------------------------------------------------------
140 |
--------------------------------------------------------------------------------
/samples/LiquidVR_Vulkan_Samples_VS2013.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.31101.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SimpleVulkanInterop", "SimpleVulkanInterop\build\SimpleVulkanInterop.vcxproj", "{30F8E950-3BE7-4339-A1C8-D9BEE9DC67E6}"
7 | EndProject
8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SimpleVulkanAsync", "SimpleVulkanAsync\build\SimpleVulkanAsync.vcxproj", "{40C6AA95-F6D5-4C2D-B56E-A73878ABEA4F}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Win32 = Debug|Win32
13 | Debug|x64 = Debug|x64
14 | Release|Win32 = Release|Win32
15 | Release|x64 = Release|x64
16 | EndGlobalSection
17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
18 | {30F8E950-3BE7-4339-A1C8-D9BEE9DC67E6}.Debug|Win32.ActiveCfg = Debug|Win32
19 | {30F8E950-3BE7-4339-A1C8-D9BEE9DC67E6}.Debug|Win32.Build.0 = Debug|Win32
20 | {30F8E950-3BE7-4339-A1C8-D9BEE9DC67E6}.Debug|x64.ActiveCfg = Debug|x64
21 | {30F8E950-3BE7-4339-A1C8-D9BEE9DC67E6}.Debug|x64.Build.0 = Debug|x64
22 | {30F8E950-3BE7-4339-A1C8-D9BEE9DC67E6}.Release|Win32.ActiveCfg = Release|Win32
23 | {30F8E950-3BE7-4339-A1C8-D9BEE9DC67E6}.Release|Win32.Build.0 = Release|Win32
24 | {30F8E950-3BE7-4339-A1C8-D9BEE9DC67E6}.Release|x64.ActiveCfg = Release|x64
25 | {30F8E950-3BE7-4339-A1C8-D9BEE9DC67E6}.Release|x64.Build.0 = Release|x64
26 | {40C6AA95-F6D5-4C2D-B56E-A73878ABEA4F}.Debug|Win32.ActiveCfg = Debug|Win32
27 | {40C6AA95-F6D5-4C2D-B56E-A73878ABEA4F}.Debug|Win32.Build.0 = Debug|Win32
28 | {40C6AA95-F6D5-4C2D-B56E-A73878ABEA4F}.Debug|x64.ActiveCfg = Debug|x64
29 | {40C6AA95-F6D5-4C2D-B56E-A73878ABEA4F}.Debug|x64.Build.0 = Debug|x64
30 | {40C6AA95-F6D5-4C2D-B56E-A73878ABEA4F}.Release|Win32.ActiveCfg = Release|Win32
31 | {40C6AA95-F6D5-4C2D-B56E-A73878ABEA4F}.Release|Win32.Build.0 = Release|Win32
32 | {40C6AA95-F6D5-4C2D-B56E-A73878ABEA4F}.Release|x64.ActiveCfg = Release|x64
33 | {40C6AA95-F6D5-4C2D-B56E-A73878ABEA4F}.Release|x64.Build.0 = Release|x64
34 | EndGlobalSection
35 | GlobalSection(SolutionProperties) = preSolution
36 | HideSolutionNode = FALSE
37 | EndGlobalSection
38 | EndGlobal
39 |
--------------------------------------------------------------------------------
/samples/MotionVectors/build/MotionVectors.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 | Source Files
23 |
24 |
25 | Source Files
26 |
27 |
28 |
29 |
30 | Header Files
31 |
32 |
33 | Header Files
34 |
35 |
36 |
--------------------------------------------------------------------------------
/samples/MotionVectors/convert_output_646x720.nv12.yuv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/MotionVectors/convert_output_646x720.nv12.yuv
--------------------------------------------------------------------------------
/samples/SimpleASyncCompute/build/SimpleASyncCompute.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 | Source Files
23 |
24 |
25 | Source Files
26 |
27 |
28 |
29 |
30 | Header Files
31 |
32 |
33 | Header Files
34 |
35 |
36 |
--------------------------------------------------------------------------------
/samples/SimpleASyncCompute/doc/SimpleAsyncCompute Sample.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/SimpleASyncCompute/doc/SimpleAsyncCompute Sample.pdf
--------------------------------------------------------------------------------
/samples/SimpleLateLatch/MouseInput.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 | #pragma once
24 |
25 | #include "../common/inc/LvrLogger.h"
26 |
27 | #define DIRECTINPUT_VERSION 0x0800
28 | #include
29 | #include
30 |
31 |
32 | class MouseInputCallback
33 | {
34 | public:
35 | virtual void MouseEvent(LONG posX, LONG posY, bool bLeftDown, bool bRightDown) = 0;
36 | };
37 |
38 | class MouseInput
39 | {
40 | public:
41 | MouseInput();
42 | ~MouseInput();
43 |
44 | ALVR_RESULT Init(HINSTANCE hinst, HWND hWnd, MouseInputCallback *pCallback, UINT mouseEventsPerSecond);
45 | ALVR_RESULT Terminate();
46 | void SetEmulation(bool emulation){ m_bEmulation = emulation; }
47 | bool GetEmulation(){ return m_bEmulation; }
48 | protected:
49 | ALVR_RESULT InitDirectInput();
50 | ALVR_RESULT TryMouseUpdate(bool &bLeftDown);
51 | ALVR_RESULT TryMouseEmulate(bool &bLeftDown);
52 | static DWORD WINAPI ThreadProc(_In_ LPVOID lpParameter);
53 | DWORD ThreadRun();
54 |
55 | HWND m_hWnd;
56 | HINSTANCE m_hInstance;
57 | CComPtr m_pDirectInput8W;
58 | CComPtr m_pMouseDevice;
59 | bool m_bMouseAcquired;
60 | HANDLE m_hWatchThread;
61 | volatile LONG m_lThreadStop;
62 | MouseInputCallback* m_pCallback;
63 | POINT m_LastMousePos;
64 | UINT m_uiMouseEventsPerSecond;
65 | bool m_bEmulation;
66 | float m_EmulatePosition;
67 | };
--------------------------------------------------------------------------------
/samples/SimpleLateLatch/build/SimpleLateLatch.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Header Files
20 |
21 |
22 | Header Files
23 |
24 |
25 | Header Files
26 |
27 |
28 |
29 |
30 | Source Files
31 |
32 |
33 | Source Files
34 |
35 |
36 | Source Files
37 |
38 |
39 | Source Files
40 |
41 |
42 |
--------------------------------------------------------------------------------
/samples/SimpleLateLatch/doc/SimpleLateLatch Sample.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/SimpleLateLatch/doc/SimpleLateLatch Sample.pdf
--------------------------------------------------------------------------------
/samples/SimpleMGPU/build/SimpleMGPU.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Header Files
20 |
21 |
22 | Header Files
23 |
24 |
25 |
26 |
27 | Source Files
28 |
29 |
30 | Source Files
31 |
32 |
33 | Source Files
34 |
35 |
36 |
--------------------------------------------------------------------------------
/samples/SimpleMGPU/doc/SimpleMGPU Sample.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/SimpleMGPU/doc/SimpleMGPU Sample.pdf
--------------------------------------------------------------------------------
/samples/SimpleVulkanAsync/GridShader.hlsl:
--------------------------------------------------------------------------------
1 | RWTexture2D outImage : register(u0);
2 |
3 | cbuffer Parameters : register(b0)
4 | {
5 | uint width;
6 | uint height;
7 | uint gridWidth;
8 | uint lineWidth;
9 | float4 colorBg;
10 | float4 colorFg;
11 | };
12 |
13 | // The number of threads to be executed in a single thread group when a compute shader is dispatched
14 | [numthreads(8, 8, 1)]
15 | void main(uint3 coord : SV_DispatchThreadID)
16 | {
17 |
18 | if((coord.x < width) && (coord.y < height))
19 | {
20 | float4 colorOut = colorBg;
21 | uint x = coord.x % gridWidth;
22 | uint y = coord.y % gridWidth;
23 |
24 | if (x < lineWidth || y < lineWidth)
25 | {
26 | colorOut = colorFg;
27 | }
28 | outImage[coord.xy] = colorOut;
29 | }
30 | }
--------------------------------------------------------------------------------
/samples/SimpleVulkanAsync/build/SimpleVulkanAsync.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 | Source Files
23 |
24 |
25 |
26 |
27 | Header Files
28 |
29 |
30 | Header Files
31 |
32 |
33 |
34 |
35 | Resource Files
36 |
37 |
38 | Resource Files
39 |
40 |
41 |
42 |
43 | Resource Files
44 |
45 |
46 |
--------------------------------------------------------------------------------
/samples/SimpleVulkanAsync/compile.bat:
--------------------------------------------------------------------------------
1 | echo %1
2 | echo %2
3 | %VK_SDK_PATH%/Bin32/glslangValidator.exe -V %1/cube1.vert -o %2/vert1.spv
4 | %VK_SDK_PATH%/Bin32/glslangValidator.exe -V %1/cube1.frag -o %2/frag1.spv
5 | pause
--------------------------------------------------------------------------------
/samples/SimpleVulkanAsync/cube1.frag:
--------------------------------------------------------------------------------
1 | #version 450
2 | #extension GL_ARB_separate_shader_objects : enable
3 |
4 | layout(binding = 1) uniform sampler2D samplerTex;
5 |
6 | layout(location = 0) in vec2 fragTex;
7 |
8 | layout(location = 0) out vec4 outColor;
9 |
10 | void main() {
11 | outColor = texture(samplerTex,fragTex);
12 | }
--------------------------------------------------------------------------------
/samples/SimpleVulkanAsync/cube1.vert:
--------------------------------------------------------------------------------
1 | #version 450
2 | #extension GL_ARB_separate_shader_objects : enable
3 |
4 | layout(binding = 0) uniform mvpMat{
5 | mat4 model;
6 | mat4 view;
7 | mat4 proj;
8 | } mvp;
9 |
10 | out gl_PerVertex{
11 | vec4 gl_Position;
12 | };
13 |
14 | layout(location = 0) in vec3 inPosition;
15 | layout(location = 1) in vec2 incolor;
16 |
17 | layout(location = 0) out vec2 fragTex;
18 |
19 | void main() {
20 | gl_Position = mvp.proj * mvp.view * mvp.model * vec4(inPosition,1.0);
21 |
22 | fragTex = incolor;
23 | }
24 |
25 | //mvp.proj * mvp.view * mvp.model
--------------------------------------------------------------------------------
/samples/SimpleVulkanInterop/build/SimpleVulkanInterop.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Header Files
20 |
21 |
22 | Header Files
23 |
24 |
25 | Header Files
26 |
27 |
28 |
29 |
30 | Source Files
31 |
32 |
33 | Source Files
34 |
35 |
36 | Source Files
37 |
38 |
39 | Source Files
40 |
41 |
42 |
--------------------------------------------------------------------------------
/samples/SimpleVulkanInterop/compile.bat:
--------------------------------------------------------------------------------
1 | echo %1
2 | echo %2
3 | %VK_SDK_PATH%/Bin32/glslangValidator.exe -V %1/cube.vert -o %2/vert.spv
4 | %VK_SDK_PATH%/Bin32/glslangValidator.exe -V %1/cube.frag -o %2/frag.spv
5 | pause
--------------------------------------------------------------------------------
/samples/SimpleVulkanInterop/cube.frag:
--------------------------------------------------------------------------------
1 | #version 450
2 | #extension GL_ARB_separate_shader_objects : enable
3 |
4 | layout(location = 0) in vec3 fragColor;
5 |
6 | layout(location = 0) out vec4 outColor;
7 |
8 | void main() {
9 | outColor = vec4(fragColor,1.0);
10 | }
--------------------------------------------------------------------------------
/samples/SimpleVulkanInterop/cube.vert:
--------------------------------------------------------------------------------
1 | #version 450
2 | #extension GL_ARB_separate_shader_objects : enable
3 |
4 | layout(binding = 0) uniform mvpMat{
5 | mat4 model;
6 | mat4 view;
7 | mat4 proj;
8 | } mvp;
9 |
10 | out gl_PerVertex{
11 | vec4 gl_Position;
12 | };
13 |
14 | layout(location = 0) in vec3 inPosition;
15 | layout(location = 1) in vec2 incolor;
16 |
17 | layout(location = 0) out vec3 fragColor;
18 |
19 | void main() {
20 | gl_Position = mvp.proj * mvp.view * mvp.model * vec4(inPosition,1.0);
21 |
22 | fragColor = vec3(incolor,0);
23 | }
24 |
25 | //mvp.proj * mvp.view * mvp.model
--------------------------------------------------------------------------------
/samples/amd_sdk/build/AMD_SDK_2013.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | Shaders
31 |
32 |
33 | Shaders
34 |
35 |
36 | Shaders
37 |
38 |
39 | Shaders
40 |
41 |
42 | Shaders
43 |
44 |
45 | Shaders
46 |
47 |
48 |
49 |
50 | {cf291593-9591-49e8-a273-1b43b1d68e11}
51 |
52 |
53 |
--------------------------------------------------------------------------------
/samples/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 |
32 | #define VENDOR_ID_AMD (0x1002)
33 | #define VENDOR_ID_NVIDIA (0x10DE)
34 | #define VENDOR_ID_INTEL (0x8086)
35 |
36 |
37 | #include "..\\..\\DXUT\\Core\\DXUT.h"
38 | #include "..\\..\\DXUT\\Core\\DXUTmisc.h"
39 | #include "..\\..\\DXUT\\Optional\\DXUTgui.h"
40 | #include "..\\..\\DXUT\\Optional\\SDKmisc.h"
41 | #include "..\\..\\DXUT\\Optional\\SDKMesh.h"
42 |
43 |
44 | // AMD helper classes and functions
45 | #include "Timer.h"
46 | #include "ShaderCache.h"
47 | #include "HelperFunctions.h"
48 | #include "Sprite.h"
49 | #include "Magnify.h"
50 | #include "MagnifyTool.h"
51 | #include "HUD.h"
52 | #include "Geometry.h"
53 | #include "LineRender.h"
54 |
55 |
56 | // Profile helpers for timing and marking up as D3D perf blocks
57 | #define AMD_PROFILE_RED D3DCOLOR_XRGB( 255, 0, 0 )
58 | #define AMD_PROFILE_GREEN D3DCOLOR_XRGB( 0, 255, 0 )
59 | #define AMD_PROFILE_BLUE D3DCOLOR_XRGB( 0, 0, 255 )
60 |
61 |
62 | #define AMDProfileBegin( col, name ) DXUT_BeginPerfEvent( col, name ); TIMER_Begin( col, name )
63 | #define AMDProfileEnd() TIMER_End() DXUT_EndPerfEvent();
64 |
65 | struct AMDProfileEventClass
66 | {
67 | AMDProfileEventClass( unsigned int col, LPCWSTR name ) { AMDProfileBegin( col, name ); }
68 | ~AMDProfileEventClass() { AMDProfileEnd() }
69 | };
70 |
71 | #define AMDProfileEvent( col, name ) AMDProfileEventClass __amd_profile_event( col, name )
72 |
73 |
74 |
75 | #endif
76 |
77 | //--------------------------------------------------------------------------------------
78 | // EOF
79 | //--------------------------------------------------------------------------------------
80 |
81 |
--------------------------------------------------------------------------------
/samples/amd_sdk/inc/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_GEOMETRY_H__
29 | #define __AMD_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 |
38 |
--------------------------------------------------------------------------------
/samples/amd_sdk/inc/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 |
29 | #pragma once
30 |
31 | namespace AMD
32 | {
33 |
34 | class HUD
35 | {
36 | public:
37 |
38 | // AMD standard HUD defines for GUI spacing
39 | static const int iElementDelta = 25;
40 | static const int iGroupDelta = ( iElementDelta * 2 );
41 | static const int iDialogWidth = 250;
42 | static const int iElementHeight = 24;
43 | static const int iElementWidth = 170;
44 | static const int iElementOffset = ( iDialogWidth - iElementWidth ) / 2;
45 | static const int iElementDropHeight = 35;
46 |
47 | // Public access to the CDXUTDialog is allowed for ease of use in the sample
48 | CDXUTDialog m_GUI;
49 |
50 | // Constructor / destructor
51 | HUD();
52 | ~HUD();
53 |
54 | // Various hook functions
55 | HRESULT OnCreateDevice( ID3D11Device* pd3dDevice );
56 | void OnDestroyDevice();
57 | void OnResizedSwapChain( const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc );
58 | void OnRender( float fElapsedTime );
59 |
60 | private:
61 |
62 | // The private AMD logo texture, and sprite object
63 | Sprite m_Sprite;
64 | ID3D11ShaderResourceView* m_pLogoSRV;
65 | };
66 |
67 |
68 | class Slider : public CDXUTControl
69 | {
70 | public:
71 |
72 | Slider( CDXUTDialog& dialog, int id, int& y, const wchar_t* label, int min, int max, int& value );
73 | virtual ~Slider() {}
74 |
75 | void OnGuiEvent();
76 | void SetEnabled( bool enable );
77 | void SetVisible( bool visible );
78 | void SetValue( int value );
79 |
80 | private:
81 |
82 | Slider& operator=( const Slider& );
83 |
84 | int& m_Value;
85 | const wchar_t* m_szLabel;
86 | CDXUTSlider* m_pSlider;
87 | CDXUTStatic* m_pLabel;
88 | };
89 |
90 |
91 |
92 | } // namespace AMD
93 |
94 | //--------------------------------------------------------------------------------------
95 | // EOF
96 | //--------------------------------------------------------------------------------------
97 |
--------------------------------------------------------------------------------
/samples/amd_sdk/inc/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_LINE_RENDER_H__
29 | #define __AMD_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 |
84 |
--------------------------------------------------------------------------------
/samples/amd_sdk/inc/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, and renders a scaled
27 | // sprite at the given position on the screen.
28 | //--------------------------------------------------------------------------------------
29 |
30 |
31 | #ifndef _MAGNIFY_H_
32 | #define _MAGNIFY_H_
33 |
34 | namespace AMD
35 | {
36 |
37 | class Magnify
38 | {
39 | public:
40 |
41 | // Constructor / destructor
42 | Magnify();
43 | ~Magnify();
44 |
45 | // Hooks for the DX SDK Framework
46 | HRESULT OnCreateDevice( ID3D11Device* pd3dDevice );
47 | void OnDestroyDevice();
48 | void OnResizedSwapChain( const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc );
49 |
50 | // Set methods
51 | void SetPixelRegion( int nPixelRegion );
52 | void SetScale( int nScale );
53 | void SetDepthRangeMin( float fDepthRangeMin );
54 | void SetDepthRangeMax( float fDepthRangeMax );
55 | void SetSourceResource( ID3D11Resource* pSourceResource, DXGI_FORMAT Format,
56 | int nWidth, int nHeight, int nSamples );
57 | void SetSubSampleIndex( int nSubSampleIndex );
58 |
59 | // Captures a region, at the current cursor position, for magnification
60 | void Capture( POINT& Point );
61 |
62 | // Render the magnified region, at the capture location
63 | void RenderBackground();
64 | void RenderMagnifiedRegion();
65 |
66 | private:
67 |
68 | // Private methods
69 | void SetPosition( int nPositionX, int nPositionY );
70 | void CreateInternalResources();
71 |
72 | private:
73 |
74 | // Magnification settings
75 | int m_nPositionX;
76 | int m_nPositionY;
77 | int m_nPixelRegion;
78 | int m_nHalfPixelRegion;
79 | int m_nScale;
80 | float m_fDepthRangeMin;
81 | float m_fDepthRangeMax;
82 | int m_nBackBufferWidth;
83 | int m_nBackBufferHeight;
84 | int m_nSubSampleIndex;
85 |
86 | // Helper class for plotting the magnified region
87 | Sprite m_Sprite;
88 |
89 | // Source resource data
90 | ID3D11Resource* m_pSourceResource;
91 | ID3D11Texture2D* m_pResolvedSourceResource;
92 | ID3D11Texture2D* m_pCopySourceResource;
93 | ID3D11ShaderResourceView* m_pResolvedSourceResourceSRV;
94 | ID3D11ShaderResourceView* m_pCopySourceResourceSRV;
95 | ID3D11ShaderResourceView* m_pSourceResourceSRV1;
96 | DXGI_FORMAT m_SourceResourceFormat;
97 | int m_nSourceResourceWidth;
98 | int m_nSourceResourceHeight;
99 | int m_nSourceResourceSamples;
100 | DXGI_FORMAT m_DepthFormat;
101 | DXGI_FORMAT m_DepthSRVFormat;
102 | bool m_bDepthFormat;
103 | };
104 |
105 | } // namespace AMD
106 |
107 | #endif // _MAGNIFY_H_
108 |
109 |
110 | //--------------------------------------------------------------------------------------
111 | // EOF
112 | //--------------------------------------------------------------------------------------
113 |
--------------------------------------------------------------------------------
/samples/amd_sdk/inc/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 the DXUT framework,
27 | // for the Magnify class.
28 | //--------------------------------------------------------------------------------------
29 |
30 |
31 | #ifndef _MAGNIFYTOOL_H_
32 | #define _MAGNIFYTOOL_H_
33 |
34 | namespace AMD
35 | {
36 |
37 | // GUI defines
38 | enum
39 | {
40 | IDC_MAGNIFY_STATIC_CAPTION = 19 + 1024,
41 | IDC_MAGNIFY_CHECKBOX_ENABLE,
42 | IDC_MAGNIFY_CHECKBOX_STICKY,
43 | IDC_MAGNIFY_STATIC_PIXEL_REGION,
44 | IDC_MAGNIFY_SLIDER_PIXEL_REGION,
45 | IDC_MAGNIFY_STATIC_SCALE,
46 | IDC_MAGNIFY_SLIDER_SCALE
47 | };
48 |
49 |
50 | class MagnifyTool
51 | {
52 | public:
53 |
54 | // Constructor / destructor
55 | MagnifyTool();
56 | ~MagnifyTool();
57 |
58 | // Set methods
59 | void SetSourceResources( ID3D11Resource* pSourceRTResource, DXGI_FORMAT RTFormat,
60 | int nWidth, int nHeight, int nSamples );
61 | void SetPixelRegion( int nPixelRegion ) { m_Magnify.SetPixelRegion( nPixelRegion ); }
62 | void SetScale( int nScale ) { m_Magnify.SetScale( nScale ); }
63 |
64 | // Hooks for the DX SDK Framework
65 | void InitApp( CDXUTDialog* pUI, int& iStartHeight, bool bSupportStickyMode = false );
66 | HRESULT OnCreateDevice( ID3D11Device* pd3dDevice );
67 | void OnResizedSwapChain( ID3D11Device* pd3dDevice, IDXGISwapChain *pSwapChain,
68 | const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext,
69 | int nPositionX, int nPositionY );
70 | void OnDestroyDevice();
71 | void OnGUIEvent( UINT nEvent, int nControlID, CDXUTControl* pControl, void* pUserContext );
72 | bool IsEnabled();
73 |
74 | // Render
75 | void Render();
76 |
77 | private:
78 |
79 | // UI helper methods
80 | void EnableTool( bool bEnable );
81 | void EnableUI( bool bEnable );
82 |
83 | private:
84 |
85 | // The DXUT dialog
86 | CDXUTDialog* m_pMagnifyUI;
87 |
88 | // Pointer to the Magnify class
89 | AMD::Magnify m_Magnify;
90 |
91 | // The source resources
92 | ID3D11Resource* m_pSourceRTResource;
93 | DXGI_FORMAT m_RTFormat;
94 | int m_nWidth;
95 | int m_nHeight;
96 | int m_nSamples;
97 | bool m_bReleaseRTOnResize;
98 | bool m_bMouseDownLastFrame;
99 | bool m_bStickyShowing;
100 | POINT m_StickyPoint;
101 | };
102 |
103 | } // namespace AMD
104 |
105 | #endif // _MAGNIFYTOOL_H_
106 |
107 |
108 | //--------------------------------------------------------------------------------------
109 | // EOF
110 | //--------------------------------------------------------------------------------------
111 |
--------------------------------------------------------------------------------
/samples/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 |
29 |
30 | #pragma once
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
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 | //--------------------------------------------------------------------------------------
78 | // EOF
79 | //--------------------------------------------------------------------------------------
80 |
--------------------------------------------------------------------------------
/samples/amd_sdk/inc/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 |
30 |
31 | #ifndef _SPRITE_H_
32 | #define _SPRITE_H_
33 |
34 | namespace AMD
35 | {
36 |
37 | class Sprite
38 | {
39 | public:
40 |
41 | Sprite();
42 | ~Sprite();
43 |
44 | HRESULT OnCreateDevice( ID3D11Device* pd3dDevice );
45 | void OnDestroyDevice();
46 | void OnResizedSwapChain( const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc );
47 |
48 | HRESULT RenderSprite( ID3D11ShaderResourceView* pTextureView, int nStartPosX,
49 | int nStartPosY, int nWidth, int nHeight, bool bAlpha, bool bBordered );
50 |
51 | HRESULT RenderSpriteMS( ID3D11ShaderResourceView* pTextureView, int nStartPosX,
52 | int nStartPosY, int nWidth, int nHeight, int nTextureWidth, int nTextureHeight,
53 | bool bAlpha, bool bBordered, int nSampleIndex );
54 |
55 | HRESULT RenderSpriteAsDepth( ID3D11ShaderResourceView* pTextureView, int nStartPosX,
56 | int nStartPosY, int nWidth, int nHeight, bool bBordered, float fDepthRangeMin,
57 | float fDepthRangeMax );
58 |
59 | HRESULT RenderSpriteAsDepthMS( ID3D11ShaderResourceView* pTextureView, int nStartPosX,
60 | int nStartPosY, int nWidth, int nHeight, int nTextureWidth, int nTextureHeight,
61 | bool bBordered, float fDepthRangeMin, float fDepthRangeMax, int nSampleIndex );
62 |
63 | HRESULT RenderSpriteVolume( ID3D11ShaderResourceView* pTextureView, int nStartPosX, int nStartPosY, int nMaxWidth, int nSliceSize, bool bBordered );
64 |
65 | void SetSpriteColor( DirectX::XMVECTOR Color );
66 | void SetBorderColor( DirectX::XMVECTOR Color );
67 | void SetUVs( float fU1, float fV1, float fU2, float fV2 );
68 | void EnableScissorTest( bool enable ) { m_EnableScissorTest = enable; }
69 | void SetPointSample( bool pointSample ) { m_PointSampleMode = pointSample; }
70 |
71 | private:
72 |
73 | void RenderBorder();
74 | void Render();
75 |
76 | // VBs
77 | ID3D11InputLayout* m_pVertexLayout;
78 | ID3D11Buffer* m_pVertexBuffer;
79 | ID3D11InputLayout* m_pBorderVertexLayout;
80 | ID3D11Buffer* m_pBorderVertexBuffer;
81 |
82 | // CB
83 | ID3D11Buffer* m_pcbSprite;
84 |
85 | // Shaders
86 | ID3D11VertexShader* m_pSpriteVS;
87 | ID3D11VertexShader* m_pSpriteBorderVS;
88 | ID3D11PixelShader* m_pSpritePS;
89 | ID3D11PixelShader* m_pSpriteMSPS;
90 | ID3D11PixelShader* m_pSpriteAsDepthPS;
91 | ID3D11PixelShader* m_pSpriteAsDepthMSPS;
92 | ID3D11PixelShader* m_pSpriteBorderPS;
93 | ID3D11PixelShader* m_pSpriteUntexturedPS;
94 | ID3D11PixelShader* m_pSpriteVolumePS;
95 |
96 | // States
97 | bool m_EnableScissorTest;
98 | bool m_PointSampleMode;
99 | ID3D11SamplerState* m_pSamplePoint;
100 | ID3D11SamplerState* m_pSampleLinear;
101 | ID3D11RasterizerState* m_pRasterState;
102 | ID3D11RasterizerState* m_pRasterStateWithScissor;
103 | ID3D11RasterizerState* m_pEnableCulling;
104 | ID3D11BlendState* m_pNoBlending;
105 | ID3D11BlendState* m_pSrcAlphaBlending;
106 | ID3D11DepthStencilState* m_pDisableDepthTestWrite;
107 | ID3D11DepthStencilState* m_pEnableDepthTestWrite;
108 | };
109 |
110 | } // namespace AMD
111 |
112 | #endif // _SPRITE_H_
113 |
114 |
115 | //--------------------------------------------------------------------------------------
116 | // EOF
117 | //--------------------------------------------------------------------------------------
118 |
--------------------------------------------------------------------------------
/samples/amd_sdk/media/AMD.dds:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/amd_sdk/media/AMD.dds
--------------------------------------------------------------------------------
/samples/amd_sdk/media/AMD.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/amd_sdk/media/AMD.ico
--------------------------------------------------------------------------------
/samples/amd_sdk/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 |
--------------------------------------------------------------------------------
/samples/amd_sdk/shaders/SeparableFilter/HorizontalFilter.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 | //--------------------------------------------------------------------------------------
24 | // File: HorizontalFilter.hlsl
25 | //
26 | // Implements the horizontal pass of the kernel.
27 | //--------------------------------------------------------------------------------------
28 |
29 |
30 | #if ( USE_COMPUTE_SHADER == 1 )
31 |
32 | //--------------------------------------------------------------------------------------
33 | // Compute shader implementing the horizontal pass of a separable filter
34 | //--------------------------------------------------------------------------------------
35 | [numthreads( NUM_THREADS, RUN_LINES, 1 )]
36 | void CSFilterX( uint3 Gid : SV_GroupID, uint3 GTid : SV_GroupThreadID )
37 | {
38 | // Sampling and line offsets from group thread IDs
39 | int iSampleOffset = GTid.x * SAMPLES_PER_THREAD;
40 | int iLineOffset = GTid.y;
41 |
42 | // Group and pixel coords from group IDs
43 | int2 i2GroupCoord = int2( ( Gid.x * RUN_SIZE ) - KERNEL_RADIUS, ( Gid.y * RUN_LINES ) );
44 | int2 i2Coord = int2( i2GroupCoord.x + iSampleOffset, i2GroupCoord.y );
45 |
46 | // Sample and store to LDS
47 | [unroll]
48 | for( int i = 0; i < SAMPLES_PER_THREAD; ++i )
49 | {
50 | WRITE_TO_LDS( Sample( i2Coord + int2( i, GTid.y ), float2( 0.5f, 0.0f ) ), iLineOffset, iSampleOffset + i )
51 | }
52 |
53 | // Optionally load some extra texels as required by the exact kernel size
54 | if( GTid.x < EXTRA_SAMPLES )
55 | {
56 | WRITE_TO_LDS( Sample( i2GroupCoord + int2( RUN_SIZE_PLUS_KERNEL - 1 - GTid.x, GTid.y ), float2( 0.5f, 0.0f ) ), iLineOffset, RUN_SIZE_PLUS_KERNEL - 1 - GTid.x )
57 | }
58 |
59 | // Sync threads
60 | GroupMemoryBarrierWithGroupSync();
61 |
62 | // Adjust pixel offset for computing at PIXELS_PER_THREAD
63 | int iPixelOffset = GTid.x * PIXELS_PER_THREAD;
64 | i2Coord = int2( i2GroupCoord.x + iPixelOffset, i2GroupCoord.y );
65 |
66 | // Since we start with the first thread position, we need to increment the coord by KERNEL_RADIUS
67 | i2Coord.x += KERNEL_RADIUS;
68 |
69 | // Ensure we don't compute pixels off screen
70 | if( i2Coord.x < g_f4OutputSize.x )
71 | {
72 | int2 i2Center = i2Coord + int2( 0, GTid.y );
73 | int2 i2Inc = int2( 1, 0 );
74 |
75 | // Compute the filter kernel using LDS values
76 | ComputeFilterKernel( iPixelOffset, iLineOffset, i2Center, i2Inc );
77 | }
78 | }
79 |
80 | #else // USE_COMPUTE_SHADER
81 |
82 | //--------------------------------------------------------------------------------------
83 | // Pixel shader implementing the horizontal pass of a separable filter
84 | //--------------------------------------------------------------------------------------
85 | PS_Output PSFilterX( PS_RenderQuadInput I ) : SV_TARGET
86 | {
87 | PS_Output O = (PS_Output)0;
88 | RAWDataItem RDI[1];
89 | int iPixel, iIteration;
90 | KernelData KD[1];
91 |
92 | // Load the center sample(s)
93 | int2 i2KernelCenter = int2( g_f4OutputSize.xy * I.f2TexCoord );
94 | RDI[0] = Sample( int2( i2KernelCenter.x, i2KernelCenter.y ), float2( 0.0f, 0.0f ) );
95 |
96 | // Macro defines what happens at the kernel center
97 | KERNEL_CENTER( KD, iPixel, 1, O, RDI )
98 |
99 | i2KernelCenter.x -= KERNEL_RADIUS;
100 |
101 | // First half of the kernel
102 | [unroll]
103 | for( iIteration = 0; iIteration < KERNEL_RADIUS; iIteration += STEP_SIZE )
104 | {
105 | // Load the sample(s) for this iteration
106 | RDI[0] = Sample( int2( i2KernelCenter.x + iIteration, i2KernelCenter.y ), float2( 0.5f, 0.0f ) );
107 |
108 | // Macro defines what happens for each kernel iteration
109 | KERNEL_ITERATION( iIteration, KD, iPixel, 1, O, RDI )
110 | }
111 |
112 | // Second half of the kernel
113 | [unroll]
114 | for( iIteration = KERNEL_RADIUS + 1; iIteration < KERNEL_DIAMETER; iIteration += STEP_SIZE )
115 | {
116 | // Load the sample(s) for this iteration
117 | RDI[0] = Sample( int2( i2KernelCenter.x + iIteration, i2KernelCenter.y ), float2( 0.5f, 0.0f ) );
118 |
119 | // Macro defines what happens for each kernel iteration
120 | KERNEL_ITERATION( iIteration, KD, iPixel, 1, O, RDI )
121 | }
122 |
123 | // Macros define final weighting
124 | KERNEL_FINAL_WEIGHT( KD, iPixel, 1, O )
125 |
126 | return O;
127 | }
128 |
129 | #endif // USE_COMPUTE_SHADER
130 |
131 |
132 | //--------------------------------------------------------------------------------------
133 | // EOF
134 | //--------------------------------------------------------------------------------------
135 |
--------------------------------------------------------------------------------
/samples/amd_sdk/shaders/SeparableFilter/VerticalFilter.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 | //--------------------------------------------------------------------------------------
24 | // File: VerticalFilter.hlsl
25 | //
26 | // Implements the vertical pass of the kernel.
27 | //--------------------------------------------------------------------------------------
28 |
29 |
30 | #if ( USE_COMPUTE_SHADER == 1 )
31 |
32 | //--------------------------------------------------------------------------------------
33 | // Compute shader implementing the vertical pass of a separable filter
34 | //--------------------------------------------------------------------------------------
35 | [numthreads( NUM_THREADS, RUN_LINES, 1 )]
36 | void CSFilterY( uint3 Gid : SV_GroupID, uint3 GTid : SV_GroupThreadID )
37 | {
38 | // Sampling and line offsets from group thread IDs
39 | int iSampleOffset = GTid.x * SAMPLES_PER_THREAD;
40 | int iLineOffset = GTid.y;
41 |
42 | // Group and pixel coords from group IDs
43 | int2 i2GroupCoord = int2( ( Gid.x * RUN_LINES ), ( Gid.y * RUN_SIZE ) - KERNEL_RADIUS );
44 | int2 i2Coord = int2( i2GroupCoord.x, i2GroupCoord.y + iSampleOffset );
45 |
46 | // Sample and store to LDS
47 | [unroll]
48 | for( int i = 0; i < SAMPLES_PER_THREAD; ++i )
49 | {
50 | WRITE_TO_LDS( Sample( i2Coord + int2( GTid.y, i ), float2( 0.0f, 0.5f ) ), iLineOffset, iSampleOffset + i )
51 | }
52 |
53 | // Optionally load some extra texels as required by the exact kernel size
54 | if( GTid.x < EXTRA_SAMPLES )
55 | {
56 | WRITE_TO_LDS( Sample( i2GroupCoord + int2( GTid.y, RUN_SIZE_PLUS_KERNEL - 1 - GTid.x ), float2( 0.0f, 0.5f ) ), iLineOffset, RUN_SIZE_PLUS_KERNEL - 1 - GTid.x )
57 | }
58 |
59 | // Sync threads
60 | GroupMemoryBarrierWithGroupSync();
61 |
62 | // Adjust pixel offset for computing at PIXELS_PER_THREAD
63 | int iPixelOffset = GTid.x * PIXELS_PER_THREAD;
64 | i2Coord = int2( i2GroupCoord.x, i2GroupCoord.y + iPixelOffset );
65 |
66 | // Since we start with the first thread position, we need to increment the coord by KERNEL_RADIUS
67 | i2Coord.y += KERNEL_RADIUS;
68 |
69 | // Ensure we don't compute pixels off screen
70 | if( i2Coord.y < g_f4OutputSize.y )
71 | {
72 | int2 i2Center = i2Coord + int2( GTid.y, 0 );
73 | int2 i2Inc = int2( 0, 1 );
74 |
75 | // Compute the filter kernel using LDS values
76 | ComputeFilterKernel( iPixelOffset, iLineOffset, i2Center, i2Inc );
77 | }
78 | }
79 |
80 | #else // USE_COMPUTE_SHADER
81 |
82 | //--------------------------------------------------------------------------------------
83 | // Pixel shader implementing the vertical pass of a separable filter
84 | //--------------------------------------------------------------------------------------
85 | PS_Output PSFilterY( PS_RenderQuadInput I ) : SV_TARGET
86 | {
87 | PS_Output O = (PS_Output)0;
88 | RAWDataItem RDI[1];
89 | int iPixel, iIteration;
90 | KernelData KD[1];
91 |
92 | // Load the center sample(s)
93 | int2 i2KernelCenter = int2( g_f4OutputSize.xy * I.f2TexCoord );
94 | RDI[0] = Sample( int2( i2KernelCenter.x, i2KernelCenter.y ), float2( 0.0f, 0.0f ) );
95 |
96 | // Macro defines what happens at the kernel center
97 | KERNEL_CENTER( KD, iPixel, 1, O, RDI )
98 |
99 | i2KernelCenter.y -= KERNEL_RADIUS;
100 |
101 | // First half of the kernel
102 | [unroll]
103 | for( iIteration = 0; iIteration < KERNEL_RADIUS; iIteration += STEP_SIZE )
104 | {
105 | // Load the sample(s) for this iteration
106 | RDI[0] = Sample( int2( i2KernelCenter.x, i2KernelCenter.y + iIteration ), float2( 0.0f, 0.5f ) );
107 |
108 | // Macro defines what happens for each kernel iteration
109 | KERNEL_ITERATION( iIteration, KD, iPixel, 1, O, RDI )
110 | }
111 |
112 | // Second half of the kernel
113 | [unroll]
114 | for( iIteration = KERNEL_RADIUS + 1; iIteration < KERNEL_DIAMETER; iIteration += STEP_SIZE )
115 | {
116 | // Load the sample(s) for this iteration
117 | RDI[0] = Sample( int2( i2KernelCenter.x, i2KernelCenter.y + iIteration ), float2( 0.0f, 0.5f ) );
118 |
119 | // Macro defines what happens for each kernel iteration
120 | KERNEL_ITERATION( iIteration, KD, iPixel, 1, O, RDI )
121 | }
122 |
123 | // Macros define final weighting
124 | KERNEL_FINAL_WEIGHT( KD, iPixel, 1, O )
125 |
126 | return O;
127 | }
128 |
129 | #endif // USE_COMPUTE_SHADER
130 |
131 |
132 | //--------------------------------------------------------------------------------------
133 | // EOF
134 | //--------------------------------------------------------------------------------------
135 |
--------------------------------------------------------------------------------
/samples/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 "../inc/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 |
--------------------------------------------------------------------------------
/samples/amd_sdk/src/HUD.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: HUD.cpp
25 | //
26 | // Class definition for the AMD standard HUD interface.
27 | //--------------------------------------------------------------------------------------
28 |
29 |
30 | #include "../../DXUT/Core/DXUT.h"
31 | #include "../../DXUT/Core/DXUTmisc.h"
32 | #include "../../DXUT/Optional/DXUTgui.h"
33 | #include "../../DXUT/Optional/SDKmisc.h"
34 | #include "../../DXUT/Core/DDSTextureLoader.h"
35 | #include "../inc/Sprite.h"
36 | #include "../inc/HUD.h"
37 |
38 | using namespace AMD;
39 |
40 | //--------------------------------------------------------------------------------------
41 | // Constructor
42 | //--------------------------------------------------------------------------------------
43 | HUD::HUD()
44 | {
45 | m_pLogoSRV = NULL;
46 | }
47 |
48 |
49 | //--------------------------------------------------------------------------------------
50 | // Destructor
51 | //--------------------------------------------------------------------------------------
52 | HUD::~HUD()
53 | {
54 | SAFE_RELEASE( m_pLogoSRV );
55 | }
56 |
57 |
58 | //--------------------------------------------------------------------------------------
59 | // Device creation hook function, that loads the AMD logo texture, and creates a sprite
60 | // object
61 | //--------------------------------------------------------------------------------------
62 | HRESULT HUD::OnCreateDevice( ID3D11Device* pd3dDevice )
63 | {
64 | HRESULT hr;
65 | wchar_t str[MAX_PATH];
66 |
67 | m_Sprite.OnCreateDevice( pd3dDevice );
68 |
69 | V_RETURN( DXUTFindDXSDKMediaFileCch( str, MAX_PATH, L"..\\AMD_SDK\\Media\\AMD.dds" ) );
70 | DirectX::CreateDDSTextureFromFile( pd3dDevice, str, nullptr, &m_pLogoSRV );
71 | DXUT_SetDebugName( m_pLogoSRV, "AMD.dds" );
72 |
73 | return hr;
74 | }
75 |
76 |
77 | //--------------------------------------------------------------------------------------
78 | // Device destruction hook function, that releases the sprite object and
79 | //--------------------------------------------------------------------------------------
80 | void HUD::OnDestroyDevice()
81 | {
82 | m_Sprite.OnDestroyDevice();
83 |
84 | SAFE_RELEASE( m_pLogoSRV );
85 | }
86 |
87 |
88 | //--------------------------------------------------------------------------------------
89 | // Resize swap chain hook function, that passes through to the sprite object
90 | //--------------------------------------------------------------------------------------
91 | void HUD::OnResizedSwapChain( const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc )
92 | {
93 | m_Sprite.OnResizedSwapChain( pBackBufferSurfaceDesc );
94 | }
95 |
96 |
97 | //--------------------------------------------------------------------------------------
98 | // Render hook function, that calls the CDXUTDialog::OnRender method, and additionally
99 | // renders the AMD sprite
100 | //--------------------------------------------------------------------------------------
101 | void HUD::OnRender( float fElapsedTime )
102 | {
103 | m_GUI.OnRender( fElapsedTime );
104 | m_Sprite.RenderSprite( m_pLogoSRV, DXUTGetDXGIBackBufferSurfaceDesc()->Width - 253, DXUTGetDXGIBackBufferSurfaceDesc()->Height, 256, 64, true, false );
105 | }
106 |
107 |
108 | Slider::Slider( CDXUTDialog& dialog, int id, int& y, const wchar_t* label, int min, int max, int& value ) :
109 | m_Value( value ),
110 | m_szLabel( label )
111 | {
112 | dialog.AddStatic( id + 1000000, L"", AMD::HUD::iElementOffset, y += AMD::HUD::iElementDelta, AMD::HUD::iElementWidth, AMD::HUD::iElementHeight, false, &m_pLabel );
113 | dialog.AddSlider( id, AMD::HUD::iElementOffset, y += AMD::HUD::iElementDelta, AMD::HUD::iElementWidth, AMD::HUD::iElementHeight, min, max, m_Value, false, &m_pSlider );
114 |
115 | dialog.AddControl( this );
116 |
117 | OnGuiEvent();
118 | }
119 |
120 |
121 | void Slider::OnGuiEvent()
122 | {
123 | m_Value = m_pSlider->GetValue();
124 |
125 | wchar_t buff[ 1024 ];
126 | swprintf_s( buff, 1024, L"%s: %d", m_szLabel, m_Value );
127 |
128 | m_pLabel->SetText( buff );
129 | }
130 |
131 |
132 | void Slider::SetEnabled( bool enable )
133 | {
134 | m_pLabel->SetEnabled( enable );
135 | m_pSlider->SetEnabled( enable );
136 | }
137 |
138 |
139 | void Slider::SetVisible( bool visible )
140 | {
141 | m_pLabel->SetVisible( visible );
142 | m_pSlider->SetVisible( visible );
143 | }
144 |
145 |
146 | void Slider::SetValue( int value )
147 | {
148 | m_pSlider->SetValue( value );
149 | OnGuiEvent();
150 | }
151 |
152 | //--------------------------------------------------------------------------------------
153 | // EOF
154 | //--------------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/samples/common/inc/ApplicationContext.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 | #include "MGPUAffinity.h"
24 | #include "DXUTCamera.h"
25 | #include "AMD_SDK.h"
26 | #include "ClearView.h"
27 |
28 | class ApplicationContext
29 | {
30 | public:
31 | ApplicationContext();
32 | virtual ~ApplicationContext();
33 |
34 | HRESULT Init(ID3D11Device* pd3dDevice, ID3D11DeviceContext* pd3dImmediateContext);
35 | HRESULT Terminate();
36 | void OnResizedSwapChain(const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc);
37 |
38 | public:
39 | AMD::ShaderCache m_ShaderCache;
40 | MGPUAffinity m_Affinity;
41 | float m_fbWidth;
42 | float m_fbHeight;
43 | CFirstPersonCamera m_Camera; // A model viewing camera
44 | CDXUTDirectionWidget m_Light; // Dynamic Light
45 | // Samplers
46 | ID3D11SamplerState* m_pSamplePoint;
47 | ID3D11SamplerState* m_pSampleLinear;
48 | // Blend states
49 | ID3D11BlendState* m_pAlphaState;
50 | ID3D11BlendState* m_pOpaqueState;
51 |
52 | ID3D11DepthStencilState* m_pDepthStateAlpha;
53 | ID3D11DepthStencilState* m_pDepthStateOpaque;
54 |
55 | ClearView m_ClearView;
56 |
57 | ALVRFactory* m_pLiquidVRFactory;
58 | ALVRDeviceExD3D11* m_pLiquidVrDevice;
59 | ALVRGpuAffinity* m_pLiquidVRAffinity;
60 | HMODULE m_hLiquidVRDLL;
61 | };
--------------------------------------------------------------------------------
/samples/common/inc/Background.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 | #include "ApplicationContext.h"
24 | #include "SDKmisc.h"
25 | #include "SDKmesh.h"
26 | #include
27 |
28 | using namespace DirectX;
29 |
30 | class Background
31 | {
32 | public:
33 | Background();
34 | virtual ~Background();
35 | HRESULT Init(ID3D11Device* pd3dDevice, ApplicationContext *pContext);
36 | HRESULT Terminate();
37 | HRESULT Render(ID3D11DeviceContext* pd3dImmediateContext, float fbWidth, float fbHeight);
38 |
39 | protected:
40 | void SetupEye(ID3D11DeviceContext* pd3dImmediateContext, GpuMask mask, bool bPortrait);
41 |
42 | ApplicationContext* m_pContext;
43 | CDXUTSDKMesh m_SceneMesh;
44 | ID3D11VertexShader* m_pSceneVS;
45 | ID3D11PixelShader* m_pScenePS;
46 | ID3D11InputLayout* m_pSceneVertexLayout;
47 | ID3D11Buffer* m_pcbUtility;
48 | bool m_bDrawWithAlpha;
49 | };
--------------------------------------------------------------------------------
/samples/common/inc/BarrelDistortionShader.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 | #pragma once
24 | #include "ImageShader2D.h"
25 |
26 | class BarrelDistortionShader : public ImageShader2D
27 | {
28 | public:
29 | BarrelDistortionShader(float scaling);
30 | ~BarrelDistortionShader();
31 |
32 | virtual HRESULT Start();
33 | virtual HRESULT Stop();
34 | virtual HRESULT QueryEyes(UINT srcWidth, UINT srcHeight, UINT dstWidth, UINT dstHeight, ALVRSurface *pInputSurfaceL, ALVRSurface *pInputSurfaceR, ALVRSurface *pOutputSurfaceL, ALVRSurface *pOutputSurfaceR, bool bWait);
35 |
36 | virtual void ResetSize();
37 |
38 | bool GetAntialiasing();
39 | void SetAntialiasing(bool bAntialiasing);
40 |
41 | void GetCoeffs(float *red, float *green, float *blue);
42 | void SetCoeffs(float red, float green, float blue);
43 |
44 | protected:
45 |
46 | #pragma pack(push)
47 | #pragma pack(1)
48 | struct ParametersLR
49 | {
50 | XMFLOAT3 k1Rgb;
51 | float zoomSrcToDst;
52 |
53 | XMFLOAT3 k2Rgb;
54 | UINT enableAntialias;
55 |
56 | XMFLOAT4 backgrndColor;
57 |
58 | XMFLOAT2 origOutL;
59 | XMINT2 displayPosL;
60 |
61 | XMINT2 displaySizeL;
62 | XMINT2 inputPosL; // LT in pixels of the input image picture (texture)
63 |
64 | XMINT2 inputSizeL; // WxH size in pixels of the input image picture (texture)
65 | XMFLOAT2 origOutR;
66 |
67 | XMINT2 displayPosR;
68 | XMINT2 displaySizeR;
69 |
70 | XMINT2 inputPosR; // LT in pixels of the input image picture (texture)
71 | XMINT2 inputSizeR; // WxH size in pixels of the input image picture (texture)
72 | };
73 | #pragma pack(pop)
74 |
75 | ALVRBuffer* m_pConstantBufferLR;
76 | ParametersLR m_ParamsLR;
77 | UINT m_Width;
78 | UINT m_Height;
79 | float m_Scaling;
80 | bool m_bAntialiasing;
81 | };
--------------------------------------------------------------------------------
/samples/common/inc/Character.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 | #include
25 | #include
26 |
27 | #include "DXUT.h"
28 | #include "DXUTmisc.h"
29 | #include "DXUTCamera.h"
30 | #include "SDKmisc.h"
31 | #include "SDKmesh.h"
32 |
33 | using namespace DirectX;
34 |
35 | #include "ApplicationContext.h"
36 |
37 | class Character
38 | {
39 | public:
40 | Character();
41 | virtual ~Character();
42 | virtual HRESULT Init(ID3D11Device* pd3dDevice, ID3D11DeviceContext* pd3dImmediateContext, ApplicationContext *pContext);
43 | virtual HRESULT Terminate();
44 | virtual HRESULT Render(ID3D11DeviceContext* pd3dImmediateContext, float fbWidth, float fbHeight);
45 | HRESULT Time();
46 | virtual HRESULT SetPosition(float x, float y);
47 |
48 |
49 | // options
50 | void SetShift(bool bShift);
51 | void SetAlpha(bool bAlpha){m_bAlpha = bAlpha;}
52 | void SetClear(bool bClear){ m_bClear = bClear;}
53 | void SetRotate(bool bRotate){ m_bRotate = bRotate; }
54 |
55 | bool GetShift(){ return m_bShift; }
56 | bool GetAlpha(){ return m_bAlpha; }
57 | bool GetClear(){ return m_bClear; }
58 | bool GetRotate(){ return m_bRotate; }
59 |
60 | void GetDrawLimits(int *iMinDraws, int *iMaxDraws){ *iMinDraws = m_iMinDraws; *iMaxDraws = m_iMaxDraws; }
61 | void SetTodoDraw(int iTodoDraws){ m_iTodoDraws = iTodoDraws; }
62 | int GetTodoDraw(){ return m_iTodoDraws; }
63 |
64 | void SetUseTimers(bool bUseTimers){ m_bUseTimers = bUseTimers; }
65 |
66 | protected:
67 | void SetupEye(ID3D11DeviceContext* pd3dImmediateContext, GpuMask mask, bool bPortrait);
68 | void SetupPS(ID3D11DeviceContext* pd3dImmediateContext, GpuMask mask);
69 | void UpdatePositionBuffers(ID3D11Device* pd3dDevice, ID3D11DeviceContext* pd3dImmediateContext);
70 | void ClearPositionBuffers();
71 | void DrawObjectsForView(ID3D11DeviceContext* pd3dImmediateContext);
72 |
73 | virtual HRESULT AllocVShaderObjects(ID3D11Device* pd3dDevice, ID3D11DeviceContext* pd3dImmediateContext);
74 | virtual HRESULT UpdateVShaderObjects(ID3D11DeviceContext* pd3dImmediateContext, XMMATRIX &viewProj, XMMATRIX &mWorld, GpuMask mask);
75 | virtual WCHAR* GetVShaderName();
76 | virtual HRESULT SetupVS(ID3D11DeviceContext* pd3dImmediateContext, GpuMask mask);
77 |
78 | struct CB_VS_PER_OBJECT
79 | {
80 | XMFLOAT4X4 m_ViewProj;
81 | XMFLOAT4X4 m_World;
82 | };
83 | static UINT m_iCBVSPerObjectBind;
84 |
85 | ApplicationContext* m_pContext;
86 | CDXUTSDKMesh m_Mesh;
87 | ID3D11VertexShader* m_pSimpleVS;
88 | ID3D11PixelShader* m_pSimplePS;
89 | ID3D11InputLayout* m_pVertexLayout;
90 | ID3D11Buffer* m_pcbVSPerObject;
91 | ID3D11Buffer* m_pcbPSPerObject;
92 | ID3D11Buffer* m_pcbPSPerFrame;
93 |
94 |
95 | ID3D11Buffer** m_pcbVSPosition;
96 | int m_iPositionCount;
97 | int m_iPositionAllocated;
98 |
99 | // options
100 | bool m_bShift;
101 | bool m_bAlpha;
102 | bool m_bClear;
103 | bool m_bRotate;
104 |
105 | int m_iMinDraws;
106 | int m_iMaxDraws;
107 | int m_iTodoDraws;
108 | bool m_bUseTimers;
109 |
110 | // animation
111 | DWORD m_dwTime;
112 | float m_fTime;
113 | float m_fPosX;
114 | float m_fPosY;
115 | };
--------------------------------------------------------------------------------
/samples/common/inc/ClearView.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 | #include
25 | #include
26 |
27 | using namespace DirectX;
28 |
29 | class ApplicationContext;
30 | class ClearView
31 | {
32 | public:
33 | ClearView();
34 | virtual ~ClearView();
35 |
36 | HRESULT Init(ID3D11Device* pd3dDevice, ApplicationContext *pContext);
37 | HRESULT Terminate();
38 | HRESULT Render(ID3D11DeviceContext* pd3dImmediateContext, XMVECTORF32 &color);
39 | protected:
40 | ApplicationContext* m_pContext;
41 | ID3D11Buffer* m_pcbPSColor;
42 | ID3D11InputLayout* m_pColorVertexLayout;
43 | ID3D11VertexShader* m_pColorVS;
44 | ID3D11PixelShader* m_pColorPS;
45 | ID3D11Buffer* m_pQuadVertexBuffer;
46 |
47 | };
--------------------------------------------------------------------------------
/samples/common/inc/D3DHelper.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 | #include "../../../inc/LiquidVR.h"
25 | #include
26 | #include
27 | #include
28 | #include
29 |
30 |
31 | class D3DHelper
32 | {
33 | public:
34 | struct ColorVertex
35 | {
36 | DirectX::XMFLOAT3 Pos;
37 | DirectX::XMFLOAT4 Col;
38 | };
39 |
40 | struct TextureVertex
41 | {
42 | DirectX::XMFLOAT3 Pos;
43 | DirectX::XMFLOAT2 Tex;
44 | };
45 |
46 | struct ConstantBuffer
47 | {
48 | DirectX::XMMATRIX m_WorldViewProjection;
49 | };
50 |
51 | D3DHelper();
52 | virtual ~D3DHelper();
53 |
54 | virtual ALVR_RESULT CreateD3D11Device();
55 | virtual ALVR_RESULT CreateSwapChain(HWND hWindow, unsigned int iBackbufferCount);
56 | virtual ALVR_RESULT Create3DScene(unsigned int width, unsigned int height, bool bColorCube);
57 |
58 | virtual ALVR_RESULT Animate();
59 |
60 | virtual ALVR_RESULT SetupViewportForEye(bool bLeft);
61 | virtual ALVR_RESULT SetupMatrixForEye(bool bLeft);
62 | virtual ALVR_RESULT RenderFrame(int iDrawRepeat);
63 | virtual ALVR_RESULT Present();
64 |
65 | virtual ALVR_RESULT Terminate();
66 |
67 | public:
68 | CComPtr m_pd3dDevice;
69 | CComPtr m_pd3dDeviceContext;
70 | CComPtr m_pSwapChain;
71 | ATL::CComPtr m_pVertexShader;
72 | ATL::CComPtr m_pPixelShader;
73 | ATL::CComPtr m_pVertexLayout;
74 | ATL::CComPtr m_pVertexBuffer;
75 | ATL::CComPtr m_pIndexBuffer;
76 | ATL::CComPtr m_pConstantBuffer;
77 | ATL::CComPtr m_pDepthStencil;
78 | ATL::CComPtr m_pDepthStencilView;
79 | CComPtr m_pSampler;
80 | CComPtr m_pRasterizerState;
81 |
82 | float m_fAnimation;
83 | unsigned int m_Width;
84 | unsigned int m_Height;
85 | unsigned int m_iVertexCount;
86 | protected:
87 | virtual const char *GetShaderText(bool bColorCube);
88 | virtual ALVR_RESULT CreateConstantBuffer();
89 | virtual ALVR_RESULT UpdateConstantBuffer(bool bLeft, DirectX::XMMATRIX &worldViewProjection);
90 |
91 | virtual ALVR_RESULT PrepareColorCube();
92 | virtual ALVR_RESULT PrepareTextureCube();
93 |
94 | };
95 |
96 | ALVR_RESULT ConvertFromatFromDXGIToALVR(DXGI_FORMAT dxgi, ALVR_FORMAT &alvr);
97 |
--------------------------------------------------------------------------------
/samples/common/inc/GridGeneratorShader.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 | #include "ImageShader2D.h"
24 |
25 | class GridGeneratorShader : public ImageShader2D
26 | {
27 | public:
28 | GridGeneratorShader();
29 | ~GridGeneratorShader();
30 |
31 | virtual HRESULT Start();
32 | virtual HRESULT Stop();
33 | virtual HRESULT Query(UINT width, UINT height, ALVRSurface *pInputSurface, ALVRSurface *pOutputSurface, bool bWait);
34 |
35 | protected:
36 |
37 | #pragma pack(push)
38 | #pragma pack(1)
39 | struct Parameters
40 | {
41 | unsigned int width;
42 | unsigned int height;
43 | unsigned int gridWidth;
44 | unsigned int lineWidth;
45 | // BYTE padding[0];
46 | XMFLOAT4 colorBg;
47 | XMFLOAT4 colorFg;
48 | };
49 | #pragma pack(pop)
50 |
51 | ALVRBuffer* m_pConstantBuffer;
52 | Parameters m_Params;
53 | ALVRSampler* m_pSampler;
54 | };
--------------------------------------------------------------------------------
/samples/common/inc/ImageShader2D.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 | #include "../../../inc/LiquidVRD2D.h"
24 | #include "ApplicationContext.h"
25 |
26 | #define THREAD_GROUP_SIZE 8 // the same as in shaders
27 |
28 | class ImageShader2D
29 | {
30 | public:
31 | ImageShader2D(const WCHAR *pShaderName, const WCHAR *pMainName);
32 | virtual ~ImageShader2D();
33 |
34 | virtual HRESULT Init(ApplicationContext *pApplicationContext, ALVRComputeContext *pComputeContext);
35 | virtual HRESULT Terminate();
36 | virtual HRESULT Query(UINT width, UINT height, ALVRSurface *pInputSurface, ALVRSurface *pOutputSurface, bool bWait);
37 | virtual HRESULT Start();
38 | virtual HRESULT Stop();
39 | virtual bool IsReady();
40 |
41 | protected:
42 | static void CALLBACK ShaderReadyCallback(_In_ UINT uiShaderID, _In_ void *pUserData);
43 | HRESULT ShaderReady(_In_ UINT uiShaderID);
44 |
45 |
46 | struct Surface
47 | {
48 | Surface() : m_pSurface(NULL), m_bDestroy(false), m_pRenderTargetView(NULL){}
49 |
50 | void Destroy()
51 | {
52 | if (m_pSurface != NULL)
53 | {
54 | if (m_bDestroy)
55 | {
56 | m_pSurface->Release();
57 | }
58 | m_pSurface = NULL;
59 | }
60 | if (m_pRenderTargetView != NULL)
61 | {
62 | m_pRenderTargetView->Release();
63 | m_pRenderTargetView = NULL;
64 | }
65 | }
66 |
67 | ALVRSurface* m_pSurface;
68 | bool m_bDestroy;
69 | ID3D11RenderTargetView* m_pRenderTargetView;
70 | };
71 |
72 | ApplicationContext* m_pApplicationContext;
73 | ALVRComputeContext* m_pComputeContext;
74 | ALVRComputeTask* m_pShader;
75 | ALVRFence* m_pFence;
76 | bool m_bShaderReady;
77 | UINT m_uiShaderID;
78 | bool m_bDelayedStart;
79 | WCHAR m_pFileNameSource[AMD::ShaderCache::m_uFILENAME_MAX_LENGTH];
80 | WCHAR m_pFileNameBin[AMD::ShaderCache::m_uFILENAME_MAX_LENGTH];
81 | WCHAR m_pNameMain[AMD::ShaderCache::m_uFILENAME_MAX_LENGTH];
82 |
83 | };
--------------------------------------------------------------------------------
/samples/common/inc/LvrLogger.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 | #include
24 | #include
25 | #include
26 | #include
27 | #include "../../../inc/LiquidVR.h"
28 |
29 | __int64 high_precision_clock();
30 | __int64 qpc_to_high_precision_clock(__int64 qpc);
31 | void increase_timer_precision();
32 |
33 | const wchar_t* ALVRResultToString(ALVR_RESULT res);
34 |
35 |
36 | enum LogType
37 | {
38 | LogTypeInfo,
39 | LogTypeSuccess,
40 | LogTypeError,
41 | LogTypeDefault
42 | };
43 |
44 | void WriteLog(const wchar_t* message, LogType type);
45 |
46 | #define LOG_WRITE(a, type)\
47 | do{ \
48 | std::wstringstream messageStream12345;\
49 | messageStream12345 << a;\
50 | WriteLog(messageStream12345.str().c_str(), type);\
51 | }while(0)
52 |
53 | #define LOG_INFO(a) LOG_WRITE(a << std::endl, LogTypeInfo)
54 | #define LOG_SUCCESS(a) LOG_WRITE(a << std::endl, LogTypeSuccess)
55 | #define LOG_ERROR(a) LOG_WRITE(a << std::endl, LogTypeError)
56 |
57 | #ifdef _DEBUG
58 | #define LOG_DEBUG(a) LOG_INFO(a)
59 | #else
60 | #define LOG_DEBUG(a)
61 | #endif
62 |
63 | #define LOG_ALVR_ERROR(err, text) \
64 | do{ \
65 | if( (err) != ALVR_OK) \
66 | { \
67 | LOG_WRITE(text << L" Error:" << ALVRResultToString((err)) << std::endl, LogTypeError);\
68 | } \
69 | }while(0)
70 |
71 | #define CHECK_RETURN(exp, err, text) \
72 | do{ \
73 | if((exp) == false) \
74 | { \
75 | LOG_ALVR_ERROR(err, text);\
76 | return (err); \
77 | } \
78 | }while(0)
79 |
80 | #define CHECK_ALVR_ERROR_RETURN(err, text) \
81 | do{ \
82 | if((err) != ALVR_OK) \
83 | { \
84 | LOG_ALVR_ERROR(err, text);\
85 | return (err); \
86 | } \
87 | }while(0)
88 |
89 | #define CHECK_HRESULT_ERROR_RETURN(err, text) \
90 | do{ \
91 | if(FAILED(err)) \
92 | { \
93 | LOG_WRITE(text << L" HRESULT Error: " << std::hex << err << std::endl, LogTypeError); \
94 | return ALVR_FAIL; \
95 | } \
96 | }while(0)
97 |
98 |
99 |
--------------------------------------------------------------------------------
/samples/common/inc/MGPUAffinity.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 | #include
25 | #include
26 | #include "DXUT.h"
27 |
28 | //--------------------------------------------------------------------------------------
29 | // AMD LiquidVR AffinityGPUControl Extension
30 | //--------------------------------------------------------------------------------------
31 | #include "../../../inc/LiquidVR.h"
32 |
33 | enum GpuMask
34 | {
35 | GPUMASK_LEFT = 0x1,
36 | GPUMASK_RIGHT = 0x2,
37 | GPUMASK_BOTH = (GPUMASK_LEFT | GPUMASK_RIGHT)
38 | };
39 |
40 | enum TransferSyncMode
41 | {
42 | TRANSFER_SYNC_AUTOMATIC = 0,
43 | TRANSFER_SYNC_MANUAL = 1,
44 | TRANSFER_SYNC_NONE = 2,
45 | };
46 |
47 | class MGPUAffinity
48 | {
49 | public:
50 |
51 | MGPUAffinity();
52 | virtual ~MGPUAffinity();
53 |
54 | virtual HRESULT Init(ALVRGpuAffinity *pAffinity, ID3D11Device** ppd3dDevice, ID3D11DeviceContext** pd3dImmediateContext);
55 | virtual HRESULT Terminate();
56 |
57 | virtual HRESULT CreateSyncObjects(ALVRDeviceExD3D11* pLiquidVrDevice);
58 |
59 | virtual HRESULT SetRenderGpuMask(GpuMask mask);
60 | virtual HRESULT SetupViewport(ID3D11DeviceContext* pd3dImmediateContext, GpuMask mask, float fbWidth, float fbHeight);
61 |
62 | GpuMask GetCurrentMask();
63 | void SetUseAffinity(bool bUse);
64 | bool GetUseAffinity();
65 | TransferSyncMode GetSyncType();
66 | void SetSyncType(TransferSyncMode eMode);
67 |
68 | void TransferRightEye(ID3D11DeviceContext* pd3dImmediateContext, float fbWidth, float fbHeight);
69 | void MarkResourceAsInstanced(ID3D11Resource* pResource);
70 |
71 | bool IsEnabled(){ return m_pLiquidVrDeviceContext != NULL; }
72 |
73 | protected:
74 | ALVRDeviceExD3D11* m_pLiquidVrDevice;
75 | ALVRMultiGpuDeviceContext* m_pLiquidVrDeviceContext;
76 | bool m_bUseAffinity;
77 | GpuMask m_eCurrentMask;
78 | TransferSyncMode m_eTransferSyncMode;
79 |
80 | ALVRGpuSemaphore* m_pRenderComplete0;
81 | ALVRGpuSemaphore* m_pTransferComplete0;
82 | ALVRGpuSemaphore* m_pRenderComplete1;
83 | ALVRGpuSemaphore* m_pTransferComplete1;
84 | bool m_bFrameLoop;
85 |
86 | };
87 |
--------------------------------------------------------------------------------
/samples/dxut/Core/DDSTextureLoader.h:
--------------------------------------------------------------------------------
1 | //--------------------------------------------------------------------------------------
2 | // File: DDSTextureLoader.h
3 | //
4 | // Functions for loading a DDS texture and creating a Direct3D 11 runtime resource for it
5 | //
6 | // Note these functions are useful as a light-weight runtime loader for DDS files. For
7 | // a full-featured DDS file reader, writer, and texture processing pipeline see
8 | // the 'Texconv' sample and the 'DirectXTex' library.
9 | //
10 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
11 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
12 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
13 | // PARTICULAR PURPOSE.
14 | //
15 | // Copyright (c) Microsoft Corporation. All rights reserved.
16 | //
17 | // http://go.microsoft.com/fwlink/?LinkId=248926
18 | // http://go.microsoft.com/fwlink/?LinkId=248929
19 | //--------------------------------------------------------------------------------------
20 |
21 | #ifdef _MSC_VER
22 | #pragma once
23 | #endif
24 |
25 | #include
26 |
27 | #pragma warning(push)
28 | #pragma warning(disable : 4005)
29 | #include
30 | #pragma warning(pop)
31 |
32 | #if defined(_MSC_VER) && (_MSC_VER<1610) && !defined(_In_reads_)
33 | #define _In_reads_(exp)
34 | #define _Out_writes_(exp)
35 | #define _In_reads_bytes_(exp)
36 | #define _Outptr_opt_
37 | #endif
38 |
39 | #ifndef _Use_decl_annotations_
40 | #define _Use_decl_annotations_
41 | #endif
42 |
43 | namespace DirectX
44 | {
45 | enum DDS_ALPHA_MODE
46 | {
47 | DDS_ALPHA_MODE_UNKNOWN = 0,
48 | DDS_ALPHA_MODE_STRAIGHT = 1,
49 | DDS_ALPHA_MODE_PREMULTIPLIED = 2,
50 | DDS_ALPHA_MODE_OPAQUE = 3,
51 | DDS_ALPHA_MODE_CUSTOM = 4,
52 | };
53 |
54 | HRESULT CreateDDSTextureFromMemory( _In_ ID3D11Device* d3dDevice,
55 | _In_reads_bytes_(ddsDataSize) const uint8_t* ddsData,
56 | _In_ size_t ddsDataSize,
57 | _Outptr_opt_ ID3D11Resource** texture,
58 | _Outptr_opt_ ID3D11ShaderResourceView** textureView,
59 | _In_ size_t maxsize = 0,
60 | _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr
61 | );
62 |
63 | HRESULT CreateDDSTextureFromFile( _In_ ID3D11Device* d3dDevice,
64 | _In_z_ const wchar_t* szFileName,
65 | _Outptr_opt_ ID3D11Resource** texture,
66 | _Outptr_opt_ ID3D11ShaderResourceView** textureView,
67 | _In_ size_t maxsize = 0,
68 | _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr
69 | );
70 |
71 | HRESULT CreateDDSTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice,
72 | _In_reads_bytes_(ddsDataSize) const uint8_t* ddsData,
73 | _In_ size_t ddsDataSize,
74 | _In_ size_t maxsize,
75 | _In_ D3D11_USAGE usage,
76 | _In_ unsigned int bindFlags,
77 | _In_ unsigned int cpuAccessFlags,
78 | _In_ unsigned int miscFlags,
79 | _In_ bool forceSRGB,
80 | _Outptr_opt_ ID3D11Resource** texture,
81 | _Outptr_opt_ ID3D11ShaderResourceView** textureView,
82 | _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr
83 | );
84 |
85 | HRESULT CreateDDSTextureFromFileEx( _In_ ID3D11Device* d3dDevice,
86 | _In_z_ const wchar_t* szFileName,
87 | _In_ size_t maxsize,
88 | _In_ D3D11_USAGE usage,
89 | _In_ unsigned int bindFlags,
90 | _In_ unsigned int cpuAccessFlags,
91 | _In_ unsigned int miscFlags,
92 | _In_ bool forceSRGB,
93 | _Outptr_opt_ ID3D11Resource** texture,
94 | _Outptr_opt_ ID3D11ShaderResourceView** textureView,
95 | _Out_opt_ DDS_ALPHA_MODE* alphaMode = nullptr
96 | );
97 | }
--------------------------------------------------------------------------------
/samples/dxut/Core/ScreenGrab.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/dxut/Core/ScreenGrab.cpp
--------------------------------------------------------------------------------
/samples/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 | #if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
44 |
45 | HRESULT SaveWICTextureToFile( _In_ ID3D11DeviceContext* pContext,
46 | _In_ ID3D11Resource* pSource,
47 | _In_ REFGUID guidContainerFormat,
48 | _In_z_ LPCWSTR fileName,
49 | _In_opt_ const GUID* targetFormat = nullptr,
50 | _In_opt_ std::function setCustomProps = nullptr );
51 |
52 | #endif
53 | }
--------------------------------------------------------------------------------
/samples/dxut/Core/WICTextureLoader.h:
--------------------------------------------------------------------------------
1 | //--------------------------------------------------------------------------------------
2 | // File: WICTextureLoader.h
3 | //
4 | // Function for loading a WIC image and creating a Direct3D 11 runtime texture for it
5 | // (auto-generating mipmaps if possible)
6 | //
7 | // Note: Assumes application has already called CoInitializeEx
8 | //
9 | // Warning: CreateWICTexture* functions are not thread-safe if given a d3dContext instance for
10 | // auto-gen mipmap support.
11 | //
12 | // Note these functions are useful for images created as simple 2D textures. For
13 | // more complex resources, DDSTextureLoader is an excellent light-weight runtime loader.
14 | // For a full-featured DDS file reader, writer, and texture processing pipeline see
15 | // the 'Texconv' sample and the 'DirectXTex' library.
16 | //
17 | // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
18 | // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
19 | // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
20 | // PARTICULAR PURPOSE.
21 | //
22 | // Copyright (c) Microsoft Corporation. All rights reserved.
23 | //
24 | // http://go.microsoft.com/fwlink/?LinkId=248926
25 | // http://go.microsoft.com/fwlink/?LinkId=248929
26 | //--------------------------------------------------------------------------------------
27 |
28 | #ifdef _MSC_VER
29 | #pragma once
30 | #endif
31 |
32 | #if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
33 | #error WIC is not supported on Windows Phone
34 | #endif
35 |
36 | #include
37 |
38 | #pragma warning(push)
39 | #pragma warning(disable : 4005)
40 | #include
41 | #pragma warning(pop)
42 |
43 | #if defined(_MSC_VER) && (_MSC_VER<1610) && !defined(_In_reads_)
44 | #define _In_reads_(exp)
45 | #define _Out_writes_(exp)
46 | #define _In_reads_bytes_(exp)
47 | #endif
48 |
49 | #ifndef _Use_decl_annotations_
50 | #define _Use_decl_annotations_
51 | #endif
52 |
53 | namespace DirectX
54 | {
55 | HRESULT CreateWICTextureFromMemory( _In_ ID3D11Device* d3dDevice,
56 | _In_opt_ ID3D11DeviceContext* d3dContext,
57 | _In_reads_bytes_(wicDataSize) const uint8_t* wicData,
58 | _In_ size_t wicDataSize,
59 | _Out_opt_ ID3D11Resource** texture,
60 | _Out_opt_ ID3D11ShaderResourceView** textureView,
61 | _In_ size_t maxsize = 0
62 | );
63 |
64 | HRESULT CreateWICTextureFromFile( _In_ ID3D11Device* d3dDevice,
65 | _In_opt_ ID3D11DeviceContext* d3dContext,
66 | _In_z_ const wchar_t* szFileName,
67 | _Out_opt_ ID3D11Resource** texture,
68 | _Out_opt_ ID3D11ShaderResourceView** textureView,
69 | _In_ size_t maxsize = 0
70 | );
71 |
72 | HRESULT CreateWICTextureFromMemoryEx( _In_ ID3D11Device* d3dDevice,
73 | _In_opt_ ID3D11DeviceContext* d3dContext,
74 | _In_reads_bytes_(wicDataSize) const uint8_t* wicData,
75 | _In_ size_t wicDataSize,
76 | _In_ size_t maxsize,
77 | _In_ D3D11_USAGE usage,
78 | _In_ unsigned int bindFlags,
79 | _In_ unsigned int cpuAccessFlags,
80 | _In_ unsigned int miscFlags,
81 | _In_ bool forceSRGB,
82 | _Out_opt_ ID3D11Resource** texture,
83 | _Out_opt_ ID3D11ShaderResourceView** textureView
84 | );
85 |
86 | HRESULT CreateWICTextureFromFileEx( _In_ ID3D11Device* d3dDevice,
87 | _In_opt_ ID3D11DeviceContext* d3dContext,
88 | _In_z_ const wchar_t* szFileName,
89 | _In_ size_t maxsize,
90 | _In_ D3D11_USAGE usage,
91 | _In_ unsigned int bindFlags,
92 | _In_ unsigned int cpuAccessFlags,
93 | _In_ unsigned int miscFlags,
94 | _In_ bool forceSRGB,
95 | _Out_opt_ ID3D11Resource** texture,
96 | _Out_opt_ ID3D11ShaderResourceView** textureView
97 | );
98 | }
--------------------------------------------------------------------------------
/samples/dxut/Core/build/DXUT_2013.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {8e114980-c1a3-4ada-ad7c-83caadf5daeb}
6 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/samples/dxut/Core/dpiaware.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | true
5 |
6 |
7 |
--------------------------------------------------------------------------------
/samples/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 | #ifdef _MSC_VER
17 | #pragma once
18 | #endif
19 |
20 | #include
21 | #include
22 |
23 | #ifdef __cplusplus
24 | extern "C" {
25 | #endif
26 |
27 | //--------------------------------------------------------------------------------------
28 | // DXGetErrorString
29 | //--------------------------------------------------------------------------------------
30 | const WCHAR* WINAPI DXGetErrorStringW( _In_ HRESULT hr );
31 |
32 | #define DXGetErrorString DXGetErrorStringW
33 |
34 | //--------------------------------------------------------------------------------------
35 | // DXGetErrorDescription has to be modified to return a copy in a buffer rather than
36 | // the original static string.
37 | //--------------------------------------------------------------------------------------
38 | void WINAPI DXGetErrorDescriptionW( _In_ HRESULT hr, _Out_cap_(count) WCHAR* desc, _In_ size_t count );
39 |
40 | #define DXGetErrorDescription DXGetErrorDescriptionW
41 |
42 | //--------------------------------------------------------------------------------------
43 | // DXTrace
44 | //
45 | // Desc: Outputs a formatted error message to the debug stream
46 | //
47 | // Args: WCHAR* strFile The current file, typically passed in using the
48 | // __FILEW__ macro.
49 | // DWORD dwLine The current line number, typically passed in using the
50 | // __LINE__ macro.
51 | // HRESULT hr An HRESULT that will be traced to the debug stream.
52 | // CHAR* strMsg A string that will be traced to the debug stream (may be NULL)
53 | // BOOL bPopMsgBox If TRUE, then a message box will popup also containing the passed info.
54 | //
55 | // Return: The hr that was passed in.
56 | //--------------------------------------------------------------------------------------
57 | HRESULT WINAPI DXTraceW( _In_z_ const WCHAR* strFile, _In_ DWORD dwLine, _In_ HRESULT hr, _In_opt_ const WCHAR* strMsg, _In_ bool bPopMsgBox );
58 |
59 | #define DXTrace DXTraceW
60 |
61 | //--------------------------------------------------------------------------------------
62 | //
63 | // Helper macros
64 | //
65 | //--------------------------------------------------------------------------------------
66 | #if defined(DEBUG) || defined(_DEBUG)
67 | #define DXTRACE_MSG(str) DXTrace( __FILEW__, (DWORD)__LINE__, 0, str, false )
68 | #define DXTRACE_ERR(str,hr) DXTrace( __FILEW__, (DWORD)__LINE__, hr, str, false )
69 | #define DXTRACE_ERR_MSGBOX(str,hr) DXTrace( __FILEW__, (DWORD)__LINE__, hr, str, true )
70 | #else
71 | #define DXTRACE_MSG(str) (0L)
72 | #define DXTRACE_ERR(str,hr) (hr)
73 | #define DXTRACE_ERR_MSGBOX(str,hr) (hr)
74 | #endif
75 |
76 | #ifdef __cplusplus
77 | }
78 | #endif //__cplusplus
79 |
--------------------------------------------------------------------------------
/samples/dxut/Optional/DXUTguiIME.h:
--------------------------------------------------------------------------------
1 | //--------------------------------------------------------------------------------------
2 | // File: DXUTguiIME.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 | #include
17 | #include "ImeUi.h"
18 |
19 | //--------------------------------------------------------------------------------------
20 | // Forward declarations
21 | //--------------------------------------------------------------------------------------
22 | class CDXUTIMEEditBox;
23 |
24 |
25 | //-----------------------------------------------------------------------------
26 | // IME-enabled EditBox control
27 | //-----------------------------------------------------------------------------
28 | #define MAX_COMPSTRING_SIZE 256
29 |
30 |
31 | class CDXUTIMEEditBox : public CDXUTEditBox
32 | {
33 | public:
34 |
35 | static HRESULT CreateIMEEditBox( _In_ CDXUTDialog* pDialog, _In_ int ID, _In_z_ LPCWSTR strText, _In_ int x, _In_ int y, _In_ int width,
36 | _In_ int height, _In_ bool bIsDefault=false, _Outptr_opt_ CDXUTIMEEditBox** ppCreated=nullptr );
37 |
38 | CDXUTIMEEditBox( _In_opt_ CDXUTDialog* pDialog = nullptr );
39 | virtual ~CDXUTIMEEditBox();
40 |
41 | static void InitDefaultElements( _In_ CDXUTDialog* pDialog );
42 |
43 | static void WINAPI Initialize( _In_ HWND hWnd );
44 | static void WINAPI Uninitialize();
45 |
46 | static HRESULT WINAPI StaticOnCreateDevice();
47 | static bool WINAPI StaticMsgProc( _In_ HWND hWnd, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam );
48 |
49 | static void WINAPI SetImeEnableFlag( _In_ bool bFlag );
50 |
51 | virtual void Render( _In_ float fElapsedTime ) override;
52 | virtual bool MsgProc( _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam ) override;
53 | virtual bool HandleMouse( _In_ UINT uMsg, _In_ const POINT& pt, _In_ WPARAM wParam, _In_ LPARAM lParam ) override;
54 | virtual void UpdateRects() override;
55 | virtual void OnFocusIn() override;
56 | virtual void OnFocusOut() override;
57 |
58 | void PumpMessage();
59 |
60 | virtual void RenderCandidateReadingWindow( _In_ bool bReading );
61 | virtual void RenderComposition();
62 | virtual void RenderIndicator( _In_ float fElapsedTime );
63 |
64 | protected:
65 | static void WINAPI EnableImeSystem( _In_ bool bEnable );
66 |
67 | static WORD WINAPI GetLanguage()
68 | {
69 | return ImeUi_GetLanguage();
70 | }
71 | static WORD WINAPI GetPrimaryLanguage()
72 | {
73 | return ImeUi_GetPrimaryLanguage();
74 | }
75 | static void WINAPI SendKey( _In_ BYTE nVirtKey );
76 | static DWORD WINAPI GetImeId( _In_ UINT uIndex = 0 )
77 | {
78 | return ImeUi_GetImeId( uIndex );
79 | };
80 | static void WINAPI CheckInputLocale();
81 | static void WINAPI CheckToggleState();
82 | static void WINAPI SetupImeApi();
83 | static void WINAPI ResetCompositionString();
84 |
85 |
86 | static void SetupImeUiCallback();
87 |
88 | protected:
89 | enum
90 | {
91 | INDICATOR_NON_IME,
92 | INDICATOR_CHS,
93 | INDICATOR_CHT,
94 | INDICATOR_KOREAN,
95 | INDICATOR_JAPANESE
96 | };
97 |
98 | struct CCandList
99 | {
100 | CUniBuffer HoriCand; // Candidate list string (for horizontal candidate window)
101 | int nFirstSelected; // First character position of the selected string in HoriCand
102 | int nHoriSelectedLen; // Length of the selected string in HoriCand
103 | RECT rcCandidate; // Candidate rectangle computed and filled each time before rendered
104 | };
105 |
106 | static POINT s_ptCompString; // Composition string position. Updated every frame.
107 | static int s_nFirstTargetConv; // Index of the first target converted char in comp string. If none, -1.
108 | static CUniBuffer s_CompString; // Buffer to hold the composition string (we fix its length)
109 | static DWORD s_adwCompStringClause[MAX_COMPSTRING_SIZE];
110 | static CCandList s_CandList; // Data relevant to the candidate list
111 | static WCHAR s_wszReadingString[32];// Used only with horizontal reading window (why?)
112 | static bool s_bImeFlag; // Is ime enabled
113 |
114 | // Color of various IME elements
115 | DWORD m_ReadingColor; // Reading string color
116 | DWORD m_ReadingWinColor; // Reading window color
117 | DWORD m_ReadingSelColor; // Selected character in reading string
118 | DWORD m_ReadingSelBkColor; // Background color for selected char in reading str
119 | DWORD m_CandidateColor; // Candidate string color
120 | DWORD m_CandidateWinColor; // Candidate window color
121 | DWORD m_CandidateSelColor; // Selected candidate string color
122 | DWORD m_CandidateSelBkColor; // Selected candidate background color
123 | DWORD m_CompColor; // Composition string color
124 | DWORD m_CompWinColor; // Composition string window color
125 | DWORD m_CompCaretColor; // Composition string caret color
126 | DWORD m_CompTargetColor; // Composition string target converted color
127 | DWORD m_CompTargetBkColor; // Composition string target converted background
128 | DWORD m_CompTargetNonColor; // Composition string target non-converted color
129 | DWORD m_CompTargetNonBkColor;// Composition string target non-converted background
130 | DWORD m_IndicatorImeColor; // Indicator text color for IME
131 | DWORD m_IndicatorEngColor; // Indicator text color for English
132 | DWORD m_IndicatorBkColor; // Indicator text background color
133 |
134 | // Edit-control-specific data
135 | int m_nIndicatorWidth; // Width of the indicator symbol
136 | RECT m_rcIndicator; // Rectangle for drawing the indicator button
137 |
138 | #if defined(DEBUG) || defined(_DEBUG)
139 | static bool m_bIMEStaticMsgProcCalled;
140 | #endif
141 | };
142 |
--------------------------------------------------------------------------------
/samples/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 |
--------------------------------------------------------------------------------
/samples/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 | 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 |
--------------------------------------------------------------------------------
/samples/dxut/Optional/build/DXUTOpt_2013.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {8e114980-c1a3-4ada-ad7c-83caadf5daeb}
6 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/samples/dxut/Optional/directx.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/LiquidVR/3a8277ecd8c1eeece3db4e99776b4e1c3d3dc209/samples/dxut/Optional/directx.ico
--------------------------------------------------------------------------------
/samples/dxut/Windows81SDKVS12_x32.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\x86;$(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 |
--------------------------------------------------------------------------------
/samples/dxut/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 |
--------------------------------------------------------------------------------
/samples/dxut/Windows81SDK_x32.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | $(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;$(VCInstallDir)atlmfc\lib;$(ProgramFiles)\Windows Kits\8.1\lib\winv6.3\um\x86;$(FrameworkSDKDir)\lib\x86
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 |
--------------------------------------------------------------------------------
/samples/dxut/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 |
--------------------------------------------------------------------------------
/samples/dxut/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 |
--------------------------------------------------------------------------------