Skip to content

Commit

Permalink
Update to 2021.3 (#26)
Browse files Browse the repository at this point in the history
* Update to 2021.3

* Update/fix clippy lints

* Add InterpolateFixup and RemoveUnusedInterfaceVariables passes

* Update submodule

* Add missing passes

* CLIPPPPPPPYYYYY
  • Loading branch information
Jake-Shadle authored Sep 17, 2021
1 parent 49a4ec4 commit e133fd4
Show file tree
Hide file tree
Showing 23 changed files with 984 additions and 463 deletions.
13 changes: 7 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ readme = "README.md"
documentation = "https://docs.rs/spirv-tools"
homepage = "https://github.com/EmbarkStudios/spirv-tools-rs"
keywords = ["spir-v", "rust-gpu"]
exclude = [
".github",
"release.toml",
]
exclude = [".github", "release.toml"]

[features]
default = ["use-compiled-tools"]
use-installed-tools = ["spirv-tools-sys/use-installed-tools", "memchr", "tempfile"]
use-installed-tools = [
"spirv-tools-sys/use-installed-tools",
"memchr",
"tempfile",
]
use-compiled-tools = ["spirv-tools-sys/use-compiled-tools"]

[dependencies]
Expand All @@ -28,7 +29,7 @@ tempfile = { version = "3.1", optional = true }

[dev-dependencies]
structopt = "0.3"
similar = "1.3"
similar = "2.0"

[[example]]
name = "as"
Expand Down
3 changes: 3 additions & 0 deletions spirv-tools-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ fn opt(build: &mut Build) {
"const_folding_rules",
"constants",
"convert_to_half_pass",
"convert_to_sampled_image_pass",
"copy_prop_arrays",
"dead_branch_elim_pass",
"dead_insert_elim_pass",
Expand Down Expand Up @@ -109,6 +110,7 @@ fn opt(build: &mut Build) {
"instruction",
"instruction_list",
"instrument_pass",
"interp_fixup_pass",
"ir_context",
"ir_loader",
"licm_pass",
Expand Down Expand Up @@ -140,6 +142,7 @@ fn opt(build: &mut Build) {
"register_pressure",
"relax_float_ops_pass",
"remove_duplicates_pass",
"remove_unused_interface_variables_pass",
"replace_invalid_opc",
"scalar_analysis",
"scalar_analysis_simplification",
Expand Down
35 changes: 35 additions & 0 deletions spirv-tools-sys/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ fn main() {
vendor_table("nonsemantic.clspvreflection", None);
vendor_table("opencl.debuginfo.100", Some("CLDEBUG100_"));

// This will eventually be moved to spirv-headers
vendor_table_local("nonsemantic.vulkan.debuginfo.100", Some("VKDEBUG100_"));
generate_header(
"NonSemanticVulkanDebugInfo100",
"nonsemantic.vulkan.debuginfo.100",
);

registry_table();
}

Expand Down Expand Up @@ -72,6 +79,22 @@ fn vendor_table(which: &str, prefix: Option<&str>) {
.expect("failed to generate vendor table");
}

fn vendor_table_local(which: &str, prefix: Option<&str>) {
python(&[
"spirv-tools/utils/generate_grammar_tables.py".to_owned(),
format!(
"--extinst-vendor-grammar=spirv-tools/source/extinst.{}.grammar.json",
which
),
format!("--vendor-insts-output=generated/{}.insts.inc", which),
format!(
"--vendor-operand-kind-prefix={}",
prefix.unwrap_or_default()
),
])
.expect("failed to generate vendor table");
}

fn core_table(which: &str) {
python(&[
"spirv-tools/utils/generate_grammar_tables.py".to_owned(),
Expand Down Expand Up @@ -113,3 +136,15 @@ fn opencl_table(version: &str) {
"--opencl-insts-output=generated/opencl.std.insts.inc".to_owned(),
]).expect("failed to generate glsl table from spirv-headers");
}

fn generate_header(header_name: &str, grammar: &str) {
python(&[
"spirv-tools/utils/generate_language_headers.py".to_owned(),
format!(
"--extinst-grammar=spirv-tools/source/extinst.{}.grammar.json",
grammar
),
format!("--extinst-output-path=generated/{}.h", header_name),
])
.expect("failed to generate C header")
}
151 changes: 151 additions & 0 deletions spirv-tools-sys/generated/NonSemanticVulkanDebugInfo100.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
// Copyright (c) 2018 The Khronos Group Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and/or associated documentation files (the "Materials"),
// to deal in the Materials without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Materials, and to permit persons to whom the
// Materials are furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Materials.
//
// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
//
// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
// IN THE MATERIALS.

#ifndef SPIRV_EXTINST_NonSemanticVulkanDebugInfo100_H_
#define SPIRV_EXTINST_NonSemanticVulkanDebugInfo100_H_

#ifdef __cplusplus
extern "C" {
#endif

enum { NonSemanticVulkanDebugInfo100Version = 100, NonSemanticVulkanDebugInfo100Version_BitWidthPadding = 0x7fffffff };
enum { NonSemanticVulkanDebugInfo100Revision = 2, NonSemanticVulkanDebugInfo100Revision_BitWidthPadding = 0x7fffffff };

enum NonSemanticVulkanDebugInfo100Instructions {
NonSemanticVulkanDebugInfo100DebugInfoNone = 0,
NonSemanticVulkanDebugInfo100DebugCompilationUnit = 1,
NonSemanticVulkanDebugInfo100DebugTypeBasic = 2,
NonSemanticVulkanDebugInfo100DebugTypePointer = 3,
NonSemanticVulkanDebugInfo100DebugTypeQualifier = 4,
NonSemanticVulkanDebugInfo100DebugTypeArray = 5,
NonSemanticVulkanDebugInfo100DebugTypeVector = 6,
NonSemanticVulkanDebugInfo100DebugTypedef = 7,
NonSemanticVulkanDebugInfo100DebugTypeFunction = 8,
NonSemanticVulkanDebugInfo100DebugTypeEnum = 9,
NonSemanticVulkanDebugInfo100DebugTypeComposite = 10,
NonSemanticVulkanDebugInfo100DebugTypeMember = 11,
NonSemanticVulkanDebugInfo100DebugTypeInheritance = 12,
NonSemanticVulkanDebugInfo100DebugTypePtrToMember = 13,
NonSemanticVulkanDebugInfo100DebugTypeTemplate = 14,
NonSemanticVulkanDebugInfo100DebugTypeTemplateParameter = 15,
NonSemanticVulkanDebugInfo100DebugTypeTemplateTemplateParameter = 16,
NonSemanticVulkanDebugInfo100DebugTypeTemplateParameterPack = 17,
NonSemanticVulkanDebugInfo100DebugGlobalVariable = 18,
NonSemanticVulkanDebugInfo100DebugFunctionDeclaration = 19,
NonSemanticVulkanDebugInfo100DebugFunction = 20,
NonSemanticVulkanDebugInfo100DebugLexicalBlock = 21,
NonSemanticVulkanDebugInfo100DebugLexicalBlockDiscriminator = 22,
NonSemanticVulkanDebugInfo100DebugScope = 23,
NonSemanticVulkanDebugInfo100DebugNoScope = 24,
NonSemanticVulkanDebugInfo100DebugInlinedAt = 25,
NonSemanticVulkanDebugInfo100DebugLocalVariable = 26,
NonSemanticVulkanDebugInfo100DebugInlinedVariable = 27,
NonSemanticVulkanDebugInfo100DebugDeclare = 28,
NonSemanticVulkanDebugInfo100DebugValue = 29,
NonSemanticVulkanDebugInfo100DebugOperation = 30,
NonSemanticVulkanDebugInfo100DebugExpression = 31,
NonSemanticVulkanDebugInfo100DebugMacroDef = 32,
NonSemanticVulkanDebugInfo100DebugMacroUndef = 33,
NonSemanticVulkanDebugInfo100DebugImportedEntity = 34,
NonSemanticVulkanDebugInfo100DebugSource = 35,
NonSemanticVulkanDebugInfo100DebugFunctionDefinition = 101,
NonSemanticVulkanDebugInfo100InstructionsMax = 0x7ffffff
};


enum NonSemanticVulkanDebugInfo100DebugInfoFlags {
NonSemanticVulkanDebugInfo100FlagIsProtected = 0x01,
NonSemanticVulkanDebugInfo100FlagIsPrivate = 0x02,
NonSemanticVulkanDebugInfo100FlagIsPublic = 0x03,
NonSemanticVulkanDebugInfo100FlagIsLocal = 0x04,
NonSemanticVulkanDebugInfo100FlagIsDefinition = 0x08,
NonSemanticVulkanDebugInfo100FlagFwdDecl = 0x10,
NonSemanticVulkanDebugInfo100FlagArtificial = 0x20,
NonSemanticVulkanDebugInfo100FlagExplicit = 0x40,
NonSemanticVulkanDebugInfo100FlagPrototyped = 0x80,
NonSemanticVulkanDebugInfo100FlagObjectPointer = 0x100,
NonSemanticVulkanDebugInfo100FlagStaticMember = 0x200,
NonSemanticVulkanDebugInfo100FlagIndirectVariable = 0x400,
NonSemanticVulkanDebugInfo100FlagLValueReference = 0x800,
NonSemanticVulkanDebugInfo100FlagRValueReference = 0x1000,
NonSemanticVulkanDebugInfo100FlagIsOptimized = 0x2000,
NonSemanticVulkanDebugInfo100FlagIsEnumClass = 0x4000,
NonSemanticVulkanDebugInfo100FlagTypePassByValue = 0x8000,
NonSemanticVulkanDebugInfo100FlagTypePassByReference = 0x10000,
NonSemanticVulkanDebugInfo100DebugInfoFlagsMax = 0x7ffffff
};

enum NonSemanticVulkanDebugInfo100DebugBaseTypeAttributeEncoding {
NonSemanticVulkanDebugInfo100Unspecified = 0,
NonSemanticVulkanDebugInfo100Address = 1,
NonSemanticVulkanDebugInfo100Boolean = 2,
NonSemanticVulkanDebugInfo100Float = 3,
NonSemanticVulkanDebugInfo100Signed = 4,
NonSemanticVulkanDebugInfo100SignedChar = 5,
NonSemanticVulkanDebugInfo100Unsigned = 6,
NonSemanticVulkanDebugInfo100UnsignedChar = 7,
NonSemanticVulkanDebugInfo100DebugBaseTypeAttributeEncodingMax = 0x7ffffff
};

enum NonSemanticVulkanDebugInfo100DebugCompositeType {
NonSemanticVulkanDebugInfo100Class = 0,
NonSemanticVulkanDebugInfo100Structure = 1,
NonSemanticVulkanDebugInfo100Union = 2,
NonSemanticVulkanDebugInfo100DebugCompositeTypeMax = 0x7ffffff
};

enum NonSemanticVulkanDebugInfo100DebugTypeQualifier {
NonSemanticVulkanDebugInfo100ConstType = 0,
NonSemanticVulkanDebugInfo100VolatileType = 1,
NonSemanticVulkanDebugInfo100RestrictType = 2,
NonSemanticVulkanDebugInfo100AtomicType = 3,
NonSemanticVulkanDebugInfo100DebugTypeQualifierMax = 0x7ffffff
};

enum NonSemanticVulkanDebugInfo100DebugOperation {
NonSemanticVulkanDebugInfo100Deref = 0,
NonSemanticVulkanDebugInfo100Plus = 1,
NonSemanticVulkanDebugInfo100Minus = 2,
NonSemanticVulkanDebugInfo100PlusUconst = 3,
NonSemanticVulkanDebugInfo100BitPiece = 4,
NonSemanticVulkanDebugInfo100Swap = 5,
NonSemanticVulkanDebugInfo100Xderef = 6,
NonSemanticVulkanDebugInfo100StackValue = 7,
NonSemanticVulkanDebugInfo100Constu = 8,
NonSemanticVulkanDebugInfo100Fragment = 9,
NonSemanticVulkanDebugInfo100DebugOperationMax = 0x7ffffff
};

enum NonSemanticVulkanDebugInfo100DebugImportedEntity {
NonSemanticVulkanDebugInfo100ImportedModule = 0,
NonSemanticVulkanDebugInfo100ImportedDeclaration = 1,
NonSemanticVulkanDebugInfo100DebugImportedEntityMax = 0x7ffffff
};


#ifdef __cplusplus
}
#endif

#endif // SPIRV_EXTINST_NonSemanticVulkanDebugInfo100_H_
2 changes: 1 addition & 1 deletion spirv-tools-sys/generated/build-version.inc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"v2021.0-dev", "SPIRV-Tools v2021.0-dev v2020.5-198-g5af051b0"
"v2021.3", "SPIRV-Tools v2021.3 v2020.5-359-g4caf8c16"
Loading

0 comments on commit e133fd4

Please sign in to comment.