Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (140)
22ce39c8
Start SPIRV-Tools v2019.5
Aug 08, 2019
95386f9e
Instrument: Fix version 2 output record write for tess eval shaders. (#2782)
Aug 09, 2019
f701237f
Remove useless semi-colons (#2789)
Aug 12, 2019
60043edf
Replace OpKill With function call. (#2790)
Aug 14, 2019
bbd80462
Fix validation of constant matrices (#2794)
Aug 14, 2019
ff872dc6
Change the way to include header (#2795)
Aug 14, 2019
dac9210d
Use ascii code based characters (#2796)
Aug 15, 2019
7b4e5bd5
Update remquo validation to match the OpenCL Extended Instruction Set Specification (#2791)
Aug 15, 2019
06407250
Instrument: Add support for Buffer Device Address extension (#2792)
Aug 16, 2019
9cd07272
More handle overflow in sroa (#2800)
Aug 16, 2019
bc62722b
Handle overflow in wrap-opkill (#2801)
Aug 18, 2019
0cbdc7a2
Remove unimplemented method declaration (#2804)
Aug 20, 2019
c5d1dab9
Add name for variables in desc sroa (#2805)
Aug 21, 2019
aef8f92b
Even more id overflow in sroa (#2806)
Aug 21, 2019
b00ef0d2
Handle Id overflow in private-to-local (#2807)
Aug 22, 2019
8336d192
Extend reducer to remove relaxed precision decorations (#2797)
Aug 22, 2019
1eb89172
Add missing files to BUILD.gn (#2809)
Aug 23, 2019
15fc19d0
Refactor instruction folders (#2815)
Aug 26, 2019
73422a0a
Check feature mgr in context consistency check (#2818)
Aug 28, 2019
5a581e73
spvtools::Optimizer - don't assume original_binary and optimized_binary are aliased (#2799)
Aug 29, 2019
35d98be3
Amd ext to khr (#2811)
Aug 29, 2019
4ae9b716
Fix gn check (#2821)
Aug 30, 2019
ad71c057
Replace SwizzleInvocationsMaskedAMD extended instruction. (#2822)
Aug 30, 2019
d67130ca
Replace SwizzleInvocationsAMD extended instruction. (#2823)
Aug 30, 2019
65e362b7
AggressiveDCEPass: Set modified to true when appending to to_kill_ (#2825)
Aug 30, 2019
2c5ed16b
Fix end comments in header files (#2829)
Sep 02, 2019
b54d9502
Fold Fmix should accept vector operands. (#2826)
Sep 03, 2019
1c9ca422
GN: Make SPIRV-Tools target use public_deps. (#2828)
Sep 03, 2019
d11725b1
Add --relax-float-ops and --convert-relaxed-to-half (#2808)
Sep 03, 2019
c77045b4
Instrument: Be sure Float16 capability on when generating float16 null (#2831)
Sep 03, 2019
9b3cc3e0
Upadate CHANGES
Sep 03, 2019
635b583c
GN: Add Chromium GoogleTest deps. (#2832)
Sep 04, 2019
1dfb5fc1
Export SPIRV-Tools targets on installation (#2785)
Sep 04, 2019
19b25661
For WebGPU<->Vulkan optimization, set correct execution environment (#2834)
Sep 04, 2019
a41520ea
Replace uses of SPV_AMD_shader_trinary_minmax extension (#2835)
Sep 05, 2019
b218ad19
Fold Min, Max, and Clamp instructions. (#2836)
Sep 05, 2019
76261e2a
Replace CubeFaceCoord and CubeFaceIndexAMD (#2840)
Sep 06, 2019
6797173c
Don't register duplicate decoration in validator. (#2841)
Sep 09, 2019
a464ac1a
Add generic builtin validation of target (#2843)
Sep 09, 2019
7f7236f1
Handle id overflow in the constant manager. (#2844)
Sep 09, 2019
35c9518c
Handle id overflow in the ssa rewriter. (#2845)
Sep 10, 2019
7ee8f443
Fix add-dead-break and add-dead-continue passes to respect dominance (#2838)
Sep 10, 2019
e2e95172
Rework management of probabilities in spirv-fuzz (#2839)
Sep 10, 2019
c0e98070
Handle creating a new constant failing gracefully (#2848)
Sep 10, 2019
9f188e33
Assembler: Can't set an ID in instruction without result ID (#2852)
Sep 11, 2019
4f9256db
Handle id overflow in wrap op kill. (#2851)
Sep 11, 2019
c7a39bc4
Don't inline function containing OpKill (#2842)
Sep 11, 2019
67b87f22
Handle another case where creating a constant can fail (#2854)
Sep 11, 2019
ad7f2c5c
Add fuzzer pass to copy objects (#2853)
Sep 11, 2019
5a48c0da
SPIRV-Tools support for SPIR-V 1.5 (#2865)
Sep 13, 2019
1e146e8a
Split capability tests (#2866)
Sep 13, 2019
93256193
Extra resource interface validation (#2864)
Sep 16, 2019
99793fa6
Adding valilidation checks for OpEntryPoint duplicate names and execution mode (#2862)
Sep 16, 2019
36c1c0e2
Fix Fuchsia build. (#2868)
Sep 17, 2019
bbb29870
Relaxed bitcast with pointers (#2878)
Sep 18, 2019
0a07cd1c
Add fuzzer pass to replace ids with synonyms (#2857)
Sep 18, 2019
ccd7bf16
Fix CMake issue related to spirv-fuzz (#2877)
Sep 18, 2019
e59b60de
Fix detection of blocks bypassed by new edge (#2874)
Sep 18, 2019
c02a6191
Update SPIRV-Headers in DEPS (#2880)
Sep 18, 2019
acf20302
Android.mk: Add dependency from optimizer file to amd-shader-ballot-insts.inc (#2883)
Sep 18, 2019
605c2e3c
Add WebGPU SPIR-V Assembler in JavaScript. (#2876)
Sep 18, 2019
47e354b0
Move docs into docs/ folder (#2872)
Sep 19, 2019
d06fe084
Fix comment typo found by protobufs linter (#2884)
Sep 19, 2019
248c80b0
Handle OpConstantNull in copy-prop-arrays. (#2870)
Sep 19, 2019
08fcf8a4
Fix header include syntax. (#2882)
Sep 19, 2019
87f0fa43
Use OpReturn* in wrap-opkill
Sep 19, 2019
61edde52
Revert "Use OpReturn* in wrap-opkill"
Sep 19, 2019
4eee71e7
Disable long-running fuzzer tests by default (#2887)
Sep 20, 2019
7275a716
Allow validation during spirv-fuzz replay (#2873)
Sep 20, 2019
46531272
Fix to CMakeLists for spirv-fuzz tests (#2888)
Sep 20, 2019
6b072126
Use OpReturn* in wrap-opkill (#2886)
Sep 20, 2019
8d0ca43d
Add method comment for opt::Function::WhileEachInst (#2867)
Sep 23, 2019
f62ee4a4
Update DEPS: effcee, re2, googletest (#2881)
Sep 23, 2019
b83535da
Fix operand index in spirv-fuzz (#2895)
Sep 23, 2019
958f7e72
Employ the "swarm testing" idea in spirv-fuzz (#2890)
Sep 23, 2019
3a762d54
Add missing GN dependency (#2899)
Sep 23, 2019
71e0ba60
Add OpCopyMemory test to SVA. (#2885)
Sep 24, 2019
6f26d9ad
Handle id overflow in convert local access chains (#2908)
Sep 24, 2019
a03cd1f3
Add Bazel build configuration. (#2891)
Sep 24, 2019
55ea57a7
Handle extract with no indexes (#2910)
Sep 24, 2019
527a6893
Remove validate_datarules.cpp (#2911)
Sep 24, 2019
290f6a82
spirv-fuzz: do not replace boolean constant argument to OpPhi instruction (#2903)
Sep 25, 2019
7bc114ba
spirv-fuzz: do not replace a pointer argument to a function call with a synonym (#2901)
Sep 25, 2019
c1e03834
spirv-fuzz: Fixes to preconditions for adding dead break/continue edges (#2904)
Sep 25, 2019
70097c77
spirv-fuzz: do not replace struct indices with synonyms (#2915)
Sep 25, 2019
2a11f365
Handle id overflow in wrap-opkill (#2916)
Sep 25, 2019
510ca9d6
Only allow previously declared forward refs in structs (#2920)
Sep 25, 2019
27238bcc
spirv-fuzz: preserve some analyses when permuting blocks (#2918)
Sep 26, 2019
84b19760
spirv-fuzz: do not allow a dead break to target an unreachable block (#2917)
Sep 26, 2019
10951a7c
Refactor the InstructionPass (#2924)
Sep 27, 2019
bc84daff
Add Kokoro bots for building with Bazel. (#2914)
Sep 27, 2019
ef4679a5
spirv-fuzz: allow interestingness script arguments (#2925)
Sep 27, 2019
4075b921
Add removing references to debug instructions when removing them (#2923)
Sep 27, 2019
85c67b5e
Record trailing line dbg instructions (#2926)
Sep 27, 2019
9eb1c9a4
Add continue construct analysis to struct cfg analysis (#2922)
Oct 01, 2019
44b32176
fuzz: add shrinker-temp-file-prefix (#2928)
Oct 01, 2019
9d7428b0
Validate physical storage buffer restrictions (#2930)
Oct 02, 2019
bd839ca6
reduce/fuzz: improve command line args (#2932)
Oct 03, 2019
bc37fd58
Add SPV_KHR_shader_clock validation (#2879)
Oct 03, 2019
8fa0f1a6
spirv-fuzz: option to convert shader into a form that renders red (#2934)
Oct 03, 2019
Show whitespace changes
Inline
Side-by-side
.gitignore
View file @
10ead80d
...
...
@@ -16,6 +16,11 @@ compile_commands.json
/testing
/tools/clang/
/utils/clang-format-diff.py
bazel-bin
bazel-genfiles
bazel-out
bazel-spirv-tools
bazel-testlogs
# Vim
[._]*.s[a-w][a-z]
...
...
Android.mk
View file @
10ead80d
...
...
@@ -49,7 +49,6 @@ SPVTOOLS_SRC_FILES := \
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
\
...
...
@@ -75,6 +74,7 @@ SPVTOOLS_SRC_FILES := \
SPVTOOLS_OPT_SRC_FILES
:=
\
source
/opt/aggressive_dead_code_elim_pass.cpp
\
source
/opt/amd_ext_to_khr.cpp
\
source
/opt/basic_block.cpp
\
source
/opt/block_merge_pass.cpp
\
source
/opt/block_merge_util.cpp
\
...
...
@@ -88,6 +88,7 @@ SPVTOOLS_OPT_SRC_FILES := \
source
/opt/composite.cpp
\
source
/opt/const_folding_rules.cpp
\
source
/opt/constants.cpp
\
source
/opt/convert_to_half_pass.cpp
\
source
/opt/copy_prop_arrays.cpp
\
source
/opt/dead_branch_elim_pass.cpp
\
source
/opt/dead_insert_elim_pass.cpp
\
...
...
@@ -117,6 +118,7 @@ SPVTOOLS_OPT_SRC_FILES := \
source
/opt/inline_exhaustive_pass.cpp
\
source
/opt/inline_opaque_pass.cpp
\
source
/opt/inst_bindless_check_pass.cpp
\
source
/opt/inst_buff_addr_check_pass.cpp
\
source
/opt/instruction.cpp
\
source
/opt/instruction_list.cpp
\
source
/opt/instrument_pass.cpp
\
...
...
@@ -128,7 +130,6 @@ SPVTOOLS_OPT_SRC_FILES := \
source
/opt/local_redundancy_elimination.cpp
\
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
\
...
...
@@ -151,6 +152,7 @@ SPVTOOLS_OPT_SRC_FILES := \
source
/opt/reduce_load_size.cpp
\
source
/opt/redundancy_elimination.cpp
\
source
/opt/register_pressure.cpp
\
source
/opt/relax_float_ops_pass.cpp
\
source
/opt/remove_duplicates_pass.cpp
\
source
/opt/replace_invalid_opc.cpp
\
source
/opt/scalar_analysis.cpp
\
...
...
@@ -171,7 +173,8 @@ SPVTOOLS_OPT_SRC_FILES := \
source
/opt/upgrade_memory_model.cpp
\
source
/opt/value_number_table.cpp
\
source
/opt/vector_dce.cpp
\
source
/opt/workaround1209.cpp
source
/opt/workaround1209.cpp
\
source
/opt/wrap_opkill.cpp
# Locations of grammar files.
#
...
...
@@ -246,6 +249,8 @@ $(LOCAL_PATH)/source/ext_inst.cpp: \
$(1)/spv-amd-shader-ballot.insts.inc
\
$(1)/spv-amd-shader-explicit-vertex-parameter.insts.inc
\
$(1)/spv-amd-shader-trinary-minmax.insts.inc
$(LOCAL_PATH)/source/opt/amd_ext_to_khr.cpp
:
\
$(1)/spv-amd-shader-ballot.insts.inc
endef
$(
eval
$(
call gen_spvtools_grammar_tables,
$(
SPVTOOLS_OUT_PATH
)))
...
...
BUILD.bazel
0 → 100644
View file @
10ead80d
load
(
"
:build_defs.bzl
"
,
"
COMMON_COPTS
"
,
"
DEBUGINFO_GRAMMAR_JSON_FILE
"
,
"
TEST_COPTS
"
,
"
base_test
"
,
"
generate_core_tables
"
,
"
generate_enum_string_mapping
"
,
"
generate_extinst_lang_headers
"
,
"
generate_glsl_tables
"
,
"
generate_opencl_tables
"
,
"
generate_vendor_tables
"
,
"
link_test
"
,
"
opt_test
"
,
"
reduce_test
"
,
"
util_test
"
,
"
val_test
"
,
)
package
(
default_visibility
=
[
"
//visibility:private
"
],
)
licenses
([
"
notice
"
])
exports_files
([
"
CHANGES
"
,
"
LICENSE
"
,
])
py_binary
(
name
=
"
generate_grammar_tables
"
,
srcs
=
[
"
utils/generate_grammar_tables.py
"
],
)
py_binary
(
name
=
"
generate_language_headers
"
,
srcs
=
[
"
utils/generate_language_headers.py
"
],
)
generate_core_tables
(
"
1.0
"
)
generate_core_tables
(
"
1.1
"
)
generate_core_tables
(
"
1.2
"
)
generate_core_tables
(
"
unified1
"
)
generate_enum_string_mapping
(
"
unified1
"
)
generate_opencl_tables
(
"
unified1
"
)
generate_glsl_tables
(
"
unified1
"
)
generate_vendor_tables
(
"
spv-amd-shader-explicit-vertex-parameter
"
)
generate_vendor_tables
(
"
spv-amd-shader-trinary-minmax
"
)
generate_vendor_tables
(
"
spv-amd-gcn-shader
"
)
generate_vendor_tables
(
"
spv-amd-shader-ballot
"
)
generate_vendor_tables
(
"
debuginfo
"
)
generate_extinst_lang_headers
(
"
DebugInfo
"
,
DEBUGINFO_GRAMMAR_JSON_FILE
)
py_binary
(
name
=
"
generate_registry_tables
"
,
srcs
=
[
"
utils/generate_registry_tables.py
"
],
)
genrule
(
name
=
"
gen_registry_tables
"
,
srcs
=
[
"
@spirv_headers//:spirv_xml_registry
"
],
outs
=
[
"
generators.inc
"
],
cmd
=
"
$(location generate_registry_tables) --xml=$(location @spirv_headers//:spirv_xml_registry) --generator-output=$(location generators.inc)
"
,
tools
=
[
"
:generate_registry_tables
"
],
)
py_binary
(
name
=
"
update_build_version
"
,
srcs
=
[
"
utils/update_build_version.py
"
],
)
genrule
(
name
=
"
gen_build_version
"
,
srcs
=
[
"
CHANGES
"
],
outs
=
[
"
build-version.inc
"
],
cmd
=
"
SOURCE_DATE_EPOCH=0 $(location update_build_version) $$(dirname $(location CHANGES)) $(location build-version.inc)
"
,
tools
=
[
"
:update_build_version
"
],
)
# Libraries
cc_library
(
name
=
"
generated_headers
"
,
hdrs
=
[
"
:gen_build_version
"
,
"
:gen_core_tables_1.0
"
,
"
:gen_core_tables_1.1
"
,
"
:gen_core_tables_1.2
"
,
"
:gen_core_tables_unified1
"
,
"
:gen_enum_string_mapping
"
,
"
:gen_extinst_lang_headers_DebugInfo
"
,
"
:gen_glsl_tables_unified1
"
,
"
:gen_opencl_tables_unified1
"
,
"
:gen_registry_tables
"
,
"
:gen_vendor_tables_debuginfo
"
,
"
:gen_vendor_tables_spv_amd_gcn_shader
"
,
"
:gen_vendor_tables_spv_amd_shader_ballot
"
,
"
:gen_vendor_tables_spv_amd_shader_explicit_vertex_parameter
"
,
"
:gen_vendor_tables_spv_amd_shader_trinary_minmax
"
,
],
copts
=
COMMON_COPTS
,
)
cc_library
(
name
=
"
spirv_tools_headers
"
,
hdrs
=
glob
([
"
include/spirv-tools/libspirv.h
"
,
"
include/spirv-tools/libspirv.hpp
"
,
"
source/*.h
"
,
"
source/util/*.h
"
,
"
source/val/*.h
"
,
]),
copts
=
COMMON_COPTS
,
includes
=
[
"
source
"
],
deps
=
[
"
@spirv_headers//:spirv_c_headers
"
,
],
)
cc_library
(
name
=
"
spirv_tools
"
,
srcs
=
glob
([
"
source/*.cpp
"
,
"
source/util/*.cpp
"
,
"
source/val/*.cpp
"
,
]),
hdrs
=
[
"
include/spirv-tools/libspirv.h
"
,
"
include/spirv-tools/libspirv.hpp
"
,
],
copts
=
COMMON_COPTS
+
select
({
"
@bazel_tools//src/conditions:windows
"
:
[
""
],
"
//conditions:default
"
:
[
"
-Wno-implicit-fallthrough
"
],
}),
includes
=
[
"
include
"
],
linkstatic
=
1
,
visibility
=
[
"
//visibility:public
"
],
deps
=
[
"
:generated_headers
"
,
"
:spirv_tools_headers
"
,
"
@spirv_headers//:spirv_c_headers
"
,
"
@spirv_headers//:spirv_common_headers
"
,
],
)
cc_library
(
name
=
"
spirv_tools_comp
"
,
srcs
=
glob
([
"
source/comp/*.cpp
"
,
"
source/comp/*.h
"
,
]),
copts
=
COMMON_COPTS
,
linkstatic
=
1
,
visibility
=
[
"
//visibility:public
"
],
deps
=
[
"
:generated_headers
"
,
"
:spirv_tools
"
,
"
:spirv_tools_headers
"
,
"
@spirv_headers//:spirv_common_headers
"
,
],
)
cc_library
(
name
=
"
spirv_tools_opt_headers
"
,
hdrs
=
glob
([
"
source/opt/*.h
"
]),
copts
=
COMMON_COPTS
,
)
cc_library
(
name
=
"
spirv_tools_opt
"
,
srcs
=
glob
([
"
source/opt/*.cpp
"
]),
hdrs
=
[
"
include/spirv-tools/instrument.hpp
"
,
"
include/spirv-tools/optimizer.hpp
"
,
],
copts
=
COMMON_COPTS
,
includes
=
[
"
include
"
],
linkstatic
=
1
,
visibility
=
[
"
//visibility:public
"
],
deps
=
[
"
:spirv_tools
"
,
"
:spirv_tools_headers
"
,
"
:spirv_tools_opt_headers
"
,
"
@spirv_headers//:spirv_common_headers
"
,
],
)
cc_library
(
name
=
"
spirv_tools_reduce
"
,
srcs
=
glob
([
"
source/reduce/*.cpp
"
]),
hdrs
=
glob
([
"
source/reduce/*.h
"
]),
copts
=
COMMON_COPTS
,
linkstatic
=
1
,
visibility
=
[
"
//visibility:public
"
],
deps
=
[
"
:spirv_tools
"
,
"
:spirv_tools_opt
"
,
],
)
cc_library
(
name
=
"
spirv_tools_link
"
,
srcs
=
glob
([
"
source/link/*.cpp
"
]),
hdrs
=
[
"
include/spirv-tools/linker.hpp
"
],
copts
=
COMMON_COPTS
,
linkstatic
=
1
,
visibility
=
[
"
//visibility:public
"
],
deps
=
[
"
:spirv_tools
"
,
"
:spirv_tools_opt
"
,
],
)
cc_library
(
name
=
"
tools_util
"
,
srcs
=
glob
([
"
tools/util/*.cpp
"
]),
hdrs
=
glob
([
"
tools/util/*.h
"
]),
copts
=
COMMON_COPTS
,
linkstatic
=
1
,
visibility
=
[
"
//visibility:public
"
],
deps
=
[
"
:spirv_tools
"
],
)
# Tools
cc_binary
(
name
=
"
spirv-as
"
,
srcs
=
[
"
tools/as/as.cpp
"
,
"
tools/io.h
"
,
],
copts
=
COMMON_COPTS
,
visibility
=
[
"
//visibility:public
"
],
deps
=
[
"
:spirv_tools
"
,
],
)
cc_binary
(
name
=
"
spirv-dis
"
,
srcs
=
[
"
tools/dis/dis.cpp
"
,
"
tools/io.h
"
,
],
copts
=
COMMON_COPTS
,
visibility
=
[
"
//visibility:public
"
],
deps
=
[
"
:spirv_tools
"
,
],
)
cc_binary
(
name
=
"
spirv-val
"
,
srcs
=
[
"
tools/io.h
"
,
"
tools/val/val.cpp
"
,
],
copts
=
COMMON_COPTS
,
visibility
=
[
"
//visibility:public
"
],
deps
=
[
"
:spirv_tools
"
,
"
:tools_util
"
,
],
)
cc_binary
(
name
=
"
spirv-opt
"
,
srcs
=
[
"
tools/io.h
"
,
"
tools/opt/opt.cpp
"
,
],
copts
=
COMMON_COPTS
,
visibility
=
[
"
//visibility:public
"
],
deps
=
[
"
:spirv_tools
"
,
"
:spirv_tools_opt
"
,
"
:tools_util
"
,
],
)
cc_binary
(
name
=
"
spirv-reduce
"
,
srcs
=
[
"
tools/io.h
"
,
"
tools/reduce/reduce.cpp
"
,
],
copts
=
COMMON_COPTS
,
visibility
=
[
"
//visibility:public
"
],
deps
=
[
"
:spirv_tools
"
,
"
:spirv_tools_opt
"
,
"
:spirv_tools_reduce
"
,
"
:tools_util
"
,
],
)
cc_binary
(
name
=
"
spirv-link
"
,
srcs
=
[
"
tools/io.h
"
,
"
tools/link/linker.cpp
"
,
],
copts
=
COMMON_COPTS
,
visibility
=
[
"
//visibility:public
"
],
deps
=
[
"
:spirv_tools
"
,
"
:spirv_tools_link
"
,
],
)
cc_binary
(
name
=
"
spirv-cfg
"
,
srcs
=
[
"
tools/cfg/bin_to_dot.cpp
"
,
"
tools/cfg/bin_to_dot.h
"
,
"
tools/cfg/cfg.cpp
"
,
"
tools/io.h
"
,
],
copts
=
COMMON_COPTS
,
visibility
=
[
"
//visibility:public
"
],
deps
=
[
"
:spirv_tools
"
],
)
# Unit tests
cc_library
(
name
=
"
test_common
"
,
testonly
=
1
,
srcs
=
[
"
test/test_fixture.h
"
,
"
test/unit_spirv.cpp
"
,
"
test/unit_spirv.h
"
,
],
compatible_with
=
[],
copts
=
TEST_COPTS
,
includes
=
[
"
test
"
],
linkstatic
=
1
,
deps
=
[
"
:spirv_tools
"
,
"
@com_google_googletest//:gtest
"
,
],
)
cc_library
(
name
=
"
link_test_common
"
,
testonly
=
1
,
srcs
=
[
"
test/link/linker_fixture.h
"
],
compatible_with
=
[],
copts
=
TEST_COPTS
,
linkstatic
=
1
,
deps
=
[
"
:spirv_tools_link
"
,
"
:test_common
"
,
],
)
cc_library
(
name
=
"
opt_test_common
"
,
testonly
=
1
,
srcs
=
[
"
test/opt/pass_utils.cpp
"
],
hdrs
=
[
"
test/opt/assembly_builder.h
"
,
"
test/opt/function_utils.h
"
,
"
test/opt/module_utils.h
"
,
"
test/opt/pass_fixture.h
"
,
"
test/opt/pass_utils.h
"
,
],
compatible_with
=
[],
copts
=
TEST_COPTS
,
linkstatic
=
1
,
deps
=
[
"
:spirv_tools_opt
"
,
"
:test_common
"
,
],
)
cc_library
(
name
=
"
reduce_test_common
"
,
testonly
=
1
,
srcs
=
[
"
test/reduce/reduce_test_util.cpp
"
,
"
tools/io.h
"
,
],
hdrs
=
[
"
test/reduce/reduce_test_util.h
"
],
compatible_with
=
[],
copts
=
TEST_COPTS
,
linkstatic
=
1
,
deps
=
[
"
:spirv_tools_reduce
"
,
"
:test_common
"
,
],
)
cc_library
(
name
=
"
val_test_common
"
,
testonly
=
1
,
srcs
=
[
"
test/val/val_code_generator.cpp
"
,
"
test/val/val_fixtures.h
"
,
],
hdrs
=
[
"
test/val/val_code_generator.h
"
,
],
compatible_with
=
[],
copts
=
TEST_COPTS
,
linkstatic
=
1
,
deps
=
[
"
:test_common
"
],
)
# PCH (precompiled header) tests only work when using CMake and MSVC on Windows,
# so they will be skipped in the Bazel builds.
[
base_test
(
name
=
f
[
5
:
-
4
],
# strip test/, .cpp
srcs
=
[
f
],
)
for
f
in
glob
(
[
"
test/*.cpp
"
],
exclude
=
[
"
test/cpp_interface_test.cpp
"
,
# has its own base_test below.
"
test/log_test.cpp
"
,
# has its own base_test below.
"
test/pch_test.cpp
"
,
# pch tests are skipped.
"
test/timer_test.cpp
"
,
# has its own base_test below.
],
)]
# This test uses unistd.h and does not run on Windows.
base_test
(
name
=
"
timer_test
"
,
srcs
=
select
({
"
@bazel_tools//src/conditions:windows
"
:
[],
"
//conditions:default
"
:
[
"
test/timer_test.cpp
"
],
}),
)
base_test
(
name
=
"
cpp_interface_test
"
,
srcs
=
[
"
test/cpp_interface_test.cpp
"
],
deps
=
[
"
:spirv_tools_opt
"
],
)
base_test
(
name
=
"
log_test
"
,
srcs
=
[
"
test/log_test.cpp
"
],
deps
=
[
"
:spirv_tools_opt
"
],
)
[
link_test
(
name
=
f
[
10
:
-
4
],
# strip test/link/, .cpp
srcs
=
[
f
],
)
for
f
in
glob
(
[
"
test/link/*.cpp
"
],
)]
[
opt_test
(
name
=
f
[
9
:
-
4
],
# strip test/opt/, .cpp
srcs
=
[
f
],
)
for
f
in
glob
(
[
"
test/opt/*.cpp
"
],
# pch tests are skipped.
exclude
=
[
"
test/opt/pch_test_opt.cpp
"
],
)]
[
opt_test
(
name
=
"
dom_tree_
"
+
f
[
24
:
-
4
],
# strip test/opt/dominator_tree/, .cpp
srcs
=
[
f
],
)
for
f
in
glob
(
[
"
test/opt/dominator_tree/*.cpp
"
],
# pch tests are skipped.
exclude
=
[
"
test/opt/dominator_tree/pch_test_opt_dom.cpp
"
],
)]
[
opt_test
(
name
=
"
loop_
"
+
f
[
28
:
-
4
],
# strip test/opt/loop_optimizations/, .cpp
srcs
=
[
f
],
)
for
f
in
glob
(
[
"
test/opt/loop_optimizations/*.cpp
"
],
# pch tests are skipped.
exclude
=
[
"
test/opt/loop_optimizations/pch_test_opt_loop.cpp
"
],
)]
[
reduce_test
(
name
=
f
[
12
:
-
4
],
# strip test/reduce/, .cpp
srcs
=
[
f
],
)
for
f
in
glob
([
"
test/reduce/*.cpp
"
])]
[
util_test
(
name
=
f
[
10
:
-
4
],
# strip test/util/, .cpp
srcs
=
[
f
],
)
for
f
in
glob
([
"
test/util/*.cpp
"
])]
[
val_test
(
name
=
f
[
9
:
-
4
],
# strip test/val/, .cpp
srcs
=
[
f
],
)
for
f
in
glob
(
[
"
test/val/*.cpp
"
],
exclude
=
[
"
test/val/pch_test_val.cpp
"
,
# pch tests are skipped.
],
)]
BUILD.gn
View file @
10ead80d
...
...
@@ -288,7 +288,10 @@ config("spvtools_internal_config") {
configs = [ ":spvtools_public_config" ]
if (is_clang) {
cflags = [ "-Wno-implicit-fallthrough" ]
cflags = [
"-Wno-implicit-fallthrough",
"-Wno-newline-eof",
]
}
}
...
...
@@ -407,7 +410,6 @@ static_library("spvtools_val") {
"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",
...
...
@@ -451,6 +453,8 @@ static_library("spvtools_opt") {
sources = [
"source/opt/aggressive_dead_code_elim_pass.cpp",
"source/opt/aggressive_dead_code_elim_pass.h",
"source/opt/amd_ext_to_khr.cpp",
"source/opt/amd_ext_to_khr.h",
"source/opt/basic_block.cpp",
"source/opt/basic_block.h",
"source/opt/block_merge_pass.cpp",
...
...
@@ -477,6 +481,8 @@ static_library("spvtools_opt") {
"source/opt/const_folding_rules.h",
"source/opt/constants.cpp",
"source/opt/constants.h",
"source/opt/convert_to_half_pass.cpp",
"source/opt/convert_to_half_pass.h",
"source/opt/copy_prop_arrays.cpp",
"source/opt/copy_prop_arrays.h",
"source/opt/dead_branch_elim_pass.cpp",
...
...
@@ -535,6 +541,8 @@ static_library("spvtools_opt") {
"source/opt/inline_pass.h",
"source/opt/inst_bindless_check_pass.cpp",
"source/opt/inst_bindless_check_pass.h",
"source/opt/inst_buff_addr_check_pass.cpp",
"source/opt/inst_buff_addr_check_pass.h",
"source/opt/instruction.cpp",
"source/opt/instruction.h",
"source/opt/instruction_list.cpp",
...
...
@@ -559,8 +567,6 @@ static_library("spvtools_opt") {
"source/opt/local_single_block_elim_pass.h",
"source/opt/local_single_store_elim_pass.cpp",
"source/opt/local_single_store_elim_pass.h",
"source/opt/local_ssa_elim_pass.cpp",
"source/opt/local_ssa_elim_pass.h",
"source/opt/log.h",
"source/opt/loop_dependence.cpp",
"source/opt/loop_dependence.h",
...
...
@@ -607,6 +613,8 @@ static_library("spvtools_opt") {
"source/opt/reflect.h",
"source/opt/register_pressure.cpp",
"source/opt/register_pressure.h",
"source/opt/relax_float_ops_pass.cpp",
"source/opt/relax_float_ops_pass.h",
"source/opt/remove_duplicates_pass.cpp",
"source/opt/remove_duplicates_pass.h",
"source/opt/replace_invalid_opc.cpp",
...
...
@@ -650,10 +658,13 @@ static_library("spvtools_opt") {
"source/opt/vector_dce.h",
"source/opt/workaround1209.cpp",
"source/opt/workaround1209.h",
"source/opt/wrap_opkill.cpp",
"source/opt/wrap_opkill.h",
]
deps = [
":spvtools",
":spvtools_vendor_tables_spv-amd-shader-ballot",
]
public_deps = [
":spvtools_headers",
...
...
@@ -723,8 +734,6 @@ static_library("spvtools_reduce") {
"source/reduce/remove_function_reduction_opportunity_finder.h",
"source/reduce/remove_instruction_reduction_opportunity.cpp",
"source/reduce/remove_instruction_reduction_opportunity.h",
"source/reduce/remove_opname_instruction_reduction_opportunity_finder.cpp",
"source/reduce/remove_opname_instruction_reduction_opportunity_finder.h",
"source/reduce/remove_selection_reduction_opportunity.cpp",
"source/reduce/remove_selection_reduction_opportunity.h",
"source/reduce/remove_selection_reduction_opportunity_finder.cpp",
...
...
@@ -757,7 +766,7 @@ static_library("spvtools_reduce") {
}
group("SPIRV-Tools") {
deps = [
public_
deps = [
":spvtools",
":spvtools_link",
":spvtools_opt",
...
...
@@ -837,6 +846,8 @@ if (build_with_chromium) {
"//testing/gmock",
"//testing/gtest",
"//testing/gtest:gtest_main",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
if (is_clang) {
...
...
@@ -861,6 +872,7 @@ source_set("spvtools_util_cli_consumer") {
"tools/util/cli_consumer.cpp",
"tools/util/cli_consumer.h",
]
deps = [ ":spvtools_headers" ]
configs += [ ":spvtools_internal_config" ]
}
...
...
CHANGES
View file @
10ead80d
Revision history for SPIRV-Tools
v2019.5-dev 2019-10-21
- General:
- Export SPIRV-Tools targets on installation
- SPIRV-Tools support for SPIR-V 1.5 (#2865)
- Add WebGPU SPIR-V Assembler in JavaScript. (#2876)
- Add Bazel build configuration. (#2891)
- Add support for building with emscripten (#2948)
- Update SPIR-V binary header test for SPIR-V 1.5 (#2967)
- Add fuzzer for spirv-as call path (#2976)
- Improved CMake install step. (#2963)
- Add fuzzer for spirv-dis call path (#2977)
- Ensure timestamp does not vary with timezone. (#2982)
- Optimizer
- Add descriptor array scalar replacement (#2742)
- Add pass to wrap OpKill in a function call (#2790)
- Fold FMix during constant folding. (#2818)
- Add pass to replace AMD shader ballot extension (#2811)
- Add pass to make Float32 operation relax precision (#2808)
- Add pass to make relax precision operation Float16 (#2808)
- Add pass to replace uses of 3 AMD extensions (#2814)
- Fold Min, Max, and Clamp instructions. (#2836)
- Better handling of OpKill in continues (#2842,#2922,#2933)
- Enable OpTypeCooperativeMatrix specialization (#2927)
- Support constant-folding UConvert and SConvert (#2960)
Fixes:
- Instrument: Fix version 2 output record write for tess eval shaders. (#2782)
- Instrument: Add support for Buffer Device Address extension (#2792)
- Fix check for changed binary in API call. (#2798)
- For WebGPU<->Vulkan optimization, set correct execution environment (#2834)
- Handle OpConstantNull in copy-prop-arrays. (#2870)
- Use OpReturn* in wrap-opkill (#2886)
- Validator
- Add generic builtin validation of target (#2843)
- Extra resource interface validation (#2864)
- Adding valilidation checks for OpEntryPoint duplicate names and execution mode (#2862)
- Relaxed bitcast with pointers (#2878)
- Validate physical storage buffer restrictions (#2930)
- Add SPV_KHR_shader_clock validation (#2879)
- Validate that selections are structured (#2962)
- Disallow use of OpCompositeExtract/OpCompositeInsert with no indices (#2980)
- Check that derivatives operate on 32-bit values (#2983)
Fixes:
- Fix validation of constant matrices (#2794)
- Update "remquor" validation
- Only allow previously declared forward refs in structs (#2920)
- Reduce
- Remove relaxed precision decorations (#2797)
- Reduce/fuzz: improve command line args (#2932)
- Improve remove unref instr pass (#2945)
Fixes:
- Fuzz
- Fix add-dead-break and add-dead-continue passes to respect dominance (#2838)
- Add fuzzer pass to copy objects (#2853)
- Add fuzzer pass to replace ids with synonyms (#2857)
- Allow validation during spirv-fuzz replay (#2873)
- Employ the "swarm testing" idea in spirv-fuzz (#2890)
- reduce/fuzz: improve command line args (#2932)
- option to convert shader into a form that renders red (#2934)
- Add fuzzer pass to change selection controls (#2944)
- add transformation and pass to construct composites (#2941)
- Add fuzzer pass to change loop controls (#2949)
- Add fuzzer pass to change function controls (#2951)
- Add fuzzer pass to add NoContraction decorations (#2950)
v2019.4 2019-08-08
- General:
- Memory model support for SPIR-V 1.4
...
...
@@ -15,7 +80,7 @@ v2019.4 2019-08-08
- Handle nested breaks from switches. (#2624)
- Optimizer: Handle array type with OpSpecConstantOp length (#2652)
- Perform merge return with single return in loop. (#2714)
- Add
—
preserve-bindings and
—
preserve-spec-constants (#2693)
- Add
--
preserve-bindings and
--
preserve-spec-constants (#2693)
- Remove Common Uniform Elimination Pass (#2731)
- Allow ray tracing shaders in inst bindle check pass. (#2733)
- Add pass to inject code for robust-buffer-access semantics (#2771)
...
...
CMakeLists.txt
View file @
10ead80d
...
...
@@ -39,6 +39,8 @@ option(SPIRV_ALLOW_TIMERS "Allow timers via clock_gettime on supported platforms
if
(
"
${
CMAKE_SYSTEM_NAME
}
"
STREQUAL
"Linux"
)
add_definitions
(
-DSPIRV_LINUX
)
set
(
SPIRV_TIMER_ENABLED
${
SPIRV_ALLOW_TIMERS
}
)
elseif
(
"
${
CMAKE_SYSTEM_NAME
}
"
STREQUAL
"Emscripten"
)
add_definitions
(
-DSPIRV_EMSCRIPTEN
)
elseif
(
"
${
CMAKE_SYSTEM_NAME
}
"
STREQUAL
"Windows"
)
add_definitions
(
-DSPIRV_WINDOWS
)
elseif
(
"
${
CMAKE_SYSTEM_NAME
}
"
STREQUAL
"CYGWIN"
)
...
...
@@ -204,6 +206,27 @@ else()
endmacro
()
endif
()
if
(
ENABLE_SPIRV_TOOLS_INSTALL
)
if
(
WIN32
)
macro
(
spvtools_config_package_dir TARGET PATH
)
set
(
${
PATH
}
${
TARGET
}
/cmake
)
endmacro
()
else
()
macro
(
spvtools_config_package_dir TARGET PATH
)
set
(
${
PATH
}
lib/cmake/
${
TARGET
}
)
endmacro
()
endif
()
macro
(
spvtools_generate_config_file TARGET
)
file
(
WRITE
${
CMAKE_BINARY_DIR
}
/
${
TARGET
}
Config.cmake
"include(CMakeFindDependencyMacro)
\n
"
"find_dependency(
${
SPIRV_TOOLS
}
)
\n
"
"include(
\$
{CMAKE_CURRENT_LIST_DIR}/
${
TARGET
}
Targets.cmake)
\n
"
"set(
${
TARGET
}
_LIBRARIES
${
TARGET
}
)
\n
"
"get_target_property(
${
TARGET
}
_INCLUDE_DIRS
${
TARGET
}
INTERFACE_INCLUDE_DIRECTORIES)
\n
"
)
endmacro
()
endif
()
# Defaults to OFF if the user didn't set it.
option
(
SPIRV_SKIP_EXECUTABLES
"Skip building the executable and tests along with the library"
...
...
CONTRIBUTING.md
View file @
10ead80d
...
...
@@ -4,7 +4,7 @@
We organize known future work in GitHub projects. See
[
Tracking SPIRV-Tools work
with GitHub
projects
](
https://github.com/KhronosGroup/SPIRV-Tools/blob/master/projects.md
)
projects
](
https://github.com/KhronosGroup/SPIRV-Tools/blob/master/
docs/
projects.md
)
for more.
To report a new bug or request a new feature, please file a GitHub issue. Please
...
...
DEPS
View file @
10ead80d
...
...
@@ -3,10 +3,10 @@ use_relative_paths = True
vars = {
'github': 'https://github.com',
'effcee_revision': '
b83b58d177b797edd1f94c5f10837f2cc2863f0a
',
'googletest_revision': '2f
42
d7
6
9a
d1b08742f7ccb5ad4dd357fc5ff248c
',
're2_revision': '
e356bd3f80e0c15c1050323bb5a2d0f8ea4845f4
',
'spirv_headers_revision': '
123dc278f204f8e833e1a88d31c46d0edf81d4b2
',
'effcee_revision': '
cd25ec17e9382f99a895b9ef53ff3c277464d07d
',
'googletest_revision': '
f
2f
b48c3b3
d79a
75a88a99fba6576b25d42ec528
',
're2_revision': '
5bd613749fd530b576b890283bfb6bc6ea6246cb
',
'spirv_headers_revision': '
842ec90674627ed2ffef609e3cd79d1562eded01
',
}
deps = {
...
...
README.md
View file @
10ead80d
...
...
@@ -26,7 +26,7 @@ headers, and XML registry.
<img
alt=
"MacOS"
src=
"kokoro/img/macos.png"
width=
"20px"
height=
"20px"
hspace=
"2px"
/>
[

](https://storage.googleapis.com/spirv-tools/badges/build_link_macos_clang_release.html)
<img
alt=
"Windows"
src=
"kokoro/img/windows.png"
width=
"20px"
height=
"20px"
hspace=
"2px"
/>
[

](https://storage.googleapis.com/spirv-tools/badges/build_link_windows_vs2017_release.html)
[
More downloads
](
downloads.md
)
[
More downloads
](
docs/
downloads.md
)
## Versioning SPIRV-Tools
...
...
@@ -59,7 +59,7 @@ version. An API call reports the software version as a C-style string.
IDs or types is performed, except to check literal arguments to
`OpConstant`
,
`OpSpecConstant`
, and
`OpSwitch`
.
See
[
`syntax.md`
](
syntax.md
)
for the assembly language syntax.
See
[
`
docs/
syntax.md`
](
docs/
syntax.md
)
for the assembly language syntax.
### Validator
...
...
@@ -171,7 +171,7 @@ specific work is tracked via issues and sometimes in one of the
(To provide feedback on the SPIR-V _specification_, file an issue on the
[
SPIRV-Headers
][
spirv-headers
]
GitHub repository.)
See
[
`projects.md`
](
projects.md
)
to see how we use the
See
[
`
docs/
projects.md`
](
docs/
projects.md
)
to see how we use the
[
GitHub Project
feature
](
https://help.github.com/articles/tracking-the-progress-of-your-work-with-projects/
)
to organize planned and in-progress work.
...
...
@@ -255,9 +255,9 @@ Those binaries are automatically uploaded by the buildbots after successful
testing and they always reflect the current top of the tree of the master
branch.
The project uses
[
CMake
][
cmake
]
to generate platform-specific build
configurati
on
s
. Assume that
`<spirv-dir>`
is the root directory of the
checked
out code:
In order to build the code, you first need to sync the external repositories
that it depends
on. Assume that
`<spirv-dir>`
is the root directory of the
checked
out code:
```
sh
cd
<spirv-dir>
...
...
@@ -266,26 +266,44 @@ 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
cmake
[
-G
<platform-generator>] <spirv-dir>
```
*Note*
:
The script
`utils/git-sync-deps`
can be used to checkout and/or update the
contents of the repos under
`external/`
instead of manually maintaining them.
### Build using CMake
You can build The project using
[
CMake
][
cmake
]
to generate platform-specific
build configurations.
```
sh
cd
<spirv-dir>
mkdir
build
&&
cd
build
cmake
[
-G
<platform-generator>] <spirv-dir>
```
Once the build files have been generated, build using your preferred
development environment.
### Build using Bazel
You can also use
[
Bazel
](
https://bazel.build/
)
to build the project.
```
sh
cd
<spirv-dir>
bazel build :all
```
### Tools you'll need
For building and testing SPIRV-Tools, the following tools should be
installed regardless of your OS:
-
[
CMake
](
http://www.cmake.org/
)
: for generating compilation
targets. Version
2.
8.12 or later.
-
[
CMake
](
http://www.cmake.org/
)
:
if using CMake
for generating compilation
targets, you need to install CMake Version
2.8.12 or later.
-
[
Python 3
](
http://www.python.org/
)
: for utility scripts and running the test
suite.
-
[
Bazel
](
https://baze.build/
)
(
optional
)
: if building the source with Bazel,
you need to install Bazel Version 0.29.1 on your machine. Other versions may
also work, but are not verified.
SPIRV-Tools is regularly tested with the the following compilers:
...
...
WORKSPACE
0 → 100644
View file @
10ead80d
local_repository
(
name
=
"
spirv_headers
"
,
path
=
"
external/spirv-headers
"
,
)
local_repository
(
name
=
"
com_google_googletest
"
,
path
=
"
external/googletest
"
,
)
local_repository
(
name
=
"
com_googlesource_code_re2
"
,
path
=
"
external/re2
"
,
)
local_repository
(
name
=
"
com_google_effcee
"
,
path
=
"
external/effcee
"
,
)
build_defs.bzl
0 → 100644
View file @
10ead80d
COMMON_COPTS
=
[
"
-DSPIRV_CHECK_CONTEXT
"
,
"
-DSPIRV_COLOR_TERMINAL
"
,
]
+
select
({
"
@bazel_tools//src/conditions:windows
"
:
[
""
],
"
//conditions:default
"
:
[
"
-DSPIRV_LINUX
"
,
"
-DSPIRV_TIMER_ENABLED
"
,
"
-Wall
"
,
"
-Wextra
"
,
"
-Wnon-virtual-dtor
"
,
"
-Wno-missing-field-initializers
"
,
"
-Werror
"
,
"
-std=c++11
"
,
"
-fvisibility=hidden
"
,
"
-fno-exceptions
"
,
"
-fno-rtti
"
,
"
-Wno-long-long
"
,
"
-Wshadow
"
,
"
-Wundef
"
,
"
-Wconversion
"
,
"
-Wno-sign-conversion
"
,
],
})
TEST_COPTS
=
COMMON_COPTS
+
select
({
"
@bazel_tools//src/conditions:windows
"
:
[
# Disable C4503 "decorated name length exceeded" warning,
# triggered by some heavily templated types.
# We don't care much about that in test code.
# Important to do since we have warnings-as-errors.
"
/wd4503
"
],
"
//conditions:default
"
:
[
"
-Wno-undef
"
,
"
-Wno-self-assign
"
,
"
-Wno-shadow
"
,
"
-Wno-unused-parameter
"
],
})
DEBUGINFO_GRAMMAR_JSON_FILE
=
"
source/extinst.debuginfo.grammar.json
"
def
generate_core_tables
(
version
=
None
):
if
not
version
:
fail
(
"
Must specify version
"
,
"
version
"
)
grammars
=
[
"
@spirv_headers//:spirv_core_grammar_
"
+
version
,
DEBUGINFO_GRAMMAR_JSON_FILE
,
]
outs
=
[
"
core.insts-{}.inc
"
.
format
(
version
),
"
operand.kinds-{}.inc
"
.
format
(
version
),
]
fmtargs
=
grammars
+
outs
native
.
genrule
(
name
=
"
gen_core_tables_
"
+
version
,
srcs
=
grammars
,
outs
=
outs
,
cmd
=
(
"
$(location :generate_grammar_tables)
"
+
"
--spirv-core-grammar=$(location {0})
"
+
"
--extinst-debuginfo-grammar=$(location {1})
"
+
"
--core-insts-output=$(location {2})
"
+
"
--operand-kinds-output=$(location {3})
"
).
format
(
*
fmtargs
),
tools
=
[
"
:generate_grammar_tables
"
],
visibility
=
[
"
//visibility:private
"
],
)
def
generate_enum_string_mapping
(
version
=
None
):
if
not
version
:
fail
(
"
Must specify version
"
,
"
version
"
)
grammars
=
[
"
@spirv_headers//:spirv_core_grammar_
"
+
version
,
DEBUGINFO_GRAMMAR_JSON_FILE
,
]
outs
=
[
"
extension_enum.inc
"
,
"
enum_string_mapping.inc
"
,
]
fmtargs
=
grammars
+
outs
native
.
genrule
(
name
=
"
gen_enum_string_mapping
"
,
srcs
=
grammars
,
outs
=
outs
,
cmd
=
(
"
$(location :generate_grammar_tables)
"
+
"
--spirv-core-grammar=$(location {0})
"
+
"
--extinst-debuginfo-grammar=$(location {1})
"
+
"
--extension-enum-output=$(location {2})
"
+
"
--enum-string-mapping-output=$(location {3})
"
).
format
(
*
fmtargs
),
tools
=
[
"
:generate_grammar_tables
"
],
visibility
=
[
"
//visibility:private
"
],
)
def
generate_opencl_tables
(
version
=
None
):
if
not
version
:
fail
(
"
Must specify version
"
,
"
version
"
)
grammars
=
[
"
@spirv_headers//:spirv_opencl_grammar_
"
+
version
,
]
outs
=
[
"
opencl.std.insts.inc
"
]
fmtargs
=
grammars
+
outs
native
.
genrule
(
name
=
"
gen_opencl_tables_
"
+
version
,
srcs
=
grammars
,
outs
=
outs
,
cmd
=
(
"
$(location :generate_grammar_tables)
"
+
"
--extinst-opencl-grammar=$(location {0})
"
+
"
--opencl-insts-output=$(location {1})
"
).
format
(
*
fmtargs
),
tools
=
[
"
:generate_grammar_tables
"
],
visibility
=
[
"
//visibility:private
"
],
)
def
generate_glsl_tables
(
version
=
None
):
if
not
version
:
fail
(
"
Must specify version
"
,
"
version
"
)
grammars
=
[
"
@spirv_headers//:spirv_glsl_grammar_
"
+
version
,
]
outs
=
[
"
glsl.std.450.insts.inc
"
]
fmtargs
=
grammars
+
outs
native
.
genrule
(
name
=
"
gen_glsl_tables_
"
+
version
,
srcs
=
grammars
,
outs
=
outs
,
cmd
=
(
"
$(location :generate_grammar_tables)
"
+
"
--extinst-glsl-grammar=$(location {0})
"
+
"
--glsl-insts-output=$(location {1})
"
).
format
(
*
fmtargs
),
tools
=
[
"
:generate_grammar_tables
"
],
visibility
=
[
"
//visibility:private
"
],
)
def
generate_vendor_tables
(
extension
=
None
):
if
not
extension
:
fail
(
"
Must specify extension
"
,
"
extension
"
)
extension_rule
=
extension
.
replace
(
"
-
"
,
"
_
"
)
grammars
=
[
"
source/extinst.{}.grammar.json
"
.
format
(
extension
)]
outs
=
[
"
{}.insts.inc
"
.
format
(
extension
)]
fmtargs
=
grammars
+
outs
native
.
genrule
(
name
=
"
gen_vendor_tables_
"
+
extension_rule
,
srcs
=
grammars
,
outs
=
outs
,
cmd
=
(
"
$(location :generate_grammar_tables)
"
+
"
--extinst-vendor-grammar=$(location {0})
"
+
"
--vendor-insts-output=$(location {1})
"
).
format
(
*
fmtargs
),
tools
=
[
"
:generate_grammar_tables
"
],
visibility
=
[
"
//visibility:private
"
],
)
def
generate_extinst_lang_headers
(
name
,
grammar
=
None
):
if
not
grammar
:
fail
(
"
Must specify grammar
"
,
"
grammar
"
)
fmtargs
=
[
name
]
native
.
genrule
(
name
=
"
gen_extinst_lang_headers_
"
+
name
,
srcs
=
[
grammar
],
outs
=
[
name
+
"
.h
"
],
cmd
=
(
"
$(location :generate_language_headers)
"
+
"
--extinst-name={0}
"
+
"
--extinst-grammar=$<
"
+
"
--extinst-output-base=$(@D)/{0}
"
).
format
(
*
fmtargs
),
tools
=
[
"
:generate_language_headers
"
],
visibility
=
[
"
//visibility:private
"
],
)
def
base_test
(
name
,
srcs
,
deps
=
[]):
if
srcs
==
[]:
return
if
name
[
-
5
:]
!=
"
_test
"
:
name
=
name
+
"
_test
"
native
.
cc_test
(
name
=
"
base_
"
+
name
,
srcs
=
srcs
,
compatible_with
=
[],
copts
=
TEST_COPTS
,
size
=
"
large
"
,
deps
=
[
"
:test_common
"
,
"
@com_google_googletest//:gtest_main
"
,
"
@com_google_googletest//:gtest
"
,
"
@com_google_effcee//:effcee
"
,
]
+
deps
,
)
def
link_test
(
name
,
srcs
,
deps
=
[]):
if
name
[
-
5
:]
!=
"
_test
"
:
name
=
name
+
"
_test
"
native
.
cc_test
(
name
=
"
link_
"
+
name
,
srcs
=
srcs
,
compatible_with
=
[],
copts
=
TEST_COPTS
,
size
=
"
large
"
,
deps
=
[
"
:link_test_common
"
,
"
@com_google_googletest//:gtest_main
"
,
"
@com_google_googletest//:gtest
"
,
"
@com_google_effcee//:effcee
"
,
]
+
deps
,
)
def
opt_test
(
name
,
srcs
,
deps
=
[]):
if
name
[
-
5
:]
!=
"
_test
"
:
name
=
name
+
"
_test
"
native
.
cc_test
(
name
=
"
opt_
"
+
name
,
srcs
=
srcs
,
compatible_with
=
[],
copts
=
TEST_COPTS
,
size
=
"
large
"
,
deps
=
[
"
:opt_test_common
"
,
"
@com_google_googletest//:gtest_main
"
,
"
@com_google_googletest//:gtest
"
,
"
@com_google_effcee//:effcee
"
,
]
+
deps
,
)
def
reduce_test
(
name
,
srcs
,
deps
=
[]):
if
name
[
-
5
:]
!=
"
_test
"
:
name
=
name
+
"
_test
"
native
.
cc_test
(
name
=
"
reduce_
"
+
name
,
srcs
=
srcs
,
compatible_with
=
[],
copts
=
TEST_COPTS
,
size
=
"
large
"
,
deps
=
[
"
:reduce_test_common
"
,
"
:spirv_tools_reduce
"
,
"
@com_google_googletest//:gtest_main
"
,
"
@com_google_googletest//:gtest
"
,
"
@com_google_effcee//:effcee
"
,
]
+
deps
,
)
def
util_test
(
name
,
srcs
,
deps
=
[]):
if
name
[
-
5
:]
!=
"
_test
"
:
name
=
name
+
"
_test
"
native
.
cc_test
(
name
=
"
util_
"
+
name
,
srcs
=
srcs
,
compatible_with
=
[],
copts
=
TEST_COPTS
,
size
=
"
large
"
,
deps
=
[
"
:opt_test_common
"
,
"
@com_google_googletest//:gtest_main
"
,
"
@com_google_googletest//:gtest
"
,
"
@com_google_effcee//:effcee
"
,
]
+
deps
,
)
def
val_test
(
name
,
srcs
=
[],
copts
=
[],
deps
=
[],
**
kwargs
):
if
name
[
-
5
:]
!=
"
_test
"
:
name
=
name
+
"
_test
"
if
name
[:
4
]
!=
"
val_
"
:
name
=
"
val_
"
+
name
native
.
cc_test
(
name
=
name
,
srcs
=
srcs
,
compatible_with
=
[],
copts
=
TEST_COPTS
+
copts
,
size
=
"
large
"
,
deps
=
[
"
:val_test_common
"
,
"
@com_google_googletest//:gtest_main
"
,
"
@com_google_googletest//:gtest
"
,
"
@com_google_effcee//:effcee
"
,
]
+
deps
,
**
kwargs
)
debian/changelog
View file @
10ead80d
spirv-tools (2019.4+git20191022-1) unstable; urgency=medium
* Sync with upstream/stable 02910ffdffaa.
* control: Bump spirv-headers build dependency.
-- Timo Aaltonen <tjaalton@debian.org> Tue, 19 Nov 2019 23:58:49 +0200
spirv-tools (2019.4-1) unstable; urgency=medium
* New upstream release.
...
...
debian/control
View file @
10ead80d
...
...
@@ -5,7 +5,7 @@ Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
Build-Depends: debhelper (>=10),
cmake,
python3-dev,
spirv-headers (>= 1.
4
.1
+git20190816
),
spirv-headers (>= 1.
5
.1
-2
),
Standards-Version: 4.1.3
Homepage: https://github.com/KhronosGroup/SPIRV-Tools
Vcs-Git: https://salsa.debian.org/git/xorg-team/vulkan/spirv-tools.git
...
...
downloads.md
→
docs/
downloads.md
View file @
10ead80d
File moved
projects.md
→
docs/
projects.md
View file @
10ead80d
File moved
syntax.md
→
docs/
syntax.md
View file @
10ead80d
File moved
include/spirv-tools/instrument.hpp
View file @
10ead80d
...
...
@@ -23,8 +23,9 @@
// communicate with shaders instrumented by passes created by:
//
// CreateInstBindlessCheckPass
// CreateInstBuffAddrCheckPass
//
// More detailed documentation of th
is
routine can be found in optimizer.hpp
// More detailed documentation of th
ese
routine
s
can be found in optimizer.hpp
namespace
spvtools
{
...
...
@@ -157,6 +158,12 @@ static const int kInst2BindlessUninitOutDescIndex = kInst2StageOutCnt + 1;
static
const
int
kInst2BindlessUninitOutUnused
=
kInst2StageOutCnt
+
2
;
static
const
int
kInst2BindlessUninitOutCnt
=
kInst2StageOutCnt
+
3
;
// A buffer address unalloc error will output the 64-bit pointer in
// two 32-bit pieces, lower bits first.
static
const
int
kInst2BuffAddrUnallocOutDescPtrLo
=
kInst2StageOutCnt
+
1
;
static
const
int
kInst2BuffAddrUnallocOutDescPtrHi
=
kInst2StageOutCnt
+
2
;
static
const
int
kInst2BuffAddrUnallocOutCnt
=
kInst2StageOutCnt
+
3
;
// DEPRECATED
static
const
int
kInstBindlessOutDescIndex
=
kInstStageOutCnt
+
1
;
static
const
int
kInstBindlessOutDescBound
=
kInstStageOutCnt
+
2
;
...
...
@@ -171,6 +178,7 @@ static const int kInst2MaxOutCnt = kInst2StageOutCnt + 3;
// These are the possible validation error codes.
static
const
int
kInstErrorBindlessBounds
=
0
;
static
const
int
kInstErrorBindlessUninit
=
1
;
static
const
int
kInstErrorBuffAddrUnallocRef
=
2
;
// Direct Input Buffer Offsets
//
...
...
@@ -187,14 +195,16 @@ static const int kDebugInputDataOffset = 0;
// These are the bindings for the different buffers which are
// read or written by the instrumentation passes.
//
// This is the output buffer written by InstBindlessCheckPass
// and possibly other future validations.
// This is the output buffer written by InstBindlessCheckPass
,
//
InstBuffAddrCheckPass,
and possibly other future validations.
static
const
int
kDebugOutputBindingStream
=
0
;
// The binding for the input buffer read by InstBindlessCheckPass and
// possibly other future validations.
// The binding for the input buffer read by InstBindlessCheckPass.
static
const
int
kDebugInputBindingBindless
=
1
;
// The binding for the input buffer read by InstBuffAddrCheckPass.
static
const
int
kDebugInputBindingBuffAddr
=
2
;
// Bindless Validation Input Buffer Format
//
// An input buffer for bindless validation consists of a single array of
...
...
@@ -216,6 +226,31 @@ static const int kDebugInputBindlessOffsetReserved = 0;
// Data[ Data[ s + kDebugInputBindlessOffsetLengths ] + b ]
static
const
int
kDebugInputBindlessOffsetLengths
=
1
;
// Buffer Device Address Input Buffer Format
//
// An input buffer for buffer device address validation consists of a single
// array of unsigned 64-bit integers we will call Data[]. This array is
// formatted as follows:
//
// At offset kDebugInputBuffAddrPtrOffset is a list of sorted valid buffer
// addresses. The list is terminated with the address 0xffffffffffffffff.
// If 0x0 is not a valid buffer address, this address is inserted at the
// start of the list.
//
static
const
int
kDebugInputBuffAddrPtrOffset
=
1
;
//
// At offset kDebugInputBuffAddrLengthOffset in Data[] is a single uint64 which
// gives an offset to the start of the buffer length data. More
// specifically, for a buffer whose pointer is located at input buffer offset
// i, the length is located at:
//
// Data[ i - kDebugInputBuffAddrPtrOffset
// + Data[ kDebugInputBuffAddrLengthOffset ] ]
//
// The length associated with the 0xffffffffffffffff address is zero. If
// not a valid buffer, the length associated with the 0x0 address is zero.
static
const
int
kDebugInputBuffAddrLengthOffset
=
0
;
}
// namespace spvtools
#endif // INCLUDE_SPIRV_TOOLS_INSTRUMENT_HPP_
include/spirv-tools/libspirv.h
View file @
10ead80d
...
...
@@ -433,6 +433,7 @@ typedef enum {
SPV_ENV_WEBGPU_0
,
// Work in progress WebGPU 1.0.
SPV_ENV_UNIVERSAL_1_4
,
// SPIR-V 1.4 latest revision, no other restrictions.
SPV_ENV_VULKAN_1_1_SPIRV_1_4
,
// Vulkan 1.1 with SPIR-V 1.4 binary.
SPV_ENV_UNIVERSAL_1_5
,
// SPIR-V 1.5 latest revision, no other restrictions.
}
spv_target_env
;
// SPIR-V Validator can be parameterized with the following Universal Limits.
...
...
@@ -611,6 +612,11 @@ SPIRV_TOOLS_EXPORT spv_fuzzer_options spvFuzzerOptionsCreate();
// Destroys the given fuzzer options object.
SPIRV_TOOLS_EXPORT
void
spvFuzzerOptionsDestroy
(
spv_fuzzer_options
options
);
// Enables running the validator after every transformation is applied during
// a replay.
SPIRV_TOOLS_EXPORT
void
spvFuzzerOptionsEnableReplayValidation
(
spv_fuzzer_options
options
);
// Sets the seed with which the random number generator used by the fuzzer
// should be initialized.
SPIRV_TOOLS_EXPORT
void
spvFuzzerOptionsSetRandomSeed
(
...
...
include/spirv-tools/libspirv.hpp
View file @
10ead80d
...
...
@@ -214,6 +214,11 @@ class FuzzerOptions {
return
options_
;
}
// See spvFuzzerOptionsEnableReplayValidation.
void
enable_replay_validation
()
{
spvFuzzerOptionsEnableReplayValidation
(
options_
);
}
// See spvFuzzerOptionsSetRandomSeed.
void
set_random_seed
(
uint32_t
seed
)
{
spvFuzzerOptionsSetRandomSeed
(
options_
,
seed
);
...
...
include/spirv-tools/optimizer.hpp
View file @
10ead80d
...
...
@@ -68,6 +68,11 @@ class Optimizer {
// The constructed instance will have an empty message consumer, which just
// ignores all messages from the library. Use SetMessageConsumer() to supply
// one if messages are of concern.
//
// For collections of passes that are meant to transform the input into
// another execution environment, then the source environment should be
// supplied. e.g. for VulkanToWebGPUPasses the environment should be
// SPV_ENV_VULKAN_1_1 not SPV_ENV_WEBGPU_0.
explicit
Optimizer
(
spv_target_env
env
);
// Disables copy/move constructor/assignment operations.
...
...
@@ -674,6 +679,22 @@ Optimizer::PassToken CreateLoopUnrollPass(bool fully_unroll, int factor = 0);
// processed (see IsSSATargetVar for details).
Optimizer
::
PassToken
CreateSSARewritePass
();
// Create pass to convert relaxed precision instructions to half precision.
// This pass converts as many relaxed float32 arithmetic operations to half as
// possible. It converts any float32 operands to half if needed. It converts
// any resulting half precision values back to float32 as needed. No variables
// are changed. No image operations are changed.
//
// Best if run late since it will generate better code with unneeded function
// scope loads and stores and composite inserts and extracts removed. Also best
// if followed by instruction simplification, redundancy elimination and DCE.
Optimizer
::
PassToken
CreateConvertRelaxedToHalfPass
();
// Create relax float ops pass.
// This pass decorates all float32 result instructions with RelaxedPrecision
// if not already so decorated.
Optimizer
::
PassToken
CreateRelaxFloatOpsPass
();
// Create copy propagate arrays pass.
// This pass looks to copy propagate memory references for arrays. It looks
// for specific code patterns to recognize array copies.
...
...
@@ -729,6 +750,30 @@ Optimizer::PassToken CreateInstBindlessCheckPass(
uint32_t
desc_set
,
uint32_t
shader_id
,
bool
input_length_enable
=
false
,
bool
input_init_enable
=
false
,
uint32_t
version
=
1
);
// Create a pass to instrument physical buffer address checking
// This pass instruments all physical buffer address references to check that
// all referenced bytes fall in a valid buffer. If the reference is
// invalid, a record is written to the debug output buffer (if space allows)
// and a null value is returned. This pass is designed to support buffer
// address validation in the Vulkan validation layers.
//
// Dead code elimination should be run after this pass as the original,
// potentially invalid code is not removed and could cause undefined behavior,
// including crashes. Instruction simplification would likely also be
// beneficial. It is also generally recommended that this pass (and all
// instrumentation passes) be run after any legalization and optimization
// passes. This will give better analysis for the instrumentation and avoid
// potentially de-optimizing the instrument code, for example, inlining
// the debug record output function throughout the module.
//
// The instrumentation will read and write buffers in debug
// descriptor set |desc_set|. It will write |shader_id| in each output record
// to identify the shader module which generated the record.
// |version| specifies the output buffer record format.
Optimizer
::
PassToken
CreateInstBuffAddrCheckPass
(
uint32_t
desc_set
,
uint32_t
shader_id
,
uint32_t
version
=
2
);
// Create a pass to upgrade to the VulkanKHR memory model.
// This pass upgrades the Logical GLSL450 memory model to Logical VulkanKHR.
// Additionally, it modifies memory, image, atomic and barrier operations to
...
...
@@ -795,6 +840,15 @@ Optimizer::PassToken CreateGraphicsRobustAccessPass();
// for the first index.
Optimizer
::
PassToken
CreateDescriptorScalarReplacementPass
();
// Create a pass to replace all OpKill instruction with a function call to a
// function that has a single OpKill. This allows more code to be inlined.
Optimizer
::
PassToken
CreateWrapOpKillPass
();
// Replaces the extensions VK_AMD_shader_ballot,VK_AMD_gcn_shader, and
// VK_AMD_shader_trinary_minmax with equivalent code using core instructions and
// capabilities.
Optimizer
::
PassToken
CreateAmdExtToKhrPass
();
}
// namespace spvtools
#endif // INCLUDE_SPIRV_TOOLS_OPTIMIZER_HPP_
Prev
1
2
3
4
5
…
18
Next