Skip to content
This repository was archived by the owner on Jul 18, 2019. It is now read-only.

Commit c913418

Browse files
committed
Added Vulkan examples sources!
1 parent 367fda1 commit c913418

File tree

868 files changed

+514078
-5582
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

868 files changed

+514078
-5582
lines changed

.gitattributes

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

.gitignore

+34-28
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,35 @@
44
# User-specific files
55
*.suo
66
*.user
7-
*.userosscache
87
*.sln.docstates
98

10-
# User-specific files (MonoDevelop/Xamarin Studio)
11-
*.userprefs
12-
139
# Build results
1410
[Dd]ebug/
1511
[Dd]ebugPublic/
1612
[Rr]elease/
1713
[Rr]eleases/
1814
x64/
19-
x86/
2015
build/
2116
bld/
2217
[Bb]in/
2318
[Oo]bj/
2419

25-
# Visual Studo 2015 cache/options directory
26-
.vs/
20+
# CMake
21+
CMakeCache.txt
22+
CMakeFiles
23+
CMakeScripts
24+
Makefile
25+
cmake_install.cmake
26+
install_manifest.txt
27+
28+
# Roslyn cache directories
29+
*.ide/
2730

2831
# MSTest test Results
2932
[Tt]est[Rr]esult*/
3033
[Bb]uild[Ll]og.*
3134

32-
# NUNIT
35+
#NUNIT
3336
*.VisualState.xml
3437
TestResult.xml
3538

@@ -71,6 +74,7 @@ ipch/
7174
*.aps
7275
*.ncb
7376
*.opensdf
77+
*.opendb
7478
*.sdf
7579
*.cachefile
7680

@@ -129,19 +133,23 @@ publish/
129133
# Publish Web Output
130134
*.[Pp]ublish.xml
131135
*.azurePubxml
132-
# TODO: Comment the next line if you want to checkin your web deploy settings
133-
# but database connection strings (with potential passwords) will be unencrypted
136+
## TODO: Comment the next line if you want to checkin your
137+
## web deploy settings but do note that will include unencrypted
138+
## passwords
134139
*.pubxml
135-
*.publishproj
136140

137141
# NuGet Packages
142+
packages/*
138143
*.nupkg
139-
# The packages folder can be ignored because of Package Restore
140-
**/packages/*
141-
# except build/, which is used as an MSBuild target.
142-
!**/packages/build/
143-
# Uncomment if necessary however generally it will be regenerated when needed
144-
#!**/packages/repositories.config
144+
## TODO: If the tool you use requires repositories.config
145+
## uncomment the next line
146+
#!packages/repositories.config
147+
148+
# Enable "build/" folder in the NuGet Packages folder since
149+
# NuGet packages use it for MSBuild targets.
150+
# This line needs to be after the ignore of the build folder
151+
# (and the packages folder if the line above has been uncommented)
152+
!packages/build/
145153

146154
# Windows Azure Build Output
147155
csx/
@@ -151,7 +159,8 @@ csx/
151159
AppPackages/
152160

153161
# Others
154-
*.[Cc]ache
162+
sql/
163+
*.Cache
155164
ClientBin/
156165
[Ss]tyle[Cc]op.*
157166
~$*
@@ -161,7 +170,6 @@ ClientBin/
161170
*.pfx
162171
*.publishsettings
163172
node_modules/
164-
bower_components/
165173

166174
# RIA/Silverlight projects
167175
Generated_Code/
@@ -186,14 +194,12 @@ UpgradeLog*.htm
186194
# Microsoft Fakes
187195
FakesAssemblies/
188196

189-
# Node.js Tools for Visual Studio
190-
.ntvs_analysis.dat
191-
192-
# Visual Studio 6 build log
193-
*.plg
197+
vulkanCapsViewer/vulkanreport.json
194198

195-
# Visual Studio 6 workspace options file
196-
*.opt
199+
# Don't ignore 3d models in obj format
200+
!data/models/*.obj
201+
!data/models/lowpoly/*.obj
202+
!data/models/voyager/*.obj
197203

198-
# Don't exclude wavefront model files
199-
!models/*.obj
204+
# DLLs in bin
205+
!bin/*.dll

CMakeLists.txt

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
2+
cmake_policy(VERSION 2.8)
3+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "cmake")
4+
5+
set(NAME bloom)
6+
7+
project(${NAME})
8+
9+
include_directories(external)
10+
include_directories(external/glm)
11+
include_directories(external/gli)
12+
include_directories(external/assimp)
13+
include_directories(base)
14+
15+
IF(WIN32)
16+
find_library(VULKAN_LIB NAMES vulkan-1 vulkan PATHS ${CMAKE_SOURCE_DIR}/libs/vulkan)
17+
find_library(ASSIMP_LIB NAMES assimp PATHS ${CMAKE_SOURCE_DIR}/libs/assimp)
18+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DVK_USE_PLATFORM_WIN32_KHR")
19+
ELSE(WIN32)
20+
find_library(VULKAN_LIB NAMES libvulkan.so PATHS ${CMAKE_SOURCE_DIR}/libs/vulkan)
21+
find_library(ASSIMP_LIB NAMES assimp libassimp.dll.a PATHS ${CMAKE_SOURCE_DIR}/libs/assimp)
22+
find_package(XCB REQUIRED)
23+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DVK_USE_PLATFORM_XCB_KHR")
24+
# Todo : android?
25+
ENDIF(WIN32)
26+
27+
message(STATUS ${VULKAN_LIB})
28+
29+
# Set preprocessor defines
30+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOMINMAX -DVK_PROTOTYPES -D_USE_MATH_DEFINES")
31+
32+
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
33+
add_definitions(-std=c++11)
34+
add_definitions(-std=c++0x)
35+
36+
file(GLOB SOURCE *.cpp base/*.cpp)
37+
38+
# Function for building single example
39+
function(buildExample EXAMPLE_NAME)
40+
file(GLOB SOURCE *.cpp base/*.cpp ${EXAMPLE_NAME}/*.cpp)
41+
if(WIN32)
42+
add_executable(${EXAMPLE_NAME} WIN32 ${EXAMPLE_NAME}/${EXAMPLE_NAME}.cpp ${SOURCE})
43+
target_link_libraries(${EXAMPLE_NAME} ${VULKAN_LIB} ${ASSIMP_LIB} ${WINLIBS})
44+
else(WIN32)
45+
add_executable(${EXAMPLE_NAME} ${EXAMPLE_NAME}/${EXAMPLE_NAME}.cpp ${SOURCE})
46+
target_link_libraries(${EXAMPLE_NAME} ${VULKAN_LIB} ${ASSIMP_LIB} ${PTHREAD})
47+
endif(WIN32)
48+
endfunction(buildExample)
49+
50+
# Build all examples
51+
function(buildExamples)
52+
foreach(EXAMPLE ${EXAMPLES})
53+
buildExample(${EXAMPLE})
54+
endforeach(EXAMPLE)
55+
endfunction(buildExamples)
56+
57+
# Compiler specific stuff
58+
IF(MSVC)
59+
SET(CMAKE_CXX_FLAGS "/EHsc")
60+
ENDIF(MSVC)
61+
62+
IF(WIN32)
63+
# Nothing here (yet)
64+
ELSE(WIN32)
65+
link_libraries(${XCB_LIBRARIES} ${VULKAN_LIB})
66+
ENDIF(WIN32)
67+
68+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "bin/")
69+
70+
set(EXAMPLES
71+
bloom
72+
computeshader
73+
computeparticles
74+
deferred
75+
displacement
76+
distancefieldfonts
77+
gears
78+
geometryshader
79+
instancing
80+
mesh
81+
occlusionquery
82+
offscreen
83+
parallaxmapping
84+
pipelines
85+
pushconstants
86+
radialblur
87+
shadowmap
88+
sphericalenvmapping
89+
tessellation
90+
texture
91+
texturearray
92+
texturecubemap
93+
triangle
94+
vulkanscene
95+
)
96+
97+
buildExamples()

LICENSE.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015 Sascha Willems
3+
Copyright (c) 2016 Sascha Willems
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
22-

0 commit comments

Comments
 (0)