Commit 4cc54b40 by Nicolas Capens Committed by Nicolas Capens

Fix Android build after SPIRV-Tools update

Bug: angleproject:4425 Change-Id: I2785b9f5c6f96b2b12eeacf64ff5316355f1ae54 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/41609Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com>
parent c1e60dcf
filegroup { //
name: "swiftshader_spirv.core.grammar.json-1.0", // Copyright (C) 2020 The Android Open Source Project
srcs: ["include/spirv/1.0/spirv.core.grammar.json"], //
} // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
filegroup { // You may obtain a copy of the License at
name: "swiftshader_spirv.core.grammar.json-1.1", //
srcs: ["include/spirv/1.1/spirv.core.grammar.json"], // http://www.apache.org/licenses/LICENSE-2.0
} //
// Unless required by applicable law or agreed to in writing, software
filegroup { // distributed under the License is distributed on an "AS IS" BASIS,
name: "swiftshader_spirv.core.grammar.json-1.2", // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
srcs: ["include/spirv/1.2/spirv.core.grammar.json"], // See the License for the specific language governing permissions and
} // limitations under the License.
//
filegroup { filegroup {
name: "swiftshader_spirv.core.grammar.json-unified1", name: "swiftshader_spirv_headers_unified1_spirv.core.grammar.json",
srcs: ["include/spirv/unified1/spirv.core.grammar.json"], srcs: ["include/spirv/unified1/spirv.core.grammar.json"],
} }
filegroup { filegroup {
name: "swiftshader_spirv.glsl.grammar.json", name: "swiftshader_spirv_headers_unified1_extinst.opencl.std.100.grammar.json",
srcs: ["include/spirv/1.2/extinst.glsl.std.450.grammar.json"], srcs: ["include/spirv/unified1/extinst.opencl.std.100.grammar.json"],
} }
filegroup { filegroup {
name: "swiftshader_spirv.opencl.grammar.json", name: "swiftshader_spirv_headers_unified1_extinst.glsl.std.450.grammar.json",
srcs: ["include/spirv/1.2/extinst.opencl.std.100.grammar.json"], srcs: ["include/spirv/unified1/extinst.glsl.std.450.grammar.json"],
} }
filegroup { filegroup {
name: "swiftshader_spirv.registry.xml", name: "swiftshader_spirv_headers_spir-v.xml",
srcs: ["include/spirv/spir-v.xml"], srcs: ["include/spirv/spir-v.xml"],
} }
...@@ -16,170 +16,84 @@ ...@@ -16,170 +16,84 @@
// SPIRV Tools // SPIRV Tools
filegroup { // genrules were obtained from the CMake build:
name: "swiftshader_spirv.debuginfo.grammar.json", // $ cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Debug
srcs: ["source/extinst.debuginfo.grammar.json"], // $ ninja -v -j 1 >log.log
} // Find Python invocations.
// Use regex replacements to get "cmd:" lines below.
filegroup {
name: "swiftshader_spirv.extinst.opencl.debuginfo.100.grammar.json",
srcs: ["source/extinst.opencl.debuginfo.100.grammar.json"],
}
genrule { genrule {
name: "swiftshader_gen_spvtools_grammar_tables_unified1", name: "swiftshader_spvtools_generate_grammar_tables",
out: [ out: [
"core.insts-unified1.inc", "core.insts-unified1.inc",
"debuginfo.insts.inc",
"enum_string_mapping.inc",
"extension_enum.inc",
"glsl.std.450.insts.inc", "glsl.std.450.insts.inc",
"opencl.debuginfo.100.insts.inc",
"opencl.std.insts.inc", "opencl.std.insts.inc",
"operand.kinds-unified1.inc", "operand.kinds-unified1.inc",
],
srcs: [
":swiftshader_spirv.core.grammar.json-unified1",
":swiftshader_spirv.glsl.grammar.json",
":swiftshader_spirv.opencl.grammar.json",
":swiftshader_spirv.debuginfo.grammar.json",
":swiftshader_spirv.extinst.opencl.debuginfo.100.grammar.json",
],
tool_files: ["utils/generate_grammar_tables.py"],
cmd: "$(location) "+
"--spirv-core-grammar=$(location :swiftshader_spirv.core.grammar.json-unified1) "+
"--extinst-glsl-grammar=$(location :swiftshader_spirv.glsl.grammar.json) "+
"--extinst-opencl-grammar=$(location :swiftshader_spirv.opencl.grammar.json) "+
"--extinst-debuginfo-grammar=$(location :swiftshader_spirv.debuginfo.grammar.json) "+
"--extinst-cldebuginfo100-grammar=$(location :swiftshader_spirv.extinst.opencl.debuginfo.100.grammar.json) "+
"--core-insts-output=$(location core.insts-unified1.inc) "+
"--glsl-insts-output=$(location glsl.std.450.insts.inc) "+
"--opencl-insts-output=$(location opencl.std.insts.inc) "+
"--operand-kinds-output=$(location operand.kinds-unified1.inc)",
}
genrule {
name: "swiftshader_gen_spvtools_grammar_tables_debuginfo",
out: [
"debuginfo.insts.inc",
],
srcs: [
":swiftshader_spirv.debuginfo.grammar.json",
],
tool_files: ["utils/generate_grammar_tables.py"],
cmd: "$(location) --extinst-vendor-grammar=$(in) "+
"--vendor-insts-output=$(out)"
}
genrule {
name: "swiftshader_gen_spvtools_grammar_tables_opencl_debuginfo_100",
out: [
"opencl.debuginfo.100.insts.inc",
],
srcs: [
":swiftshader_spirv.extinst.opencl.debuginfo.100.grammar.json",
],
tool_files: ["utils/generate_grammar_tables.py"],
cmd: "$(location) --extinst-vendor-grammar=$(in) "+
"--vendor-insts-output=$(out) "+
"--vendor-operand-kind-prefix=CLDEBUG100_"
}
genrule {
name: "swiftshader_gen_spvtools_grammar_tables_amd-gcn-shader",
out: [
"spv-amd-gcn-shader.insts.inc", "spv-amd-gcn-shader.insts.inc",
],
srcs: [
"source/extinst.spv-amd-gcn-shader.grammar.json",
],
tool_files: ["utils/generate_grammar_tables.py"],
cmd: "$(location) --extinst-vendor-grammar=$(in) "+
"--vendor-insts-output=$(out)"
}
genrule {
name: "swiftshader_gen_spvtools_grammar_tables_amd-shader-ballot",
out: [
"spv-amd-shader-ballot.insts.inc", "spv-amd-shader-ballot.insts.inc",
],
srcs: [
"source/extinst.spv-amd-shader-ballot.grammar.json",
],
tool_files: ["utils/generate_grammar_tables.py"],
cmd: "$(location) --extinst-vendor-grammar=$(in) "+
"--vendor-insts-output=$(out)"
}
genrule {
name: "swiftshader_gen_spvtools_grammar_tables_amd-shader-explicit-vertex-parameter",
out: [
"spv-amd-shader-explicit-vertex-parameter.insts.inc", "spv-amd-shader-explicit-vertex-parameter.insts.inc",
],
srcs: [
"source/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json",
],
tool_files: ["utils/generate_grammar_tables.py"],
cmd: "$(location) --extinst-vendor-grammar=$(in) "+
"--vendor-insts-output=$(out)"
}
genrule {
name: "swiftshader_gen_spvtools_grammar_tables_amd-shader-trinary-minmax",
out: [
"spv-amd-shader-trinary-minmax.insts.inc", "spv-amd-shader-trinary-minmax.insts.inc",
], ],
srcs: [ srcs: [
":swiftshader_spirv_headers_unified1_extinst.glsl.std.450.grammar.json",
":swiftshader_spirv_headers_unified1_extinst.opencl.std.100.grammar.json",
":swiftshader_spirv_headers_unified1_spirv.core.grammar.json",
"source/extinst.debuginfo.grammar.json",
"source/extinst.opencl.debuginfo.100.grammar.json",
"source/extinst.spv-amd-gcn-shader.grammar.json",
"source/extinst.spv-amd-shader-ballot.grammar.json",
"source/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json",
"source/extinst.spv-amd-shader-trinary-minmax.grammar.json", "source/extinst.spv-amd-shader-trinary-minmax.grammar.json",
], ],
tool_files: ["utils/generate_grammar_tables.py"], tool_files: ["utils/generate_grammar_tables.py"],
cmd: "$(location) --extinst-vendor-grammar=$(in) "+ cmd:
"--vendor-insts-output=$(out)" "$(location) --extinst-vendor-grammar=$(location source/extinst.spv-amd-gcn-shader.grammar.json) --vendor-insts-output=$(location spv-amd-gcn-shader.insts.inc) --vendor-operand-kind-prefix=; "+
"$(location) --spirv-core-grammar=$(location :swiftshader_spirv_headers_unified1_spirv.core.grammar.json) --extinst-debuginfo-grammar=$(location source/extinst.debuginfo.grammar.json) --extinst-cldebuginfo100-grammar=$(location source/extinst.opencl.debuginfo.100.grammar.json) --core-insts-output=$(location core.insts-unified1.inc) --operand-kinds-output=$(location operand.kinds-unified1.inc); "+
"$(location) --extinst-vendor-grammar=$(location source/extinst.debuginfo.grammar.json) --vendor-insts-output=$(location debuginfo.insts.inc) --vendor-operand-kind-prefix=; "+
"$(location) --extinst-vendor-grammar=$(location source/extinst.spv-amd-shader-ballot.grammar.json) --vendor-insts-output=$(location spv-amd-shader-ballot.insts.inc) --vendor-operand-kind-prefix=; "+
"$(location) --extinst-vendor-grammar=$(location source/extinst.spv-amd-shader-explicit-vertex-parameter.grammar.json) --vendor-insts-output=$(location spv-amd-shader-explicit-vertex-parameter.insts.inc) --vendor-operand-kind-prefix=; "+
"$(location) --extinst-vendor-grammar=$(location source/extinst.spv-amd-shader-trinary-minmax.grammar.json) --vendor-insts-output=$(location spv-amd-shader-trinary-minmax.insts.inc) --vendor-operand-kind-prefix=; "+
"$(location) --extinst-vendor-grammar=$(location source/extinst.opencl.debuginfo.100.grammar.json) --vendor-insts-output=$(location opencl.debuginfo.100.insts.inc) --vendor-operand-kind-prefix=CLDEBUG100_; "+
"$(location) --spirv-core-grammar=$(location :swiftshader_spirv_headers_unified1_spirv.core.grammar.json) --extinst-debuginfo-grammar=$(location source/extinst.debuginfo.grammar.json) --extinst-cldebuginfo100-grammar=$(location source/extinst.opencl.debuginfo.100.grammar.json) --extension-enum-output=$(location extension_enum.inc) --enum-string-mapping-output=$(location enum_string_mapping.inc); "+
"$(location) --extinst-opencl-grammar=$(location :swiftshader_spirv_headers_unified1_extinst.opencl.std.100.grammar.json) --opencl-insts-output=$(location opencl.std.insts.inc); "+
"$(location) --extinst-glsl-grammar=$(location :swiftshader_spirv_headers_unified1_extinst.glsl.std.450.grammar.json) --glsl-insts-output=$(location glsl.std.450.insts.inc); "
} }
genrule { genrule {
name: "swiftshader_gen_spvtools_lang_headers", name: "swiftshader_spvtools_generate_language_headers",
out: [ out: [
"DebugInfo.h", "DebugInfo.h",
"OpenCLDebugInfo100.h",
], ],
srcs: [ srcs: [
":swiftshader_spirv.debuginfo.grammar.json", "source/extinst.debuginfo.grammar.json",
"source/extinst.opencl.debuginfo.100.grammar.json",
], ],
tool_files: ["utils/generate_language_headers.py"], tool_files: ["utils/generate_language_headers.py"],
cmd: "$(location) --extinst-name=DebugInfo "+ cmd:
"--extinst-grammar=$(location :swiftshader_spirv.debuginfo.grammar.json) "+ "$(location) --extinst-name=DebugInfo --extinst-grammar=$(location source/extinst.debuginfo.grammar.json) --extinst-output-base=$$(dirname $(location DebugInfo.h))/DebugInfo; "+
"--extinst-output-base=$$(dirname $(location DebugInfo.h))/DebugInfo", "$(location) --extinst-name=OpenCLDebugInfo100 --extinst-grammar=$(location source/extinst.opencl.debuginfo.100.grammar.json) --extinst-output-base=$$(dirname $(location OpenCLDebugInfo100.h))/OpenCLDebugInfo100; "
}
genrule {
name: "swiftshader_gen_spvtools_enum_string_mapping",
out: [
"extension_enum.inc",
"enum_string_mapping.inc",
],
srcs: [
":swiftshader_spirv.core.grammar.json-unified1",
":swiftshader_spirv.debuginfo.grammar.json",
":swiftshader_spirv.extinst.opencl.debuginfo.100.grammar.json",
],
tool_files: ["utils/generate_grammar_tables.py"],
cmd: "$(location) --spirv-core-grammar=$(location :swiftshader_spirv.core.grammar.json-unified1) "+
"--extinst-debuginfo-grammar=$(location :swiftshader_spirv.debuginfo.grammar.json) "+
"--extinst-cldebuginfo100-grammar=$(location :swiftshader_spirv.extinst.opencl.debuginfo.100.grammar.json) "+
"--extension-enum-output=$(location extension_enum.inc) "+
"--enum-string-mapping-output=$(location enum_string_mapping.inc) "
} }
genrule { genrule {
name: "swiftshader_gen_spvtools_generators_inc", name: "swiftshader_spvtools_generate_registry_tables",
out: [ out: [
"generators.inc" "generators.inc"
], ],
srcs: [ srcs: [
":swiftshader_spirv.registry.xml" ":swiftshader_spirv_headers_spir-v.xml"
], ],
tool_files: ["utils/generate_registry_tables.py"], tool_files: ["utils/generate_registry_tables.py"],
cmd: "$(location) --xml=$(location :swiftshader_spirv.registry.xml) --generator-output=$(location generators.inc)", cmd: "$(location) --xml=$(location :swiftshader_spirv_headers_spir-v.xml) --generator-output=$(location generators.inc)",
} }
genrule { // FIXME this relies on `git` which is no good on build machines genrule { // FIXME this relies on `git` which is no good on build machines
name: "swiftshader_gen_spvtools_build_version_inc", name: "swiftshader_spvtools_update_build_version",
out: ["build-version.inc"], out: ["build-version.inc"],
srcs: ["CHANGES"], srcs: ["CHANGES"],
tool_files: ["utils/update_build_version.py"], tool_files: ["utils/update_build_version.py"],
...@@ -206,17 +120,10 @@ cc_library_static { ...@@ -206,17 +120,10 @@ cc_library_static {
"external/swiftshader/third_party/SPIRV-Headers/include" "external/swiftshader/third_party/SPIRV-Headers/include"
], ],
generated_headers: [ generated_headers: [
"swiftshader_gen_spvtools_grammar_tables_unified1", "swiftshader_spvtools_generate_grammar_tables",
"swiftshader_gen_spvtools_grammar_tables_debuginfo", "swiftshader_spvtools_generate_language_headers",
"swiftshader_gen_spvtools_grammar_tables_opencl_debuginfo_100", "swiftshader_spvtools_update_build_version",
"swiftshader_gen_spvtools_grammar_tables_amd-gcn-shader", "swiftshader_spvtools_generate_registry_tables",
"swiftshader_gen_spvtools_grammar_tables_amd-shader-ballot",
"swiftshader_gen_spvtools_grammar_tables_amd-shader-explicit-vertex-parameter",
"swiftshader_gen_spvtools_grammar_tables_amd-shader-trinary-minmax",
"swiftshader_gen_spvtools_enum_string_mapping",
"swiftshader_gen_spvtools_generators_inc",
"swiftshader_gen_spvtools_build_version_inc",
"swiftshader_gen_spvtools_lang_headers",
], ],
stl: "libc++_static", stl: "libc++_static",
cppflags: [ cppflags: [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment