aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordan sinclair <dsinclair@google.com>2019-09-17 18:31:03 -0400
committerGitHub <noreply@github.com>2019-09-17 18:31:03 -0400
commit5e6624f6bd5832aedb25e93199125d3230e660e2 (patch)
tree3e60730a1e6f4d04f97d899483700733f7f06ae2
parentf2e192fbdb08355bc50a0930f7a1709e9c665a95 (diff)
downloadamber-5e6624f6bd5832aedb25e93199125d3230e660e2.tar.gz
Add validation layers to local build. (#651)
This CL adds the validation layers into the local vulkan build for Amber. There is a simple shell script to setup these layers when using a debug build. Fixes #539
-rw-r--r--.gitignore1
-rw-r--r--CMakeLists.txt2
-rw-r--r--DEPS4
-rw-r--r--kokoro/android/build.sh12
-rw-r--r--kokoro/scripts/linux/build.sh12
-rw-r--r--kokoro/scripts/linux/build_dawn.sh12
-rw-r--r--setup_debug_local.env3
-rw-r--r--third_party/CMakeLists.txt1
8 files changed, 43 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index 4c176e1..ece4a6b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,6 +12,7 @@ third_party/spirv-tools
third_party/spirv-headers
third_party/swiftshader
third_party/vulkan-headers
+third_party/vulkan-validationlayers/
third_party/vulkan-loader
.vs
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 123bd14..34a5510 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.10.2)
if (POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
endif()
diff --git a/DEPS b/DEPS
index a12f77d..de3da73 100644
--- a/DEPS
+++ b/DEPS
@@ -20,6 +20,7 @@ vars = {
'spirv_tools_revision': 'c0e9807094ef6e345ef0a4d5f17af81af063cd27',
'swiftshader_revision': 'ef44b4402722658648ec9d10a76bd990776be1c0',
'vulkan_headers_revision': 'e3f96a9ccab9397481eb81c4d9bce4ea7590dc33',
+ 'vulkan_validationlayers_revision': '0e65e191c4b9044d8e42727cc82ccc04d8055b0a',
'vulkan_loader_revision': '1bb7f68564fe565de2927071c79008bd6ede5af5',
}
@@ -60,6 +61,9 @@ deps = {
'third_party/vulkan-headers': vars['khronos_git'] + '/Vulkan-Headers.git@' +
vars['vulkan_headers_revision'],
+ 'third_party/vulkan-validationlayers': vars['khronos_git'] + '/Vulkan-ValidationLayers.git@' +
+ vars['vulkan_validationlayers_revision'],
+
'third_party/vulkan-loader': vars['khronos_git'] + '/Vulkan-Loader.git@' +
vars['vulkan_loader_revision'],
}
diff --git a/kokoro/android/build.sh b/kokoro/android/build.sh
index cedf268..b3b2cad 100644
--- a/kokoro/android/build.sh
+++ b/kokoro/android/build.sh
@@ -26,6 +26,18 @@ ANDROID_ABI="armeabi-v7a with NEON"
TOOLCHAIN_PATH=$ANDROID_NDK/build/cmake/android.toolchain.cmake
+# removing the old version
+echo y | sudo apt-get purge --auto-remove cmake
+
+# Installing the 3.10.2 version
+wget http://www.cmake.org/files/v3.10/cmake-3.10.2.tar.gz
+tar -xvzf cmake-3.10.2.tar.gz
+cd cmake-3.10.2/
+./configure
+make
+sudo make install
+echo $(date): $(cmake --version)
+
# Get NINJA.
wget -q https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip
unzip -q ninja-linux.zip
diff --git a/kokoro/scripts/linux/build.sh b/kokoro/scripts/linux/build.sh
index 86d0ec5..44218f3 100644
--- a/kokoro/scripts/linux/build.sh
+++ b/kokoro/scripts/linux/build.sh
@@ -43,10 +43,16 @@ then
BUILD_TYPE="RelWithDebInfo"
fi
-# removing the old cmake version
+# removing the old version
echo y | sudo apt-get purge --auto-remove cmake
-# install new cmake version
-echo y | sudo apt-get install cmake
+
+# Installing the 3.10.2 version
+wget http://www.cmake.org/files/v3.10/cmake-3.10.2.tar.gz
+tar -xvzf cmake-3.10.2.tar.gz
+cd cmake-3.10.2/
+./configure
+make
+sudo make install
echo $(date): $(cmake --version)
diff --git a/kokoro/scripts/linux/build_dawn.sh b/kokoro/scripts/linux/build_dawn.sh
index f4b499b..aa8635d 100644
--- a/kokoro/scripts/linux/build_dawn.sh
+++ b/kokoro/scripts/linux/build_dawn.sh
@@ -39,6 +39,18 @@ then
BUILD_TYPE="RelWithDebInfo"
fi
+# removing the old version
+echo y | sudo apt-get purge --auto-remove cmake
+
+# Installing the 3.10.2 version
+wget http://www.cmake.org/files/v3.10/cmake-3.10.2.tar.gz
+tar -xvzf cmake-3.10.2.tar.gz
+cd cmake-3.10.2/
+./configure
+make
+sudo make install
+echo $(date): $(cmake --version)
+
# Get ninja
wget -q https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip
unzip -q ninja-linux.zip
diff --git a/setup_debug_local.env b/setup_debug_local.env
new file mode 100644
index 0000000..69a37ce
--- /dev/null
+++ b/setup_debug_local.env
@@ -0,0 +1,3 @@
+export VK_LAYER_PATH=out/Debug/third_party/vulkan-validationlayers/layers
+export LD_LIBRARY_PATH=out/Debug/third_party/vulkan-loader/loader
+
diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt
index 118a594..356acb1 100644
--- a/third_party/CMakeLists.txt
+++ b/third_party/CMakeLists.txt
@@ -62,6 +62,7 @@ if (${AMBER_USE_LOCAL_VULKAN})
set(BUILD_WSI_XLIB_SUPPORT OFF CACHE BOOL "" FORCE)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/vulkan-loader)
+ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/vulkan-validationlayers)
endif()
if (${AMBER_ENABLE_SWIFTSHADER})