diff options
author | David Neto <dneto@google.com> | 2018-02-09 14:29:02 -0500 |
---|---|---|
committer | David Neto <dneto@google.com> | 2018-03-06 15:17:31 -0500 |
commit | 00fa39318f8bef3c3a587c1fa4da086064166d16 (patch) | |
tree | b2185d7694ce2ba805a311ea62e64f9a716fe1f3 /Android.mk | |
parent | 5f50e6209c815e93733f4d58906b86a50ff2af32 (diff) |
Support SPIR-V 1.3 and Vulkan 1.1
The default target is SPIR-V 1.3.
For example, spirv-as will generate a SPIR-V 1.3 binary by default.
Use command line option "--target-env spv1.0" if you want to make a SPIR-V
1.0 binary or validate against SPIR-V 1.0 rules.
Example:
# Generate a SPIR-V 1.0 binary instead of SPIR-V 1.3
spirv-as --target-env spv1.0 a.spvasm -o a.spv
spirv-as --target-env vulkan1.0 a.spvasm -o a.spv
# Validate as SPIR-V 1.0.
spirv-val --target-env spv1.0 a.spv
# Validate as Vulkan 1.0
spirv-val --target-env vulkan1.0 a.spv
Diffstat (limited to 'Android.mk')
-rw-r--r-- | Android.mk | 27 |
1 files changed, 24 insertions, 3 deletions
@@ -126,6 +126,10 @@ SPVTOOLS_OPT_SRC_FILES := \ source/opt/workaround1209.cpp # Locations of grammar files. +# +# TODO(dneto): Build a single set of tables that embeds versioning differences on +# a per-item basis. That must happen before SPIR-V 1.4, etc. +# https://github.com/KhronosGroup/SPIRV-Tools/issues/1195 SPV_CORE10_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/1.0/spirv.core.grammar.json SPV_CORE11_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/1.1/spirv.core.grammar.json SPV_CORE12_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/1.2/spirv.core.grammar.json @@ -174,9 +178,26 @@ $(1)/core.insts-1.2.inc $(1)/operand.kinds-1.2.inc: \ --core-insts-output=$(1)/core.insts-1.2.inc \ --operand-kinds-output=$(1)/operand.kinds-1.2.inc @echo "[$(TARGET_ARCH_ABI)] Grammar v1.2 : instructions & operands <= grammar JSON files" -$(LOCAL_PATH)/source/opcode.cpp: $(1)/core.insts-1.0.inc $(1)/core.insts-1.1.inc $(1)/core.insts-1.2.inc -$(LOCAL_PATH)/source/operand.cpp: $(1)/operand.kinds-1.0.inc $(1)/operand.kinds-1.1.inc $(1)/operand.kinds-1.2.inc -$(LOCAL_PATH)/source/ext_inst.cpp: $(1)/glsl.std.450.insts.inc $(1)/opencl.std.insts.inc +$(1)/core.insts-unified1.inc $(1)/operand.kinds-unified1.inc: \ + $(LOCAL_PATH)/utils/generate_grammar_tables.py \ + $(SPV_COREUNIFIED1_GRAMMAR) \ + $(SPV_DEBUGINFO_GRAMMAR) + @$(HOST_PYTHON) $(LOCAL_PATH)/utils/generate_grammar_tables.py \ + --spirv-core-grammar=$(SPV_COREUNIFIED1_GRAMMAR) \ + --extinst-debuginfo-grammar=$(SPV_DEBUGINFO_GRAMMAR) \ + --core-insts-output=$(1)/core.insts-unified1.inc \ + --operand-kinds-output=$(1)/operand.kinds-unified1.inc + @echo "[$(TARGET_ARCH_ABI)] Grammar v1.3 (from unified1) : instructions & operands <= grammar JSON files" +$(LOCAL_PATH)/source/opcode.cpp: $(1)/core.insts-1.0.inc $(1)/core.insts-1.1.inc $(1)/core.insts-1.2.inc $(1)/core.insts-unified1.inc +$(LOCAL_PATH)/source/operand.cpp: $(1)/operand.kinds-1.0.inc $(1)/operand.kinds-1.1.inc $(1)/operand.kinds-1.2.inc $(1)/operand.kinds-unified1.inc +$(LOCAL_PATH)/source/ext_inst.cpp: \ + $(1)/glsl.std.450.insts.inc \ + $(1)/opencl.std.insts.inc \ + $(1)/debuginfo.insts.inc \ + $(1)/spv-amd-gcn-shader.insts.inc \ + $(1)/spv-amd-shader-ballot.insts.inc \ + $(1)/spv-amd-shader-explicit-vertex-parameter.insts.inc \ + $(1)/spv-amd-shader-trinary-minmax.insts.inc endef $(eval $(call gen_spvtools_grammar_tables,$(SPVTOOLS_OUT_PATH))) |