Skip to content

Commit deed560

Browse files
Update (wk #48)
2 parents ee2326c + 66855cd commit deed560

1,882 files changed

Lines changed: 349981 additions & 5874 deletions

File tree

Some content is hidden

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

CMakeLists.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho
6464
"${Anvil_SOURCE_DIR}/include/misc/compute_pipeline_create_info.h"
6565
"${Anvil_SOURCE_DIR}/include/misc/debug.h"
6666
"${Anvil_SOURCE_DIR}/include/misc/debug_marker.h"
67+
"${Anvil_SOURCE_DIR}/include/misc/debug_messenger_create_info.h"
6768
"${Anvil_SOURCE_DIR}/include/misc/descriptor_set_create_info.h"
6869
"${Anvil_SOURCE_DIR}/include/misc/dummy_window.h"
6970
"${Anvil_SOURCE_DIR}/include/misc/event_create_info.h"
@@ -106,6 +107,7 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho
106107
"${Anvil_SOURCE_DIR}/include/wrappers/command_buffer.h"
107108
"${Anvil_SOURCE_DIR}/include/wrappers/command_pool.h"
108109
"${Anvil_SOURCE_DIR}/include/wrappers/compute_pipeline_manager.h"
110+
"${Anvil_SOURCE_DIR}/include/wrappers/debug_messenger.h"
109111
"${Anvil_SOURCE_DIR}/include/wrappers/descriptor_pool.h"
110112
"${Anvil_SOURCE_DIR}/include/wrappers/descriptor_set.h"
111113
"${Anvil_SOURCE_DIR}/include/wrappers/descriptor_set_group.h"
@@ -143,6 +145,7 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho
143145
"${Anvil_SOURCE_DIR}/src/misc/compute_pipeline_create_info.cpp"
144146
"${Anvil_SOURCE_DIR}/src/misc/debug.cpp"
145147
"${Anvil_SOURCE_DIR}/src/misc/debug_marker.cpp"
148+
"${Anvil_SOURCE_DIR}/src/misc/debug_messenger_create_info.cpp"
146149
"${Anvil_SOURCE_DIR}/src/misc/descriptor_set_create_info.cpp"
147150
"${Anvil_SOURCE_DIR}/src/misc/dummy_window.cpp"
148151
"${Anvil_SOURCE_DIR}/src/misc/external_handle.cpp"
@@ -179,6 +182,7 @@ SET (SRC_LIST "${Anvil_SOURCE_DIR}/include/misc/memalloc_backends/backend_onesho
179182
"${Anvil_SOURCE_DIR}/src/wrappers/command_buffer.cpp"
180183
"${Anvil_SOURCE_DIR}/src/wrappers/command_pool.cpp"
181184
"${Anvil_SOURCE_DIR}/src/wrappers/compute_pipeline_manager.cpp"
185+
"${Anvil_SOURCE_DIR}/src/wrappers/debug_messenger.cpp"
182186
"${Anvil_SOURCE_DIR}/src/wrappers/descriptor_pool.cpp"
183187
"${Anvil_SOURCE_DIR}/src/wrappers/descriptor_set.cpp"
184188
"${Anvil_SOURCE_DIR}/src/wrappers/descriptor_set_group.cpp"
@@ -237,13 +241,13 @@ add_library(Anvil STATIC ${SRC_LIST})
237241

238242
if (WIN32)
239243
if (ANVIL_LINK_WITH_GLSLANG)
240-
target_link_libraries(Anvil glslang HLSL OGLCompiler OSDependent SPIRV ${VULKAN_LIBRARY})
244+
target_link_libraries(Anvil glslang OGLCompiler OSDependent SPIRV ${VULKAN_LIBRARY})
241245
else()
242246
target_link_libraries(Anvil ${VULKAN_LIBRARY})
243247
endif()
244248
else()
245249
if (ANVIL_LINK_WITH_GLSLANG)
246-
target_link_libraries(Anvil glslang HLSL OGLCompiler OSDependent SPIRV ${VULKAN_LIBRARY} pthread)
250+
target_link_libraries(Anvil glslang OGLCompiler OSDependent SPIRV ${VULKAN_LIBRARY} pthread)
247251
else()
248252
target_link_libraries(Anvil ${VULKAN_LIBRARY} pthread)
249253
endif()
@@ -256,7 +260,10 @@ else()
256260
endif()
257261

258262
if (ANVIL_LINK_WITH_GLSLANG)
259-
# Add dependendencies
263+
set(BUILD_TESTING OFF CACHE BOOL ".." FORCE)
264+
set(ENABLE_HLSL OFF CACHE BOOL ".." FORCE)
265+
set(ENABLE_OPT OFF CACHE BOOL ".." FORCE)
266+
260267
if (WIN32)
261268
add_subdirectory("deps\\glslang")
262269
else()

deps/glslang/.gitattributes

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,15 @@
33
# (scripts often don't have a suffix)
44
* -text
55
*.sh text eof=lf
6-
*.bash text eof=lf
76

87
# txt files should be native and normalized
98
*.txt text
109

1110
# source code can be native and normalized, but simpler if lf everywhere; will try that way
1211
*.h text eof=lf
13-
*.hpp text eof=lf
1412
*.c text eof=lf
1513
*.cpp text eof=lf
1614
*.y text eof=lf
1715
*.out text eof=lf
1816
*.conf text eof=lf
1917
*.err text eof=lf
20-
*.php text eof=lf
21-
*.template text eof=lf

deps/glslang/.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
*.so
44
*.exe
55
tags
6-
glslang/MachineIndependent/glslang_tab.cpp
7-
glslang/MachineIndependent/glslang_tab.cpp.h
6+
TAGS
87
build/
98
Test/localResults/
10-
Test/multiThread.out
11-
Test/singleThread.out
9+
External/googletest
10+
External/spirv-tools

deps/glslang/BUILD.gn

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# Copyright (C) 2018 Google, Inc.
2+
#
3+
# All rights reserved.
4+
#
5+
# Redistribution and use in source and binary forms, with or without
6+
# modification, are permitted provided that the following conditions
7+
# are met:
8+
#
9+
# Redistributions of source code must retain the above copyright
10+
# notice, this list of conditions and the following disclaimer.
11+
#
12+
# Redistributions in binary form must reproduce the above
13+
# copyright notice, this list of conditions and the following
14+
# disclaimer in the documentation and/or other materials provided
15+
# with the distribution.
16+
#
17+
# Neither the name of Google Inc. nor the names of its
18+
# contributors may be used to endorse or promote products derived
19+
# from this software without specific prior written permission.
20+
#
21+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24+
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25+
# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26+
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27+
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30+
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31+
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32+
# POSSIBILITY OF SUCH DAMAGE.
33+
34+
import("//build_overrides/glslang.gni")
35+
36+
spirv_tools_dir = glslang_spirv_tools_dir
37+
38+
config("glslang_public") {
39+
include_dirs = [ "." ]
40+
}
41+
42+
source_set("glslang_sources") {
43+
public_configs = [ ":glslang_public" ]
44+
45+
sources = [
46+
"OGLCompilersDLL/InitializeDll.cpp",
47+
"OGLCompilersDLL/InitializeDll.h",
48+
"SPIRV/GLSL.ext.EXT.h",
49+
"SPIRV/GLSL.ext.KHR.h",
50+
"SPIRV/GLSL.std.450.h",
51+
"SPIRV/GlslangToSpv.cpp",
52+
"SPIRV/GlslangToSpv.h",
53+
"SPIRV/InReadableOrder.cpp",
54+
"SPIRV/Logger.cpp",
55+
"SPIRV/Logger.h",
56+
"SPIRV/SPVRemapper.cpp",
57+
"SPIRV/SPVRemapper.h",
58+
"SPIRV/SpvBuilder.cpp",
59+
"SPIRV/SpvBuilder.h",
60+
"SPIRV/SpvPostProcess.cpp",
61+
"SPIRV/bitutils.h",
62+
"SPIRV/disassemble.cpp",
63+
"SPIRV/disassemble.h",
64+
"SPIRV/doc.cpp",
65+
"SPIRV/doc.h",
66+
"SPIRV/hex_float.h",
67+
"SPIRV/spirv.hpp",
68+
"SPIRV/spvIR.h",
69+
"glslang/GenericCodeGen/CodeGen.cpp",
70+
"glslang/GenericCodeGen/Link.cpp",
71+
"glslang/Include/BaseTypes.h",
72+
"glslang/Include/Common.h",
73+
"glslang/Include/ConstantUnion.h",
74+
"glslang/Include/InfoSink.h",
75+
"glslang/Include/InitializeGlobals.h",
76+
"glslang/Include/PoolAlloc.h",
77+
"glslang/Include/ResourceLimits.h",
78+
"glslang/Include/ShHandle.h",
79+
"glslang/Include/Types.h",
80+
"glslang/Include/arrays.h",
81+
"glslang/Include/intermediate.h",
82+
"glslang/Include/revision.h",
83+
"glslang/MachineIndependent/Constant.cpp",
84+
"glslang/MachineIndependent/InfoSink.cpp",
85+
"glslang/MachineIndependent/Initialize.cpp",
86+
"glslang/MachineIndependent/Initialize.h",
87+
"glslang/MachineIndependent/IntermTraverse.cpp",
88+
"glslang/MachineIndependent/Intermediate.cpp",
89+
"glslang/MachineIndependent/LiveTraverser.h",
90+
"glslang/MachineIndependent/ParseContextBase.cpp",
91+
"glslang/MachineIndependent/ParseHelper.cpp",
92+
"glslang/MachineIndependent/ParseHelper.h",
93+
"glslang/MachineIndependent/PoolAlloc.cpp",
94+
"glslang/MachineIndependent/RemoveTree.cpp",
95+
"glslang/MachineIndependent/RemoveTree.h",
96+
"glslang/MachineIndependent/Scan.cpp",
97+
"glslang/MachineIndependent/Scan.h",
98+
"glslang/MachineIndependent/ScanContext.h",
99+
"glslang/MachineIndependent/ShaderLang.cpp",
100+
"glslang/MachineIndependent/SymbolTable.cpp",
101+
"glslang/MachineIndependent/SymbolTable.h",
102+
"glslang/MachineIndependent/Versions.cpp",
103+
"glslang/MachineIndependent/Versions.h",
104+
"glslang/MachineIndependent/attribute.cpp",
105+
"glslang/MachineIndependent/attribute.h",
106+
"glslang/MachineIndependent/gl_types.h",
107+
"glslang/MachineIndependent/glslang.y",
108+
"glslang/MachineIndependent/glslang_tab.cpp",
109+
"glslang/MachineIndependent/glslang_tab.cpp.h",
110+
"glslang/MachineIndependent/intermOut.cpp",
111+
"glslang/MachineIndependent/iomapper.cpp",
112+
"glslang/MachineIndependent/iomapper.h",
113+
"glslang/MachineIndependent/limits.cpp",
114+
"glslang/MachineIndependent/linkValidate.cpp",
115+
"glslang/MachineIndependent/localintermediate.h",
116+
"glslang/MachineIndependent/parseConst.cpp",
117+
"glslang/MachineIndependent/parseVersions.h",
118+
"glslang/MachineIndependent/preprocessor/Pp.cpp",
119+
"glslang/MachineIndependent/preprocessor/PpAtom.cpp",
120+
"glslang/MachineIndependent/preprocessor/PpContext.cpp",
121+
"glslang/MachineIndependent/preprocessor/PpContext.h",
122+
"glslang/MachineIndependent/preprocessor/PpScanner.cpp",
123+
"glslang/MachineIndependent/preprocessor/PpTokens.cpp",
124+
"glslang/MachineIndependent/preprocessor/PpTokens.h",
125+
"glslang/MachineIndependent/propagateNoContraction.cpp",
126+
"glslang/MachineIndependent/propagateNoContraction.h",
127+
"glslang/MachineIndependent/reflection.cpp",
128+
"glslang/MachineIndependent/reflection.h",
129+
"glslang/OSDependent/osinclude.h",
130+
"glslang/Public/ShaderLang.h",
131+
]
132+
133+
defines = []
134+
if (is_win) {
135+
sources += [ "glslang/OSDependent/Windows/ossource.cpp" ]
136+
defines += [ "GLSLANG_OSINCLUDE_WIN32" ]
137+
} else {
138+
sources += [ "glslang/OSDependent/Unix/ossource.cpp" ]
139+
defines += [ "GLSLANG_OSINCLUDE_UNIX" ]
140+
}
141+
142+
if (is_clang) {
143+
cflags_cc = [
144+
"-Wno-implicit-fallthrough",
145+
"-Wno-ignored-qualifiers",
146+
"-Wno-unused-variable",
147+
]
148+
}
149+
150+
deps = [
151+
"${spirv_tools_dir}:spvtools_opt",
152+
]
153+
}

deps/glslang/CMakeLists.txt

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,57 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
99
# Adhere to GNU filesystem layout conventions
1010
include(GNUInstallDirs)
1111

12+
option(BUILD_SHARED_LIBS "Build Shared Libraries" OFF)
13+
14+
set(LIB_TYPE STATIC)
15+
16+
if(BUILD_SHARED_LIBS)
17+
set(LIB_TYPE SHARED)
18+
endif()
19+
1220
option(SKIP_GLSLANG_INSTALL "Skip installation" ${SKIP_GLSLANG_INSTALL})
1321
if(NOT ${SKIP_GLSLANG_INSTALL})
1422
set(ENABLE_GLSLANG_INSTALL ON)
1523
endif()
24+
option(ENABLE_SPVREMAPPER "Enables building of SPVRemapper" ON)
1625

1726
option(ENABLE_AMD_EXTENSIONS "Enables support of AMD-specific extensions" ON)
18-
option(ENABLE_GLSLANG_BINARIES "Builds glslangValidator and spirv-remap" OFF)
27+
option(ENABLE_GLSLANG_BINARIES "Builds glslangValidator and spirv-remap" ON)
1928

2029
option(ENABLE_NV_EXTENSIONS "Enables support of Nvidia-specific extensions" ON)
2130

2231
option(ENABLE_HLSL "Enables HLSL input support" ON)
2332

24-
option(ENABLE_OPT "Enables spirv-opt capability if present" OFF)
33+
option(ENABLE_OPT "Enables spirv-opt capability if present" ON)
2534

2635
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND WIN32)
2736
set(CMAKE_INSTALL_PREFIX "install" CACHE STRING "..." FORCE)
2837
endif()
2938

39+
option(USE_CCACHE "Use ccache" OFF)
40+
if(USE_CCACHE)
41+
find_program(CCACHE_FOUND ccache)
42+
if(CCACHE_FOUND)
43+
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
44+
endif(CCACHE_FOUND)
45+
endif()
46+
47+
# Precompiled header macro. Parameters are source file list and filename for pch cpp file.
48+
macro(glslang_pch SRCS PCHCPP)
49+
if(MSVC)
50+
if (CMAKE_GENERATOR MATCHES "^Visual Studio")
51+
set(PCH_NAME "$(IntDir)\\pch.pch")
52+
else()
53+
set(PCH_NAME "${CMAKE_CURRENT_BINARY_DIR}/pch.pch")
54+
endif()
55+
# make source files use/depend on PCH_NAME
56+
set_source_files_properties(${${SRCS}} PROPERTIES COMPILE_FLAGS "/Yupch.h /FIpch.h /Fp${PCH_NAME} /Zm300" OBJECT_DEPENDS "${PCH_NAME}")
57+
# make PCHCPP file compile and generate PCH_NAME
58+
set_source_files_properties(${PCHCPP} PROPERTIES COMPILE_FLAGS "/Ycpch.h /Fp${PCH_NAME} /Zm300" OBJECT_OUTPUTS "${PCH_NAME}")
59+
list(APPEND ${SRCS} "${PCHCPP}")
60+
endif()
61+
endmacro(glslang_pch)
62+
3063
project(glslang)
3164
# make testing optional
3265
include(CTest)
@@ -44,7 +77,7 @@ if(ENABLE_HLSL)
4477
endif(ENABLE_HLSL)
4578

4679
if(WIN32)
47-
set(CMAKE_DEBUG_POSTFIX "d")
80+
set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Adds a postfix for debug-built libraries.")
4881
if(MSVC)
4982
include(ChooseMSVCCRT.cmake)
5083
endif(MSVC)
@@ -86,17 +119,20 @@ function(glslang_set_link_args TARGET)
86119
endfunction(glslang_set_link_args)
87120

88121
# We depend on these for later projects, so they should come first.
89-
#add_subdirectory(External)
122+
add_subdirectory(External)
90123

91124
if(NOT TARGET SPIRV-Tools-opt)
92125
set(ENABLE_OPT OFF)
93126
endif()
94127

95128
if(ENABLE_OPT)
96129
message(STATUS "optimizer enabled")
97-
add_definitions(-DENABLE_OPT)
98-
elseif(ENABLE_HLSL)
99-
message(STATUS "spirv-tools not linked - illegal SPIRV may be generated for HLSL")
130+
add_definitions(-DENABLE_OPT=1)
131+
else()
132+
if(ENABLE_HLSL)
133+
message(STATUS "spirv-tools not linked - illegal SPIRV may be generated for HLSL")
134+
endif()
135+
add_definitions(-DENABLE_OPT=0)
100136
endif()
101137

102138
add_subdirectory(glslang)
@@ -108,4 +144,4 @@ add_subdirectory(SPIRV)
108144
if(ENABLE_HLSL)
109145
add_subdirectory(hlsl)
110146
endif(ENABLE_HLSL)
111-
#add_subdirectory(gtests)
147+
add_subdirectory(gtests)

deps/glslang/CODE_OF_CONDUCT.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
A reminder that this issue tracker is managed by the Khronos Group. Interactions here should follow the Khronos Code of Conduct (https://www.khronos.org/developers/code-of-conduct), which prohibits aggressive or derogatory language. Please keep the discussion friendly and civil.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Suppress all warnings from external projects.
2+
set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS -w)
3+
4+
if(BUILD_TESTING)
5+
if(TARGET gmock)
6+
message(STATUS "Google Mock already configured - use it")
7+
elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest)
8+
# We need to make sure Google Test does not mess up with the
9+
# global CRT settings on Windows.
10+
if(WIN32)
11+
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
12+
endif(WIN32)
13+
add_subdirectory(googletest)
14+
set(GTEST_TARGETS
15+
gtest
16+
gtest_main
17+
gmock
18+
gmock_main)
19+
foreach(target ${GTEST_TARGETS})
20+
set_property(TARGET ${target} PROPERTY FOLDER gtest)
21+
endforeach()
22+
mark_as_advanced(gmock_build_tests
23+
BUILD_GMOCK
24+
BUILD_GTEST
25+
BUILD_SHARED_LIBS
26+
gtest_build_samples
27+
gtest_build_tests
28+
gtest_disable_pthreads
29+
gtest_force_shared_crt
30+
gtest_hide_internal_symbols)
31+
else()
32+
message(STATUS
33+
"Google Mock was not found - tests based on that will not build")
34+
endif()
35+
endif()
36+
37+
if(ENABLE_OPT AND NOT TARGET SPIRV-Tools-opt)
38+
if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools)
39+
set(SPIRV_SKIP_TESTS ON CACHE BOOL "Skip building SPIRV-Tools tests")
40+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools spirv-tools)
41+
endif()
42+
endif()
43+

0 commit comments

Comments
 (0)