Skip to content

Commit 46b2d01

Browse files
first commit
0 parents  commit 46b2d01

25 files changed

+3179
-0
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "libs/cauldron"]
2+
path = libs/cauldron
3+
url = https://github.com/GPUOpen-LibrariesAndSDKs/Cauldron.git

CMakeLists.txt

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
cmake_minimum_required(VERSION 3.4)
2+
set(CMAKE_GENERATOR_PLATFORM x64)
3+
4+
project (GLTFSample_${GFX_API})
5+
6+
# ouput exe to bin directory
7+
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/bin)
8+
foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} )
9+
string( TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG )
10+
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_HOME_DIRECTORY}/bin )
11+
endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES )
12+
13+
# reference libs used by both backends
14+
add_subdirectory(libs/cauldron)
15+
16+
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME})
17+
18+
if(GFX_API STREQUAL DX12)
19+
add_subdirectory(src/DX12)
20+
elseif(GFX_API STREQUAL VK)
21+
find_package(Vulkan REQUIRED)
22+
add_subdirectory(src/VK)
23+
else()
24+
message(STATUS "----------------------------------------------------------------------------------------")
25+
message(STATUS "")
26+
message(STATUS "** Almost there!!")
27+
message(STATUS "")
28+
message(STATUS " This framework supports DX12 or VULKAN, you need to invoke cmake in one of these ways:")
29+
message(STATUS "")
30+
message(STATUS " Examples:")
31+
message(STATUS " cmake <project_root_dir> -DGFX_API=DX12")
32+
message(STATUS " cmake <project_root_dir> -DGFX_API=VK")
33+
message(STATUS "")
34+
message(STATUS "----------------------------------------------------------------------------------------")
35+
message(FATAL_ERROR "")
36+
endif()
37+

NOTICES.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Notices and licenses file
2+
_________________________
3+
4+
5+
AMD copyrighted code (MIT)
6+
Copyright (c) 2019 Advanced Micro Devices, Inc. All rights reserved.
7+
8+
Permission is hereby granted, free of charge, to any person obtaining a copy
9+
of this software and associated documentation files (the "Software"), to deal
10+
in the Software without restriction, including without limitation the rights
11+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
copies of the Software, and to permit persons to whom the Software is
13+
furnished to do so, subject to the following conditions:
14+
15+
The above copyright notice and this permission notice shall be included in
16+
all copies or substantial portions of the Software.
17+
18+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
THE SOFTWARE.

build/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
DX12/
2+
VK/

build/GenerateSolutions.bat

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
mkdir DX12
2+
cd DX12
3+
cmake ..\.. -DGFX_API=DX12
4+
cd ..
5+
6+
mkdir VK
7+
cd VK
8+
cmake ..\.. -DGFX_API=VK
9+
cd ..

libs/cauldron

Submodule cauldron added at 8530be0

license.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2019 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.

readme.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# glTFSample
2+
3+
A simple but cute demo to show off the capabilities of the [Cauldron framework](https://github.com/GPUOpen-LibrariesAndSDKs/Cauldron).
4+
5+
![Screenshot](screenshot.png)
6+
7+
# Build Instructions
8+
9+
### Prerequisites
10+
11+
To build glTFSample, you must first install the following tools:
12+
13+
- [CMake 3.4](https://cmake.org/download/)
14+
- [Visual Studio 2017](https://visualstudio.microsoft.com/downloads/)
15+
- [Windows 10 SDK 10.0.17763.0](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk)
16+
- [Vulkan SDK 1.1.106](https://www.lunarg.com/vulkan-sdk/)
17+
18+
Then follow the next steps:
19+
20+
1) Get the media files:
21+
```
22+
> git clone https://github.com/GPUOpen-LibrariesAndSDKs/Cauldron-Media.git
23+
```
24+
25+
2) Clone the repo with its submodules:
26+
```
27+
> git clone https://github.com/GPUOpen-LibrariesAndSDKs/glTFSample.git --recurse-submodules
28+
```
29+
30+
3) Generate the solutions:
31+
```
32+
> cd glTFSample\build
33+
> GenerateSolutions.bat
34+
```
35+
36+
4) Open the solutions in the VK or DX12 directories, compile and run.
37+

screenshot.png

1.38 MB
Loading

src/DX12/CMakeLists.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
project (GLTFSample_DX12)
2+
3+
add_compile_options(/MP)
4+
5+
set(sources
6+
GLTFSample.cpp
7+
GLTFSample.h
8+
SampleRenderer.cpp
9+
SampleRenderer.h
10+
stdafx.cpp
11+
stdafx.h)
12+
13+
source_group("Sources" FILES ${sources})
14+
15+
add_executable(${PROJECT_NAME} WIN32 ${sources})
16+
target_link_libraries (${PROJECT_NAME} LINK_PUBLIC Framework_DX12 ImGUI amd_ags DXC)
17+
18+
set_target_properties(${PROJECT_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}/bin")
19+
20+
21+
IF (MSVC)
22+
IF (CMAKE_MAJOR_VERSION LESS 3)
23+
MESSAGE(WARNING "CMake version 3.0 or newer is required use build variable TARGET_FILE")
24+
ELSE()
25+
ADD_CUSTOM_COMMAND(
26+
TARGET ${PROJECT_NAME}
27+
POST_BUILD
28+
COMMAND "mt.exe" -manifest \"${CMAKE_CURRENT_SOURCE_DIR}\\dpiawarescaling.manifest\" -inputresource:\"$<TARGET_FILE:${PROJECT_NAME}>\"\;\#1 -outputresource:\"$<TARGET_FILE:${PROJECT_NAME}>\"\;\#1
29+
COMMENT "Adding display aware manifest..."
30+
)
31+
ENDIF()
32+
ENDIF(MSVC)

0 commit comments

Comments
 (0)