Skip to content
Commits on Source (552)
......@@ -8,14 +8,14 @@ version: "{build}"
# Put it first so we get its feedback first.
os:
- Visual Studio 2017
- Visual Studio 2013
#- Visual Studio 2013
platform:
- x64
configuration:
- Debug
- Release
#- Release
branches:
only:
......@@ -32,9 +32,9 @@ clone_depth: 1
matrix:
fast_finish: true # Show final status immediately if a test fails.
exclude:
- os: Visual Studio 2013
configuration: Debug
#exclude:
# - os: Visual Studio 2013
# configuration: Debug
# scripts that run after cloning repository
install:
......
......@@ -2,4 +2,5 @@
Language: Cpp
BasedOnStyle: Google
DerivePointerAlignment: false
SortIncludes: true
...
/build*
.clang_complete
.ycm_extra_conf.py*
*.pyc
compile_commands.json
/build/
/buildtools/
/external/googletest
/external/SPIRV-Headers
/external/spirv-headers
/external/effcee
/external/re2
/out
/TAGS
/.clang_complete
/third_party/llvm-build/
/testing
/tools/clang/
/utils/clang-format-diff.py
# Vim
[._]*.s[a-w][a-z]
*~
# C-Lion
.idea
cmake-build-debug
\ No newline at end of file
# Copyright 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
buildconfig = "//build/config/BUILDCONFIG.gn"
default_args = {
clang_use_chrome_plugins = false
use_custom_libcxx = false
}
# Linux Build Configuration for Travis
language: cpp
os:
- linux
- osx
# Use Ubuntu 14.04 LTS (Trusty) as the Linux testing environment.
dist: trusty
sudo: false
env:
global:
- secure: IoR/Xe9E+NnLAeI23WrmUsGQn5rocz+XRYUk+BbaoKiIRYm4q72GKyypRoOGLu7wImOXFSvnN/dpdnqIpx4W0NfsSvNdlXyhDy+wvT1kzTt77dJGnkGZTZ2SBOtC9AECLy4sqM9HG0rYRR6WfXcnP2GlrE5f2aF07aISQbOUsQMvyyhtCmVAzIigK1zIUto5I0pNenvo/Y+ur+mEvTh+FtaoDIGepCbZlCc+OxqRXwXNlI7mDXbzLPmTB1FWTGsrZdRX8czF9tN9Y+T79DQjB4Lcyyeow8yU9NBVlgzZJcp1xI0UIskRT8gVrXmBYL2dMeHnDQuhxjEg9n7jfr3ptA9rgwMaSsgdaLwuBXgtPuqVgUYDpE1cP8WI8q38MXX0I6psTs/WHu+z+5UwfjzpPOHmGdVt48o8ymFTapvD5Cf1+uJyk73QkyStnPIdBF1N9Yx5sD7HN28K6/Ro12sCCePHUZ9Uz1DdZI6XxkgCNKNwao0csAyvODxD6Ee43mkExtviB8BJY5jWLIMTdGhgEGH2sRqils8IDW0p8AOTPM4UC7iA7hdg3pA+XMvBHvP9ixsY7tuB+yR2AfnFaSw2DVbwI5GgFdFMNHXYuL+9V9Wuh3keBKYQT/Hy1YvxjQ/t9UouYHqEsyVFUl3R4lEAM9+qSRsRu+EKmcSO2QtCsWc=
matrix:
# Each line is a set of environment variables set before a build.
# Thus each line represents a different build configuration.
- BUILD_TYPE=RelWithDebInfo
- BUILD_TYPE=Debug
compiler:
- clang
- gcc
matrix:
fast_finish: true
include:
# Additional build using Android NDK with android-cmake
- env: BUILD_ANDROID_CMAKE=ON
# Additional build using Android NDK with Android.mk
- env: BUILD_ANDROID_MK=ON
# Additional check over format
- env: CHECK_FORMAT=ON
exclude:
# Skip GCC builds on macOS.
- os: osx
compiler: gcc
cache:
apt: true
git:
depth: 1
branches:
only:
- master
before_install:
- if [[ "$BUILD_ANDROID_CMAKE" == "ON" ]] || [[ "$BUILD_ANDROID_MK" == "ON" ]]; then
git clone --depth=1 https://github.com/urho3d/android-ndk.git $HOME/android-ndk;
export ANDROID_NDK=$HOME/android-ndk;
git clone --depth=1 https://github.com/taka-no-me/android-cmake.git $HOME/android-cmake;
export TOOLCHAIN_PATH=$HOME/android-cmake/android.toolchain.cmake;
fi
- if [[ "$CHECK_FORMAT" == "ON" ]]; then
curl -L http://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/clang-format-diff.py -o utils/clang-format-diff.py;
fi
before_script:
- git clone --depth=1 https://github.com/KhronosGroup/SPIRV-Headers external/spirv-headers
- git clone --depth=1 https://github.com/google/googletest external/googletest
- git clone --depth=1 https://github.com/google/effcee external/effcee
- git clone --depth=1 https://github.com/google/re2 external/re2
script:
# Due to the limitation of Travis platform, we cannot start too many concurrent jobs.
# Otherwise GCC will panic with internal error, possibility because of memory issues.
# ctest with the current tests doesn't profit from using more than 4 threads.
- export NPROC=4
- mkdir build && cd build
- if [[ "$BUILD_ANDROID_MK" == "ON" ]]; then
export BUILD_DIR=$(pwd);
mkdir ${BUILD_DIR}/libs;
mkdir ${BUILD_DIR}/app;
$ANDROID_NDK/ndk-build -C ../android_test NDK_PROJECT_PATH=.
NDK_LIBS_OUT=${BUILD_DIR}/libs
NDK_APP_OUT=${BUILD_DIR}/app -j${NPROC};
elif [[ "$BUILD_ANDROID_CMAKE" == "ON" ]]; then
cmake -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_PATH}
-DANDROID_NATIVE_API_LEVEL=android-9
-DCMAKE_BUILD_TYPE=Release
-DANDROID_ABI="armeabi-v7a with NEON"
-DSPIRV_BUILD_COMPRESSION=ON
-DSPIRV_SKIP_TESTS=ON ..;
make -j${NPROC};
elif [[ "$CHECK_FORMAT" == "ON" ]]; then
cd ..;
./utils/check_code_format.sh;
else
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DSPIRV_BUILD_COMPRESSION=ON -DCMAKE_INSTALL_PREFIX=install ..;
make -j${NPROC} install;
ctest -j${NPROC} --output-on-failure --timeout 300;
fi
after_success:
# Create tarball for deployment
- if [[ "${CC}" == "clang" && "${BUILD_ANDROID_MK}" != "ON" && "${BUILD_ANDROID_CMAKE}" != "ON" && "${CHECK_FORMAT}" != "ON" ]]; then
cd install;
export TARBALL=SPIRV-Tools-master-${TRAVIS_OS_NAME}-${BUILD_TYPE}.zip;
find . -print | zip -@ ${TARBALL};
fi
before_deploy:
# Tag the current master top of the tree as "master-tot".
# Travis CI relies on the tag name to push to the correct release.
- git config --global user.name "Travis CI"
- git config --global user.email "builds@travis-ci.org"
- git tag -f master-tot
- git push -q -f https://${spirvtoken}@github.com/KhronosGroup/SPIRV-Tools --tags
deploy:
provider: releases
api_key: ${spirvtoken}
on:
branch: master
condition: ${CC} == clang && ${BUILD_ANDROID_MK} != ON && ${BUILD_ANDROID_CMAKE} != ON && ${CHECK_FORMAT} != ON
file: ${TARBALL}
skip_cleanup: true
overwrite: true
notifications:
email:
recipients:
- andreyt@google.com
- antiagainst@google.com
- awoloszyn@google.com
- dneto@google.com
- ehsann@google.com
- qining@google.com
on_success: change
on_failure: always
LOCAL_PATH := $(call my-dir)
SPVTOOLS_OUT_PATH=$(if $(call host-path-is-absolute,$(TARGET_OUT)),$(TARGET_OUT),$(abspath $(TARGET_OUT)))
ifeq ($(SPVHEADERS_LOCAL_PATH),)
SPVHEADERS_LOCAL_PATH := $(LOCAL_PATH)/external/spirv-headers
endif
SPVTOOLS_SRC_FILES := \
source/assembly_grammar.cpp \
......@@ -19,41 +22,55 @@ SPVTOOLS_SRC_FILES := \
source/print.cpp \
source/software_version.cpp \
source/spirv_endian.cpp \
source/spirv_optimizer_options.cpp \
source/spirv_target_env.cpp \
source/spirv_validator_options.cpp \
source/table.cpp \
source/text.cpp \
source/text_handler.cpp \
source/util/bit_stream.cpp \
source/util/bit_vector.cpp \
source/util/parse_number.cpp \
source/util/string_utils.cpp \
source/util/timer.cpp \
source/val/basic_block.cpp \
source/val/construct.cpp \
source/val/function.cpp \
source/val/instruction.cpp \
source/val/validation_state.cpp \
source/validate.cpp \
source/validate_adjacency.cpp \
source/validate_arithmetics.cpp \
source/validate_atomics.cpp \
source/validate_barriers.cpp \
source/validate_bitwise.cpp \
source/validate_capability.cpp \
source/validate_cfg.cpp \
source/validate_composites.cpp \
source/validate_conversion.cpp \
source/validate_datarules.cpp \
source/validate_decorations.cpp \
source/validate_derivatives.cpp \
source/validate_ext_inst.cpp \
source/validate_id.cpp \
source/validate_image.cpp \
source/validate_instruction.cpp \
source/validate_layout.cpp \
source/validate_literals.cpp \
source/validate_logicals.cpp \
source/validate_primitives.cpp \
source/validate_type_unique.cpp
source/val/validate.cpp \
source/val/validate_adjacency.cpp \
source/val/validate_annotation.cpp \
source/val/validate_arithmetics.cpp \
source/val/validate_atomics.cpp \
source/val/validate_barriers.cpp \
source/val/validate_bitwise.cpp \
source/val/validate_builtins.cpp \
source/val/validate_capability.cpp \
source/val/validate_cfg.cpp \
source/val/validate_composites.cpp \
source/val/validate_constants.cpp \
source/val/validate_conversion.cpp \
source/val/validate_datarules.cpp \
source/val/validate_debug.cpp \
source/val/validate_decorations.cpp \
source/val/validate_derivatives.cpp \
source/val/validate_extensions.cpp \
source/val/validate_execution_limitations.cpp \
source/val/validate_function.cpp \
source/val/validate_id.cpp \
source/val/validate_image.cpp \
source/val/validate_interfaces.cpp \
source/val/validate_instruction.cpp \
source/val/validate_memory.cpp \
source/val/validate_memory_semantics.cpp \
source/val/validate_mode_setting.cpp \
source/val/validate_layout.cpp \
source/val/validate_literals.cpp \
source/val/validate_logicals.cpp \
source/val/validate_non_uniform.cpp \
source/val/validate_primitives.cpp \
source/val/validate_scopes.cpp \
source/val/validate_type.cpp
SPVTOOLS_OPT_SRC_FILES := \
source/opt/aggressive_dead_code_elim_pass.cpp \
......@@ -63,11 +80,13 @@ SPVTOOLS_OPT_SRC_FILES := \
source/opt/cfg.cpp \
source/opt/cfg_cleanup_pass.cpp \
source/opt/ccp_pass.cpp \
source/opt/combine_access_chains.cpp \
source/opt/common_uniform_elim_pass.cpp \
source/opt/compact_ids_pass.cpp \
source/opt/composite.cpp \
source/opt/const_folding_rules.cpp \
source/opt/constants.cpp \
source/opt/copy_prop_arrays.cpp \
source/opt/dead_branch_elim_pass.cpp \
source/opt/dead_insert_elim_pass.cpp \
source/opt/dead_variable_elimination.cpp \
......@@ -88,9 +107,10 @@ SPVTOOLS_OPT_SRC_FILES := \
source/opt/inline_pass.cpp \
source/opt/inline_exhaustive_pass.cpp \
source/opt/inline_opaque_pass.cpp \
source/opt/insert_extract_elim.cpp \
source/opt/inst_bindless_check_pass.cpp \
source/opt/instruction.cpp \
source/opt/instruction_list.cpp \
source/opt/instrument_pass.cpp \
source/opt/ir_context.cpp \
source/opt/ir_loader.cpp \
source/opt/licm_pass.cpp \
......@@ -99,7 +119,13 @@ SPVTOOLS_OPT_SRC_FILES := \
source/opt/local_single_block_elim_pass.cpp \
source/opt/local_single_store_elim_pass.cpp \
source/opt/local_ssa_elim_pass.cpp \
source/opt/loop_dependence.cpp \
source/opt/loop_dependence_helpers.cpp \
source/opt/loop_descriptor.cpp \
source/opt/loop_fission.cpp \
source/opt/loop_fusion.cpp \
source/opt/loop_fusion_pass.cpp \
source/opt/loop_peeling.cpp \
source/opt/loop_unroller.cpp \
source/opt/loop_unswitch_pass.cpp \
source/opt/loop_utils.cpp \
......@@ -110,19 +136,29 @@ SPVTOOLS_OPT_SRC_FILES := \
source/opt/pass.cpp \
source/opt/pass_manager.cpp \
source/opt/private_to_local_pass.cpp \
source/opt/process_lines_pass.cpp \
source/opt/propagator.cpp \
source/opt/reduce_load_size.cpp \
source/opt/redundancy_elimination.cpp \
source/opt/register_pressure.cpp \
source/opt/remove_duplicates_pass.cpp \
source/opt/replace_invalid_opc.cpp \
source/opt/scalar_analysis.cpp \
source/opt/scalar_analysis_simplification.cpp \
source/opt/scalar_replacement_pass.cpp \
source/opt/set_spec_constant_default_value_pass.cpp \
source/opt/simplification_pass.cpp \
source/opt/ssa_rewrite_pass.cpp \
source/opt/strength_reduction_pass.cpp \
source/opt/strip_debug_info_pass.cpp \
source/opt/strip_reflect_info_pass.cpp \
source/opt/struct_cfg_analysis.cpp \
source/opt/type_manager.cpp \
source/opt/types.cpp \
source/opt/unify_const_pass.cpp \
source/opt/upgrade_memory_model.cpp \
source/opt/value_number_table.cpp \
source/opt/vector_dce.cpp \
source/opt/workaround1209.cpp
# Locations of grammar files.
......@@ -285,8 +321,7 @@ include $(CLEAR_VARS)
LOCAL_MODULE := SPIRV-Tools
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include \
$(LOCAL_PATH)/source \
$(LOCAL_PATH)/external/spirv-headers/include \
$(SPVHEADERS_LOCAL_PATH)/include \
$(SPVTOOLS_OUT_PATH)
LOCAL_EXPORT_C_INCLUDES := \
$(LOCAL_PATH)/include
......@@ -299,7 +334,7 @@ LOCAL_MODULE := SPIRV-Tools-opt
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include \
$(LOCAL_PATH)/source \
$(LOCAL_PATH)/external/spirv-headers/include \
$(SPVHEADERS_LOCAL_PATH)/include \
$(SPVTOOLS_OUT_PATH)
LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti -Werror
LOCAL_STATIC_LIBRARIES:=SPIRV-Tools
......
This diff is collapsed.
Revision history for SPIRV-Tools
v2019.1 2019-01-07
- General:
- Created a new tool called spirv-reduce.
- Add cmake option to turn off SPIRV_TIMER_ENABLED (#2103)
- New optimization pass to update the memory model from GLSL450 to VulkanKHR.
- Recognize OpTypeAccelerationStructureNV as a type instruction and ray tracing storage classes.
- Fix GCC8 build.
- Add --target-env flag to spirv-opt.
- Add --webgpu-mode flag to run optimizations for webgpu.
- The output disassembled line number stead of byte offset in validation errors. (#2091)
- Optimizer
- Added the instrumentation passes for bindless validation.
- Added passes to help preserve OpLine information (#2027)
- Add basic support for EXT_fragment_invocation_density (#2100)
- Fix invalid OpPhi generated by merge-return. (#2172)
- Constant and type manager have been turned into analysies. (#2251)
Fixes:
- #2018: Don't inline functions with a return in a structured CFG contstruct.
- #2047: Fix bug in folding when volatile stores are present.
- #2053: Fix check for when folding floating pointer values is allowed.
- #2130: Don't inline recursive functions.
- #2202: Handle multiple edges between two basic blocks in SSA-rewriter.
- #2205: Don't unswitch a latch condition during loop unswitch.
- #2245: Don't fold branch in loop unswitch. Run dead branch elimination to fold them.
- #2204: Fix eliminate common uniform to place OpPhi instructions correctly.
- #2247: Fix type mismatches caused by scalar replacement.
- #2248: Fix missing OpPhi after merge return.
- #2211: After merge return, fix invalid continue target.
- #2210: Fix loop invariant code motion to not place code between merge instruction and branch.
- #2258: Handle CompositeInsert with no indices in VDCE.
- #2261: Have replace load size handle extact with no index.
- Validator
- Changed the naming convention of outputing ids with names in diagnostic messages.
- Added validation rules for UniformConstant variables in Vulkan.
- #1949: Validate uniform variable type in Vulkan
- Ensure for OpVariable that result type and storage class operand agree (#2052)
- Validator: Support VK_EXT_scalar_block_layout
- Added Vulkan memory model semantics validation
- Added validation checkes spefic to WebGPU environment.
- Add support for VK_EXT_Transform_feedback capabilities (#2088)
- Add validation for OpArrayLength. (#2117)
- Ensure that function parameter's type is not void (#2118)
- Validate pointer variables (#2111)
- Add check for QueueFamilyKHMR memory scope (#2144)
- Validate PushConstants annotation and type (#2140)
- Allow Float16/Int8 for Vulkan 1.0 (#2153)
- Check binding annotations in resource variables (#2151, #2167)
- Validate OpForwardPointer (#2156)
- Validate operation for OpSpecConstantOp (#2260)
Fixes:
- #2049: Allow InstanceId for NV ray tracing
- Reduce
- Initial commit wit a few passes to reduce test cases.
- Validation is run after each reduction step.
Fixes:
v2018.6 2018-11-07
- General:
- Added support for the Nvidia Turing and ray tracing extensions.
- Make C++11 the CXX standard in CMakeLists.txt.
- Enabled a parallel build for MSVC.
- Enable pre-compiled headers for MSVC.
- Added a code of conduct.
- EFFCEE and RE2 are now required when build the tests.
- Optimizer
- Unrolling loops marked for unrolling in the legalization passes.
- Improved the compile time of loop unrolling.
- Changee merge-return to create a dummy loop around the function.
- Small improvement to merge-blocks to allow it to merge more often.
- Enforce an upper bound for the ids, and add option to set it.
- #1966: Report error if there are unreachable block before running merge return
Fixes:
- #1917: Allow 0 (meaning unlimited) as a parameter to --scalar-replacement
- #1915: Improve handling of group decorations.
- #1942: Fix incorrect uses of the constant manager. Avoids type mismatches in generated code.
- #1997: Fix dead branch elimination when there is a loop in folded selection.
- #1991: Fixes legality check in if-conversion.
- #1987: Add nullptr check to array copy propagation.
- #1984: Better handling of OpUnreachable in ADCE.
- #1983: Run merge return on reachable functions only.
- #1956: Handled atomic operations in ADCE.
- #1963: Fold integer divisions by 0 to 0.
- #2019: Handle MemberDecorateStringGOOGLE in ADCE and strip reflect.
- Validator
- Added validation for OpGroupNonUniformBallotBitCount.
- Added validation for the Vulkan memory model.
- Added support for VK_KHR_shader_atddomic_int64.
- Added validation for execution modes.
- Added validation for runtime array layouts.
- Added validation for 8-bit storage.
- Added validation of OpPhi instructions with pointer result type.
- Added checks for the Vulkan memory model.
- Validate MakeTexelAvailableKHR and MakeTexelVisibleKHR
- Allow atomic function pointer for OpenCL.
- FPRounding mode checks were implemented.
- Added validation for the id bound with an option to set the max id bound.
Fixes:
- #1882: Improve the validation of decorations to reduce memory usage.
- #1891: Fix an potential infinite loop in dead-branch-elimination.
- #1405: Validate the storage class of boolean objects.
- #1880: Identify arrays of type void as invalid.
- #487: Validate OpImageTexelPointer.
- #1922: Validate OpPhi instructions are at the start of a block correctly.
- #1923: Validate function scope variable are at the start of the entry block.
v2018.5 2018-09-07
- General:
- Support SPV_KHR_vulkan_memory_model
- Update Dim capabilities, to match SPIR-V 1.3 Rev 4
- Automated build bots no run tests for the VS2013 case
- Support Chromium GN build
- Use Kokoro bots:
- Disable Travis-CI bots
- Disable AppVeyor VisualStudio Release builds. Keep VS 2017 Debug build
- Don't check export symbols on OSX (Darwin): some installations don't have 'objdump'
- Reorganize source files and namespaces
- Fixes for ClangTidy, and whitespace (passes 'git cl presumit --all -uf')
- Fix unused param compile warnings/errors when Effcee not present
- Avoid including time headers when timer functionality is disabled
- Avoid too-stringent warnings flags for Clang on Windows
- Internal refactoring
- Add hooks for automated fuzzing
- Add testing of command line executables
- #1688: Use binary mode on stdin; fixes "spirv-dis <foo.spv" on Windows
- Optimizer
- The optimizer validates the module before it begins
- Add API to register passes by string name
- Fold a vector shuffle feeding a vector shuffle
- Add -combine-access-chains transform
- Refactor how IRContext is handled by passes
- Improve bookkeeping for instruction result type and result id
- Fix over-duplication of decorations
- Fix handling of exits from selections in dead-branch elimination, and dead code
elimination.
- Fix handling of certain kinds of flow control in merge-return
Fixes:
- #1721: Fix size bug when folding vector shuffles
- #1722: Fix size infinite loop when folding vector shuffles
- #1724: Fix finding a constant of a specific type
- #1727: Dead branch elim: Reorder blocks if needed to satisfy dominance rule
- #1729: Handle VariablePointers cases in various optimizations
- #1731: Fix vector shuffle with literal id indicating undef value
- #1736: Fix handling of decorations and phis in merge-return
- #1787: Fix handling of decorations related to access chains
- #1865: Avoid leaking memory for SPIR-V constant values
- Validator
- Improve error messages
- Avoid platform-dependent traversal ordering, to ensure consistent messages
- Use libspirv::Instruction where possible
- Add option to skip all block layout checks
- Validate all type IDs
- Validate uses of OpFunction
- Validate uses of OpTypeFunction
- Disallow a struct containing its own type https://crbug.com/874372
- #1685: Vulkan permits non-monotonic offsets for block members
- #1697: Enforce block layout rules even when using relaxed block layout option
- #1719: Fix line number for vector shuffle valiation error
- #1789: Avoid assertion failure when validating some functions
- #1800: Fix validation of OpCopyMemorySized
- #1822: Stop enforcing struct member offset montonicity
- #1831: Disallow void members in structs
v2018.4 2018-07-08
- General:
- Support SPV_KHR_8bit_storage
- Add gclient and presubmit configurations
- Enable Kokoro build bots (#1625)
- Group tests into fewer executables, reduces load on CI
- Port test script to Python 3
- Symbol export tests respect SPIRV_SKIP_TESTS
- #1596: Operand lookup succeeds if enabled by a capability
- #1624: Instruction lookup succeeds if enabled by a capability
- Refactoring namespaces:
- #1678: Change libspirv to spvtools
- Code in source/utils moved into spvtools::utils
- Code in source/comp moved into spvtools::comp
- Optimizer:
- Remove insert-extract-elim pass. Use simplification pass instead.
- Preserve instruction-to-block mapping in most passes, to reduce runtime.
- Small vector optimization for operands
- Add pass to move Private variables to Function. Increase opportunity to optimize.
- Fixes:
#1120: Check static uses of entry point interfaces
#1372: Avoid merging some structs, to preserve names for reflection
#1577: Scalar replacement uses only undecorated types.
#1578: Fix handling of forward-pointer types, and types embedding pointers
to themselves.
#1591: Inliner: Callee variable with initializer should have a store at the call site.
#1634: Fix crash: Use type id in vector type lookup
#1649: Fix assert in compact-ids pass
Fix constant folder: ensure it uses the right type
#1659: Folding rules added to IRContext. Avoids leak.
- Validator
- Add work-in-progress WebGPU environment. Disallows OpUndef
- #670, #1581: Improve error messages; disassemble instruction
- #491: Check structured switches
- #937: Check layout rules for Block and BufferBlock in Uniform, StorageBuffer, PushConstant
- #1281: Check invalid branches into structured constructs
- #1522: Disallow array-of-arrays with DescriptorSets
- #1577: Allow duplicate pointer types.
- #1581: Better messages: output ID names along with numbers in more cases.
- #1597: Check Vulkan 1.1 capabilities
- #1618: Check invalid exit from structured case construct
- #1622: Run IdPass before DataRulesPass
- #1632: Reduce test time by artificially lowering limits in limit test
- #1638: Block-decorated structs member order must respect offset order
- #1657: Improve CFG validation diagnostics
- Khronos SPIR-V #337: GLSL.std.450 Refract instruction Eta param can be any float scalar.
- #1606: PushConstant Blocks follow storage-buffer layout rules
- #1664: Check layout of StorageBuffer variables with Block decoration, using storage buffer
rules
- #1666: Layout validation should permit {vec3; float} packing
- #1637, #1668: Layout validation uses RowMajor, ArrayStride, MatrixStride properly
- Linker
- Avoid buffer overrun when creating OpModuleProcessed
v2018.3 2018-05-25
- General:
- Support SPV_EXT_descriptor_indexing
- Support SPV_GOOGLE_decorate_string
- Support SPV_GOOGLE_hlsl_functionality1
- Support SPV_NV_shader_subgroup_partitioned
- Use "unified1" grammar from SPIRV-Headers
- Simplify support for new extensions. Assembler, disassembler, and simple validation
support is automatic if new tokens are introduced with appropriate extension
attributes in the "unified1" SPIR-V core grammar.
- Disassembler: Emit more digits on floating point, to reliably reproduce all
significand bits. (Use std::max_digits10 instead of std::digits10)
- Fix compilation for old XCode versions: Explicit construction required for std::set.
- Optimizer:
- Add --strip-reflect
- Add --time-report
- Add --loop-fission
- Add lop fusion.
- Add loop peeling pass and internal utility.
- Improve optimizer runtime.
- Merge-return now works with structured control flow.
- New (faster) SSA rewriter to convert local loads and stores to SSA IDs and phis.
Can replace load/store elimination passes.
- Fix instruction folding case: insertion that feeds and extract, when the extract
remains.
- Fold OpDot.
- Fold OpFNegate.
- Fold multply and divide of same value.
- Fold FClamp feeding a compare.
- Fold OpLoad feeding an extract, to reduce excessive copying. (#1547)
- Fold Fmix feeding an extract.
- Use simplification pass instead of insert-extract elimination.
- Constant fold OpVectorTimesScalar.
- Copy propagate arrays, in simple cases.
- Aggressive dead code elimination: Can remove more instructions, e.g. derivatives.
- Aggressive dead code elimination: Remove Workgroup variables that are written but not read.
- Better handling of OpImageTexelPointer
- Initial utilities for scalar evolution.
- Add Vector dead code elimination.
- Each pass can only run once.
- Allow code hosting in if-conversion.
- Add external interface for adding a PassToken, so external code can make their own
passes.
- Fixes:
#1404: Don't optimize away the compute compute workgroup size constant.
#1407: Remove a bad assertion
#1456: Fix bug in SSA rewriter related to variables updated in loops.
#1487: Fix long runtime in Dead insertion elimination: Don't revist select phi nodes.
#1492: Aggressive dead code elimination can remove OpDecorateStringGOOGLE.
#1527: Fix inlining of functions having OpKill and OpUnreachable.
#1559: Fix assert failure in reduce-load-size pass.
#1556: Aggressive dead code elimination: Fix handling of OpCopyMemory.
- Validator:
- Check Vulkan built-in variables
- Check Vulkan-specific atomic result type rule.
- Relax control barrier check for SPIR-V 1.3. Fixes #1427
- Check OpPhi.
- Check OpMemoryModel.
- Stop checking sizes derived from spec-constants.
- Re-enable checks for OpUConvert.
- Vulkan: Fix check for PrimitiveId: Permit as Input in fragment shader.
- Validate binary version for the given target environment.
- Add tests for OpBranch checks.
- Vulkan 1.1: Check scope for non-uniform subgroup operations.
- Fix checks for SPV_AMD_gpu_shader_int16.
- Fix logical layout check for OpDecorateId.
- Fix checks for ViewportIndex & Layer for Vulkan and SPV_EXT_shader_viewport_index_layer.
- Fixes:
#1470: Vulkan: Don't restrict WorkgroupSize to Input storage class.
#1469: Vulkan: Permit Subgroup memory scope for Vulkan 1.1.
#1472: Per-vertex variable validation fixes.
#1483: Valdiate barrier execution scopes for Vulkan 1.1.
- Fixes:
#898: Linker properly removes FuncParamAttr from imported symbols.
#924, #1174: Fix handling of decoration groups in optimizer, linker.
v2018.2 2018-03-07
- General:
- Support SPIR-V 1.3 and Vulkan 1.1.
......
......@@ -29,11 +29,16 @@ enable_testing()
set(SPIRV_TOOLS "SPIRV-Tools")
include(GNUInstallDirs)
include(cmake/setup_build.cmake)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_STANDARD 11)
option(SPIRV_ALLOW_TIMERS "Allow timers via clock_gettime on supported platforms" ON)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
add_definitions(-DSPIRV_LINUX)
set(SPIRV_TIMER_ENABLED ${SPIRV_ALLOW_TIMERS})
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
add_definitions(-DSPIRV_WINDOWS)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
......@@ -42,12 +47,16 @@ elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
add_definitions(-DSPIRV_MAC)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Android")
add_definitions(-DSPIRV_ANDROID)
set(SPIRV_TIMER_ENABLED ${SPIRV_ALLOW_TIMERS})
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
add_definitions(-DSPIRV_FREEBSD)
else()
message(FATAL_ERROR "Your platform '${CMAKE_SYSTEM_NAME}' is not supported!")
endif()
if (${SPIRV_TIMER_ENABLED})
add_definitions(-DSPIRV_TIMER_ENABLED)
endif()
if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
message(STATUS "No build type selected, default to Debug")
......@@ -62,12 +71,16 @@ endif()
option(SPIRV_BUILD_COMPRESSION "Build SPIR-V compressing codec" OFF)
option(SPIRV_WERROR "Enable error on warning" ON)
if(("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))
if(("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR (("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") AND (NOT CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")))
set(COMPILER_IS_LIKE_GNU TRUE)
endif()
if(${COMPILER_IS_LIKE_GNU})
set(SPIRV_WARNINGS -Wall -Wextra -Wnon-virtual-dtor -Wno-missing-field-initializers)
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(SPIRV_WARNINGS ${SPIRV_WARNINGS} -Wno-self-assign)
endif()
option(SPIRV_WARN_EVERYTHING "Enable -Weverything" ${SPIRV_WARN_EVERYTHING})
if(${SPIRV_WARN_EVERYTHING})
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
......@@ -92,7 +105,7 @@ elseif(MSVC)
endif()
endif()
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/source)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/)
option(SPIRV_COLOR_TERMINAL "Enable color terminal output" ON)
if(${SPIRV_COLOR_TERMINAL})
......@@ -128,6 +141,8 @@ function(spvtools_default_compile_options TARGET)
target_compile_options(${TARGET} PRIVATE
-fsanitize=${SPIRV_USE_SANITIZER})
endif()
target_compile_options(${TARGET} PRIVATE
-ftemplate-depth=1024)
else()
target_compile_options(${TARGET} PRIVATE
-Wno-missing-field-initializers)
......@@ -163,15 +178,22 @@ endif()
find_host_package(PythonInterp)
# Check for symbol exports on Linux.
# At the moment, this check will fail on the OSX build machines for the Android NDK.
# It appears they don't have objdump.
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
macro(spvtools_check_symbol_exports TARGET)
if (NOT "${SPIRV_SKIP_TESTS}")
add_test(NAME spirv-tools-symbol-exports-${TARGET}
COMMAND ${PYTHON_EXECUTABLE}
${spirv-tools_SOURCE_DIR}/utils/check_symbol_exports.py "$<TARGET_FILE:${TARGET}>")
endif()
endmacro()
else()
macro(spvtools_check_symbol_exports TARGET)
if (NOT "${SPIRV_SKIP_TESTS}")
message("Skipping symbol exports test for ${TARGET}")
endif()
endmacro()
endif()
......@@ -192,11 +214,19 @@ if (${SPIRV_CHECK_CONTEXT})
add_definitions(-DSPIRV_CHECK_CONTEXT)
endif()
add_subdirectory(external)
if (TARGET effcee)
add_definitions(-DSPIRV_EFFCEE)
# Precompiled header macro. Parameters are source file list and filename for pch cpp file.
macro(spvtools_pch SRCS PCHPREFIX)
if(MSVC AND CMAKE_GENERATOR MATCHES "^Visual Studio")
set(PCH_NAME "$(IntDir)\\${PCHPREFIX}.pch")
# make source files use/depend on PCH_NAME
set_source_files_properties(${${SRCS}} PROPERTIES COMPILE_FLAGS "/Yu${PCHPREFIX}.h /FI${PCHPREFIX}.h /Fp${PCH_NAME} /Zm300" OBJECT_DEPENDS "${PCH_NAME}")
# make PCHPREFIX.cpp file compile and generate PCH_NAME
set_source_files_properties("${PCHPREFIX}.cpp" PROPERTIES COMPILE_FLAGS "/Yc${PCHPREFIX}.h /Fp${PCH_NAME} /Zm300" OBJECT_OUTPUTS "${PCH_NAME}")
list(APPEND ${SRCS} "${PCHPREFIX}.cpp")
endif()
endmacro(spvtools_pch)
add_subdirectory(external)
add_subdirectory(source)
add_subdirectory(tools)
......@@ -211,6 +241,7 @@ if(ENABLE_SPIRV_TOOLS_INSTALL)
${CMAKE_CURRENT_SOURCE_DIR}/include/spirv-tools/libspirv.hpp
${CMAKE_CURRENT_SOURCE_DIR}/include/spirv-tools/optimizer.hpp
${CMAKE_CURRENT_SOURCE_DIR}/include/spirv-tools/linker.hpp
${CMAKE_CURRENT_SOURCE_DIR}/include/spirv-tools/instrument.hpp
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/spirv-tools/)
endif(ENABLE_SPIRV_TOOLS_INSTALL)
......
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.
......@@ -87,6 +87,9 @@ usual things:
* Identify potential functional problems.
* Identify code duplication.
* Ensure the unit tests have enough coverage.
* Ensure continuous integration (CI) bots run on the PR. If not run (in the
case of PRs by external contributors), add the "kokoro:run" label to the
pull request which will trigger running all CI jobs.
When looking for functional problems, there are some common problems reviewers
should pay particular attention to:
......
use_relative_paths = True
vars = {
'chromium_git': 'https://chromium.googlesource.com',
'github': 'https://github.com',
'build_revision': '037f38ae0fe5e11b4f7c33b750fd7a1e9634a606',
'buildtools_revision': 'ab7b6a7b350dd15804c87c20ce78982811fdd76f',
'clang_revision': 'abe5e4f9dc0f1df848c7a0efa05256253e77a7b7',
'effcee_revision': '04b624799f5a9dbaf3fa1dbed2ba9dce2fc8dcf2',
'googletest_revision': '98a0d007d7092b72eea0e501bb9ad17908a1a036',
'testing_revision': '340252637e2e7c72c0901dcbeeacfff419e19b59',
're2_revision': '6cf8ccd82dbaab2668e9b13596c68183c9ecd13f',
'spirv_headers_revision': '79b6681aadcb53c27d1052e5f8a0e82a981dbf2f',
}
deps = {
"build":
Var('chromium_git') + "/chromium/src/build.git@" + Var('build_revision'),
'buildtools':
Var('chromium_git') + '/chromium/buildtools.git@' +
Var('buildtools_revision'),
'external/spirv-headers':
Var('github') + '/KhronosGroup/SPIRV-Headers.git@' +
Var('spirv_headers_revision'),
'external/googletest':
Var('github') + '/google/googletest.git@' + Var('googletest_revision'),
'external/effcee':
Var('github') + '/google/effcee.git@' + Var('effcee_revision'),
'external/re2':
Var('github') + '/google/re2.git@' + Var('re2_revision'),
'testing':
Var('chromium_git') + '/chromium/src/testing@' +
Var('testing_revision'),
'tools/clang':
Var('chromium_git') + '/chromium/src/tools/clang@' + Var('clang_revision')
}
recursedeps = [
# buildtools provides clang_format, libc++, and libc++api
'buildtools',
]
hooks = [
{
'name': 'gn_win',
'action': [ 'download_from_google_storage',
'--no_resume',
'--platform=win32',
'--no_auth',
'--bucket', 'chromium-gn',
'-s', 'SPIRV-Tools/buildtools/win/gn.exe.sha1',
],
},
{
'name': 'gn_mac',
'pattern': '.',
'action': [ 'download_from_google_storage',
'--no_resume',
'--platform=darwin',
'--no_auth',
'--bucket', 'chromium-gn',
'-s', 'SPIRV-Tools/buildtools/mac/gn.sha1',
],
},
{
'name': 'gn_linux64',
'pattern': '.',
'action': [ 'download_from_google_storage',
'--no_resume',
'--platform=linux*',
'--no_auth',
'--bucket', 'chromium-gn',
'-s', 'SPIRV-Tools/buildtools/linux64/gn.sha1',
],
},
# Pull clang-format binaries using checked-in hashes.
{
'name': 'clang_format_win',
'pattern': '.',
'action': [ 'download_from_google_storage',
'--no_resume',
'--platform=win32',
'--no_auth',
'--bucket', 'chromium-clang-format',
'-s', 'SPIRV-Tools/buildtools/win/clang-format.exe.sha1',
],
},
{
'name': 'clang_format_mac',
'pattern': '.',
'action': [ 'download_from_google_storage',
'--no_resume',
'--platform=darwin',
'--no_auth',
'--bucket', 'chromium-clang-format',
'-s', 'SPIRV-Tools/buildtools/mac/clang-format.sha1',
],
},
{
'name': 'clang_format_linux',
'pattern': '.',
'action': [ 'download_from_google_storage',
'--no_resume',
'--platform=linux*',
'--no_auth',
'--bucket', 'chromium-clang-format',
'-s', 'SPIRV-Tools/buildtools/linux64/clang-format.sha1',
],
},
{
# Pull clang
'name': 'clang',
'pattern': '.',
'action': ['python',
'SPIRV-Tools/tools/clang/scripts/update.py'
],
},
{
'name': 'sysroot_arm',
'pattern': '.',
'condition': 'checkout_linux and checkout_arm',
'action': ['python', 'SPIRV-Tools/build/linux/sysroot_scripts/install-sysroot.py',
'--arch=arm'],
},
{
'name': 'sysroot_arm64',
'pattern': '.',
'condition': 'checkout_linux and checkout_arm64',
'action': ['python', 'SPIRV-Tools/build/linux/sysroot_scripts/install-sysroot.py',
'--arch=arm64'],
},
{
'name': 'sysroot_x86',
'pattern': '.',
'condition': 'checkout_linux and (checkout_x86 or checkout_x64)',
'action': ['python', 'SPIRV-Tools/build/linux/sysroot_scripts/install-sysroot.py',
'--arch=x86'],
},
{
'name': 'sysroot_mips',
'pattern': '.',
'condition': 'checkout_linux and checkout_mips',
'action': ['python', 'SPIRV-Tools/build/linux/sysroot_scripts/install-sysroot.py',
'--arch=mips'],
},
{
'name': 'sysroot_x64',
'pattern': '.',
'condition': 'checkout_linux and checkout_x64',
'action': ['python', 'SPIRV-Tools/build/linux/sysroot_scripts/install-sysroot.py',
'--arch=x64'],
},
{
# Update the Windows toolchain if necessary.
'name': 'win_toolchain',
'pattern': '.',
'condition': 'checkout_win',
'action': ['python', 'SPIRV-Tools/build/vs_toolchain.py', 'update', '--force'],
},
{
# Update the Mac toolchain if necessary.
'name': 'mac_toolchain',
'pattern': '.',
'action': ['python', 'SPIRV-Tools/build/mac_toolchain.py'],
},
]
# Copyright (c) 2018 The Khronos Group Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Presubmit script for SPIRV-Tools.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built into depot_tools.
"""
LINT_FILTERS = [
"-build/storage_class",
"-readability/casting",
"-readability/fn_size",
"-readability/todo",
"-runtime/explicit",
"-runtime/int",
"-runtime/printf",
"-runtime/references",
"-runtime/string",
]
def CheckChangeOnUpload(input_api, output_api):
results = []
results += input_api.canned_checks.CheckPatchFormatted(input_api, output_api)
results += input_api.canned_checks.CheckChangeLintsClean(
input_api, output_api, None, LINT_FILTERS)
return results
# SPIR-V Tools
[![Build Status](https://travis-ci.org/KhronosGroup/SPIRV-Tools.svg?branch=master)](https://travis-ci.org/KhronosGroup/SPIRV-Tools)
[![Build status](https://ci.appveyor.com/api/projects/status/gpue87cesrx3pi0d/branch/master?svg=true)](https://ci.appveyor.com/project/Khronoswebmaster/spirv-tools/branch/master)
<img alt="Linux" src="kokoro/img/linux.png" width="20px" height="20px" hspace="2px"/>![Linux Build Status](https://storage.googleapis.com/spirv-tools/badges/build_status_linux_release.svg)
<img alt="MacOS" src="kokoro/img/macos.png" width="20px" height="20px" hspace="2px"/>![MacOS Build Status](https://storage.googleapis.com/spirv-tools/badges/build_status_macos_release.svg)
<img alt="Windows" src="kokoro/img/windows.png" width="20px" height="20px" hspace="2px"/>![Windows Build Status](https://storage.googleapis.com/spirv-tools/badges/build_status_windows_release.svg)
## Overview
......@@ -161,7 +163,10 @@ Contributions via merge request are welcome. Changes should:
other contribution to GitHub.
* Include tests to cover updated functionality.
* C++ code should follow the [Google C++ Style Guide][cpp-style-guide].
* Code should be formatted with `clang-format`. Settings are defined by
* Code should be formatted with `clang-format`.
[kokoro/check-format/build.sh](kokoro/check-format/build.sh)
shows how to download it. Note that we currently use
`clang-format version 5.0.0` for SPIRV-Tools. Settings are defined by
the included [.clang-format](.clang-format) file.
We intend to maintain a linear history on the GitHub `master` branch.
......@@ -173,7 +178,7 @@ We intend to maintain a linear history on the GitHub `master` branch.
[googletest][googletest] sources, not provided
* `external/effcee`: Location of [Effcee][effcee] sources, if the `effcee` library
is not already configured by an enclosing project.
* `external/re2`: Location of [RE2][re2] sources, if the `effcee` library is not already
* `external/re2`: Location of [RE2][re2] sources, if the `re2` library is not already
configured by an enclosing project.
(The Effcee project already requires RE2.)
* `include/`: API clients should add this directory to the include search path
......@@ -210,7 +215,7 @@ tests:
The fix is included on the googletest master branch any time after 2015-11-10.
In particular, googletest must be newer than version 1.7.0.
### Optional dependency on Effcee
### Dependency on Effcee
Some tests depend on the [Effcee][effcee] library for stateful matching.
Effcee itself depends on [RE2][re2].
......@@ -220,7 +225,6 @@ Effcee itself depends on [RE2][re2].
* Otherwise, SPIRV-Tools expects Effcee sources to appear in `external/effcee`
and RE2 sources to appear in `external/re2`.
Currently Effcee is an optional dependency, but soon it will be required.
## Build
......@@ -237,6 +241,8 @@ out code:
```sh
cd <spirv-dir>
git clone https://github.com/KhronosGroup/SPIRV-Headers.git external/spirv-headers
git clone https://github.com/google/effcee.git external/effcee
git clone https://github.com/google/re2.git external/re2
git clone https://github.com/google/googletest.git external/googletest # optional
mkdir build && cd build
......@@ -267,13 +273,33 @@ The following CMake options are supported:
See [`CMakeLists.txt`](CMakeLists.txt) for details.
* `SPIRV_WERROR={ON|OFF}`, default `ON` - Forces a compilation error on any
warnings encountered by enabling the compiler-specific compiler front-end
option.
option. No compiler front-end options are enabled when this option is OFF.
Additionally, you can pass additional C preprocessor definitions to SPIRV-Tools
via setting `SPIRV_TOOLS_EXTRA_DEFINITIONS`. For example, by setting it to
`/D_ITERATOR_DEBUG_LEVEL=0` on Windows, you can disable checked iterators and
iterator debugging.
### Android
SPIR-V Tools supports building static libraries `libSPIRV-Tools.a` and
`libSPIRV-Tools-opt.a` for Android:
```
cd <spirv-dir>
export ANDROID_NDK=/path/to/your/ndk
mkdir build && cd build
mkdir libs
mkdir app
$ANDROID_NDK/ndk-build -C ../android_test \
NDK_PROJECT_PATH=. \
NDK_LIBS_OUT=`pwd`/libs \
NDK_APP_OUT=`pwd`/app
```
## Library
### Usage
......
# Copyright 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Variable that can be used to support multiple build scenarios, like having
# Chromium specific targets in a client project's GN file etc.
build_with_chromium = false
# Don't use Chromium's third_party/binutils.
linux_use_bundled_binutils_override = false
declare_args() {
# Android 32-bit non-component, non-clang builds cannot have symbol_level=2
# due to 4GiB file size limit, see https://crbug.com/648948.
# Set this flag to true to skip the assertion.
ignore_elf32_limitations = false
# Use the system install of Xcode for tools like ibtool, libtool, etc.
# This does not affect the compiler. When this variable is false, targets will
# instead use a hermetic install of Xcode. [The hermetic install can be
# obtained with gclient sync after setting the environment variable
# FORCE_MAC_TOOLCHAIN].
use_system_xcode = ""
}
if (use_system_xcode == "") {
if (target_os == "mac") {
_result = exec_script("//build/mac/should_use_hermetic_xcode.py",
[ target_os ],
"value")
use_system_xcode = _result == 0
}
if (target_os == "ios") {
use_system_xcode = true
}
}
# Copyright 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Exclude support for registering main function in multi-process tests.
gtest_include_multiprocess = false
# Exclude support for platform-specific operations across unit tests.
gtest_include_platform_test = false
# Exclude support for testing Objective C code on OS X and iOS.
gtest_include_objc_support = false
# Exclude support for flushing coverage files on iOS.
gtest_include_ios_coverage = false
# Copyright 2018 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# These are variables that are overridable by projects that include
# SPIRV-Tools. The values in this file are the defaults for when we are
# building from SPIRV-Tools' repository.
# Whether we are building from SPIRV-Tools' repository.
# MUST be set to false in other projects.
spirv_tools_standalone = true
# The path to SPIRV-Tools' dependencies
spirv_tools_googletest_dir = "//external/googletest"
spirv_tools_spirv_headers_dir = "//external/spirv-headers"
# Find nosetests; see spirv_add_nosetests() for opting in to nosetests in a
# specific directory.
find_program(NOSETESTS_EXE NAMES nosetests PATHS $ENV{PYTHON_PACKAGE_PATH})
if (NOT NOSETESTS_EXE)
message(STATUS "SPIRV-Tools: nosetests was not found - python support code will not be tested")
else()
message(STATUS "SPIRV-Tools: nosetests found - python support code will be tested")
endif()
# Run nosetests on file ${PREFIX}_nosetest.py. Nosetests will look for classes
# and functions whose names start with "nosetest". The test name will be
# ${PREFIX}_nosetests.
function(spirv_add_nosetests PREFIX)
if(NOT "${SPIRV_SKIP_TESTS}" AND NOSETESTS_EXE)
add_test(
NAME ${PREFIX}_nosetests
COMMAND ${NOSETESTS_EXE} -m "^[Nn]ose[Tt]est" -v
${CMAKE_CURRENT_SOURCE_DIR}/${PREFIX}_nosetest.py)
endif()
endfunction()
# This file is used by git cl to get repository specific information.
CODE_REVIEW_SERVER: github.com
......@@ -66,17 +66,7 @@ if (NOT ${SPIRV_SKIP_TESTS})
endforeach()
endif()
set(SPIRV_ENABLE_EFFCEE ON)
if (MSVC)
if (MSVC_VERSION LESS 1900)
message(STATUS "SPIRV-Tools: Need Visual Studio 2015 or later for Effcee and RE2")
set(SPIRV_ENABLE_EFFCEE OFF)
endif()
endif()
if (SPIRV_ENABLE_EFFCEE)
# Find Effcee and RE2, for testing.
# Optional for now, but eventually we'll make this required.
# First find RE2, since Effcee depends on it.
# If already configured, then use that. Otherwise, prefer to find it under 're2'
......@@ -84,7 +74,7 @@ if (NOT ${SPIRV_SKIP_TESTS})
if (NOT TARGET re2)
# If we are configuring RE2, then turn off its testing. It takes a long time and
# does not add much value for us. If an enclosing project configured RE2, then it
# has already chosen whether to enable RE2 tesitng.
# has already chosen whether to enable RE2 testing.
set(RE2_BUILD_TESTING OFF CACHE STRING "Run RE2 Tests")
if (NOT RE2_SOURCE_DIR)
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/re2)
......@@ -111,12 +101,4 @@ if (NOT ${SPIRV_SKIP_TESTS})
set_property(TARGET re2 APPEND PROPERTY COMPILE_OPTIONS -w)
endif()
endif()
# TODO(dneto): Eventually, require this.
endif()
if (TARGET effcee)
message(STATUS "SPIRV-Tools: Effcee is configured")
else()
message(STATUS "SPIRV-Tools: Effcee is not configured. Skipping Effcee-based tests.")
endif()
endif()