From d0c829b580ad6ada346d216d0069896cc89c7d20 Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Wed, 18 Apr 2018 16:43:28 +0200 Subject: [PATCH 1/2] Add no-opt to CTest, make test_shaders.py faster when FXC is missing. --- CMakeLists.txt | 9 +++++++++ test_shaders.py | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 659315c7..9226afd4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -128,12 +128,21 @@ if (${PYTHONINTERP_FOUND}) add_test(NAME spirv-cross-test COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py ${CMAKE_CURRENT_SOURCE_DIR}/shaders) + add_test(NAME spirv-cross-test-no-opt + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py + ${CMAKE_CURRENT_SOURCE_DIR}/shaders-no-opt) add_test(NAME spirv-cross-test-metal COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --metal ${CMAKE_CURRENT_SOURCE_DIR}/shaders-msl) + add_test(NAME spirv-cross-test-metal-no-opt + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --metal + ${CMAKE_CURRENT_SOURCE_DIR}/shaders-msl-no-opt) add_test(NAME spirv-cross-test-hlsl COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --hlsl ${CMAKE_CURRENT_SOURCE_DIR}/shaders-hlsl) + add_test(NAME spirv-cross-test-hlsl-no-opt + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --hlsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders-hlsl-no-opt) add_test(NAME spirv-cross-test-opt COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --opt ${CMAKE_CURRENT_SOURCE_DIR}/shaders) diff --git a/test_shaders.py b/test_shaders.py index b6cc7922..8f5a0c1b 100755 --- a/test_shaders.py +++ b/test_shaders.py @@ -140,16 +140,20 @@ def shader_to_win_path(shader): return shader +ignore_fxc = False def validate_shader_hlsl(shader): subprocess.check_call(['glslangValidator', '-e', 'main', '-D', '--target-env', 'vulkan1.1', '-V', shader]) is_no_fxc = '.nofxc.' in shader - if (not force_no_external_validation) and (not is_no_fxc): + global ignore_fxc + if (not ignore_fxc) and (not force_no_external_validation) and (not is_no_fxc): try: win_path = shader_to_win_path(shader) subprocess.check_call(['fxc', '-nologo', shader_model_hlsl(shader), win_path]) except OSError as oe: if (oe.errno != os.errno.ENOENT): # Ignore not found errors raise + else: + ignore_fxc = True except subprocess.CalledProcessError: print('Failed compiling HLSL shader:', shader, 'with FXC.') sys.exit(1) From cc82d14ee8fb4e671a0051e8f4b98a87f3f3dfc1 Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Wed, 18 Apr 2018 16:55:07 +0200 Subject: [PATCH 2/2] Add appveyor script. --- appveyor.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..2f427f18 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,31 @@ + +environment: + matrix: + - GENERATOR: "Visual Studio 12 2013 Win64" + CONFIG: Debug + + - GENERATOR: "Visual Studio 12 2013 Win64" + CONFIG: Release + + - GENERATOR: "Visual Studio 14 2015 Win64" + CONFIG: Debug + + - GENERATOR: "Visual Studio 14 2015 Win64" + CONFIG: Release + + - GENERATOR: "Visual Studio 12 2013" + CONFIG: Debug + + - GENERATOR: "Visual Studio 12 2013" + CONFIG: Release + + - GENERATOR: "Visual Studio 14 2015" + CONFIG: Debug + + - GENERATOR: "Visual Studio 14 2015" + CONFIG: Release + +build_script: + - git submodule update --init + - cmake "-G%GENERATOR%" -H. -B_builds + - cmake --build _builds --config "%CONFIG%"