Add glslang and spirv-tools to fetch_sources.py
authorPyry Haulos <phaulos@google.com>
Thu, 17 Sep 2015 16:01:23 +0000 (09:01 -0700)
committerPyry Haulos <phaulos@google.com>
Thu, 17 Sep 2015 17:30:30 +0000 (10:30 -0700)
Change-Id: I11da6673d0b7755422820a52b63c26759633f1aa

external/fetch_sources.py
external/glslang/.gitignore [new file with mode: 0644]
external/glslang/CMakeLists.txt
external/spirv-tools/.gitignore [new file with mode: 0644]
external/spirv-tools/CMakeLists.txt
external/vulkancts/README.md

index 71204f5..89c16ed 100644 (file)
@@ -168,6 +168,14 @@ PACKAGES = [
                "a18233c99e1dc59a256180e6871d9305a42e91b3f98799b3ceb98e87e9ec5e31",
                "libpng",
                postExtract = postExtractLibpng),
+       GitRepo(
+               "git@gitlab.khronos.org:spirv/spirv-tools.git",
+               "8a64b76360d2050908ce42e1c7b4d1d6297e82f5",
+               "spirv-tools"),
+       GitRepo(
+               "https://github.com/KhronosGroup/glslang",
+               "b9cd3996c7a67687b0a1fe5066c92e43a820de1e",
+               "glslang"),
 ]
 
 def parseArgs ():
diff --git a/external/glslang/.gitignore b/external/glslang/.gitignore
new file mode 100644 (file)
index 0000000..85de9cf
--- /dev/null
@@ -0,0 +1 @@
+src
index ca53d4f..97c344b 100644 (file)
@@ -4,8 +4,11 @@ if (NOT DE_DEFS)
        message(FATAL_ERROR "Include Defs.cmake")
 endif ()
 
-# Assume build inside Android source tree
-set(DEFAULT_GLSLANG_SRC_PATH "../glslang")
+if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/SPIRV/GlslangToSpv.cpp")
+       set(DEFAULT_GLSLANG_SRC_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src)
+else ()
+       set(DEFAULT_GLSLANG_SRC_PATH "../glslang")
+endif ()
 
 set(GLSLANG_SRC_PATH ${DEFAULT_GLSLANG_SRC_PATH} CACHE STRING "Path to glslang source tree")
 
diff --git a/external/spirv-tools/.gitignore b/external/spirv-tools/.gitignore
new file mode 100644 (file)
index 0000000..85de9cf
--- /dev/null
@@ -0,0 +1 @@
+src
index e6df4d4..c595552 100644 (file)
@@ -1,11 +1,14 @@
-#cmake file for spirv-tools
+# cmake file for spirv-tools
 
 if (NOT DE_DEFS)
        message(FATAL_ERROR "Include Defs.cmake")
 endif ()
 
-# Assume build inside Android source tree
-set(DEFAULT_SPIRV_TOOLS_SRC_PATH "../spirv-tools")
+if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/include/libspirv/libspirv.h")
+       set(DEFAULT_SPIRV_TOOLS_SRC_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src)
+else ()
+       set(DEFAULT_SPIRV_TOOLS_SRC_PATH "../spirv-tools")
+endif ()
 
 set(SPIRV_TOOLS_SRC_PATH ${DEFAULT_SPIRV_TOOLS_SRC_PATH} CACHE STRING "Path to spirv-tools source tree")
 if (IS_ABSOLUTE ${SPIRV_TOOLS_SRC_PATH})
@@ -22,7 +25,7 @@ if (EXISTS ${SPIRV_TOOLS_ABS_PATH}/source/opcode.cpp)
        set(DEQP_HAVE_SPIRV_TOOLS               ON                                      PARENT_SCOPE)
        set(SPIRV_SKIP_EXECUTABLES              ON)
        add_subdirectory(${SPIRV_TOOLS_ABS_PATH} spirv-tools)
-else()
+else ()
        message(STATUS "spirv-tools not found; SPIR-V assembly not available")
        set(DEQP_HAVE_SPIRV_TOOLS               OFF                                     PARENT_SCOPE)
-endif()
+endif ()
index 18f0bc8..356faf0 100644 (file)
@@ -25,33 +25,15 @@ Linux:
 Building
 --------
 
-To build dEQP, you need first to download sources for zlib, libpng, and glslang.
+To build dEQP, you need first to download sources for zlib, libpng, glslang,
+and spirv-tools.
 
-To download zlib and libpng, run:
+To download sources, run:
 
 $ python external/fetch_sources.py
 
-Glslang is optional, but enables GLSL to SPIR-V compilation. Check out glslang
-from the official repository to directory next to 'deqp':
-
-$ cd .. # assuming you were in 'deqp' source directory
-$ git clone https://github.com/KhronosGroup/glslang.git glslang
-
-spirv-tools is optional, but enables SPIRV assembly. Check out spirv-tools
-from the google branch of the gitlab repository next to 'deqp':
-
-$ cd .. # assuming you were in 'deqp' source directory
-$ git clone -b google https://gitlab.khronos.org/spirv/spirv-tools.git
-
-I.e the final directory structure should look like this:
-
-src/
-    deqp/
-    glslang/
-    spirv-tools/
-
-After downloading all dependencies, please follow instructions at
-http://source.android.com/devices/graphics/build-tests.html
+You may need to re-run fetch_sources.py to update to the latest glslang and
+spirv-tools revisions occasionally.
 
 NOTE: glslang integration is not yet available on Android due to a toolchain
 bug, so pre-compiled SPIR-V binaries must be used. See instructions below.