Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ rustflags = [
"-Wclippy::match_wild_err_arm",
"-Wclippy::match_wildcard_for_single_variants",
"-Wclippy::mem_forget",
"-Wclippy::mismatched_target_os",
"-Wclippy::missing_enforced_import_renames",
"-Wclippy::mut_mut",
"-Wclippy::mutex_integer",
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-22.04
- os: ubuntu-24.04
target: x86_64-unknown-linux-gnu
- os: windows-2022
- os: windows-2025
target: x86_64-pc-windows-msvc
- os: macOS-14
- os: macOS-15
target: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ spirv-tools-sys/target
**/*.rs.bk
Cargo.lock
tools/bin
tools/*.zst
tools/*.zst
.idea
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[submodule "spirv-tools-sys/spirv-headers"]
path = spirv-tools-sys/spirv-headers
url = https://github.com/KhronosGroup/SPIRV-Headers.git
branch = vulkan-sdk-1.3.275
branch = vulkan-sdk-1.4.309
[submodule "spirv-tools-sys/spirv-tools"]
path = spirv-tools-sys/spirv-tools
url = https://github.com/KhronosGroup/SPIRV-Tools
branch = vulkan-sdk-1.3.275
branch = vulkan-sdk-1.4.309
7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
workspace = { members = ["tools/package", "tools/install"] }
[workspace]
members = [
"spirv-tools-sys",
"tools/package",
"tools/install"
]

[package]
name = "spirv-tools"
Expand Down
183 changes: 12 additions & 171 deletions spirv-tools-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ fn add_sources(builder: &mut Build, root: &str, files: &[&str]) {
}));
}

fn add_sources_glob(builder: &mut Build, root: &str) {
let root = Path::new(root);
builder.files(root.read_dir().expect("root is a dir").filter_map(|a| {
let entry = a.unwrap();
let is_cpp = entry.file_name().to_str().unwrap().ends_with(".cpp");
is_cpp.then_some(entry.path())
}));
}

fn shared(build: &mut Build) {
add_sources(
build,
Expand Down Expand Up @@ -49,187 +58,19 @@ fn shared(build: &mut Build) {
"table",
"text",
"text_handler",
"to_string",
],
);
}

fn opt(build: &mut Build) {
build.file("src/c/opt.cpp");

add_sources(
build,
"spirv-tools/source/opt",
&[
"aggressive_dead_code_elim_pass",
"analyze_live_input_pass",
"amd_ext_to_khr",
"basic_block",
"block_merge_pass",
"block_merge_util",
"build_module",
"ccp_pass",
"cfg",
"cfg_cleanup_pass",
"code_sink",
"combine_access_chains",
"compact_ids_pass",
"composite",
"const_folding_rules",
"constants",
"convert_to_half_pass",
"convert_to_sampled_image_pass",
"copy_prop_arrays",
"dead_branch_elim_pass",
"dead_insert_elim_pass",
"dead_variable_elimination",
"debug_info_manager",
"decoration_manager",
"def_use_manager",
"desc_sroa",
"desc_sroa_util",
"dominator_analysis",
"dominator_tree",
"eliminate_dead_constant_pass",
"eliminate_dead_functions_pass",
"eliminate_dead_functions_util",
"eliminate_dead_io_components_pass",
"eliminate_dead_members_pass",
"eliminate_dead_output_stores_pass",
"feature_manager",
"fix_func_call_arguments",
"fix_storage_class",
"flatten_decoration_pass",
"fold",
"fold_spec_constant_op_and_composite_pass",
"folding_rules",
"freeze_spec_constant_value_pass",
"function",
"graphics_robust_access_pass",
"if_conversion",
"inline_exhaustive_pass",
"inline_opaque_pass",
"inline_pass",
"inst_bindless_check_pass",
"inst_buff_addr_check_pass",
"inst_debug_printf_pass",
"instruction",
"instruction_list",
"instrument_pass",
"interface_var_sroa",
"interp_fixup_pass",
"invocation_interlock_placement_pass",
"ir_context",
"ir_loader",
"licm_pass",
"liveness",
"local_access_chain_convert_pass",
"local_redundancy_elimination",
"local_single_block_elim_pass",
"local_single_store_elim_pass",
"loop_dependence",
"loop_dependence_helpers",
"loop_descriptor",
"loop_fission",
"loop_fusion",
"loop_fusion_pass",
"loop_peeling",
"loop_unroller",
"loop_unswitch_pass",
"loop_utils",
"mem_pass",
"merge_return_pass",
"module",
"optimizer",
"pass",
"pass_manager",
"pch_source_opt",
"private_to_local_pass",
"propagator",
"reduce_load_size",
"redundancy_elimination",
"register_pressure",
"relax_float_ops_pass",
"remove_dontinline_pass",
"remove_duplicates_pass",
"remove_unused_interface_variables_pass",
"replace_desc_array_access_using_var_index",
"replace_invalid_opc",
"scalar_analysis",
"scalar_analysis_simplification",
"scalar_replacement_pass",
"set_spec_constant_default_value_pass",
"simplification_pass",
"spread_volatile_semantics",
"ssa_rewrite_pass",
"strength_reduction_pass",
"strip_debug_info_pass",
"strip_nonsemantic_info_pass",
"struct_cfg_analysis",
"switch_descriptorset_pass",
"trim_capabilities_pass",
"type_manager",
"types",
"unify_const_pass",
"upgrade_memory_model",
"value_number_table",
"vector_dce",
"workaround1209",
"wrap_opkill",
],
);
add_sources_glob(build, "spirv-tools/source/opt");
}

fn val(build: &mut Build) {
add_sources(
build,
"spirv-tools/source/val",
&[
"validate",
"validate_adjacency",
"validate_annotation",
"validate_arithmetics",
"validate_atomics",
"validate_barriers",
"validate_bitwise",
"validate_builtins",
"validate_capability",
"validate_cfg",
"validate_composites",
"validate_constants",
"validate_conversion",
"validate_debug",
"validate_decorations",
"validate_derivatives",
"validate_extensions",
"validate_execution_limitations",
"validate_function",
"validate_id",
"validate_image",
"validate_interfaces",
"validate_instruction",
"validate_layout",
"validate_literals",
"validate_logicals",
"validate_memory",
"validate_memory_semantics",
"validate_mesh_shading",
"validate_misc",
"validate_mode_setting",
"validate_non_uniform",
"validate_primitives",
"validate_ray_query",
"validate_ray_tracing",
"validate_ray_tracing_reorder",
"validate_scopes",
"validate_small_type_uses",
"validate_type",
"basic_block",
"construct",
"function",
"instruction",
"validation_state",
],
);
add_sources_glob(build, "spirv-tools/source/val");
}

fn main() {
Expand Down
1 change: 1 addition & 0 deletions spirv-tools-sys/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ fn main() {
vendor_table("spv-amd-shader-ballot", None);
vendor_table("debuginfo", None);
vendor_table("nonsemantic.clspvreflection", None);
vendor_table("nonsemantic.vkspreflection", None);
vendor_table("opencl.debuginfo.100", Some("CLDEBUG100_"));

// This will eventually be moved to spirv-headers
Expand Down
2 changes: 1 addition & 1 deletion spirv-tools-sys/generated/NonSemanticShaderDebugInfo100.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018 The Khronos Group Inc.
// Copyright (c) 2018-2024 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"),
Expand Down
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 @@
"v2023.6", "SPIRV-Tools v2023.6 v2023.6.rc1-0-gf0cc85ef"
"v2025.1", "SPIRV-Tools v2025.1 v2025.1.rc1-0-gf289d047"
Loading