Skip to content

Regenerate on sdk-1.4.309.0 #251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 28, 2025
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
2 changes: 1 addition & 1 deletion autogen/external/SPIRV-Headers
Submodule SPIRV-Headers updated 52 files
+10 −0 .github/dependabot.yml
+7 −7 .github/workflows/presubmit.yml
+7 −0 BUILD.bazel
+2 −1 BUILD.gn
+9 −7 CMakeLists.txt
+79 −1 LICENSE
+1 −1 README.md
+21 −11 include/spirv/spir-v.xml
+1 −1 include/spirv/unified1/AMD_gcn_shader.h
+1 −1 include/spirv/unified1/AMD_shader_ballot.h
+1 −1 include/spirv/unified1/AMD_shader_explicit_vertex_parameter.h
+1 −1 include/spirv/unified1/AMD_shader_trinary_minmax.h
+1 −1 include/spirv/unified1/DebugInfo.h
+1 −1 include/spirv/unified1/GLSL.std.450.h
+3 −2 include/spirv/unified1/NonSemanticClspvReflection.h
+1 −1 include/spirv/unified1/NonSemanticDebugBreak.h
+1 −1 include/spirv/unified1/NonSemanticDebugPrintf.h
+1 −1 include/spirv/unified1/NonSemanticShaderDebugInfo100.h
+57 −0 include/spirv/unified1/NonSemanticVkspReflection.h
+1 −1 include/spirv/unified1/OpenCL.std.h
+1 −1 include/spirv/unified1/OpenCLDebugInfo100.h
+1 −1 include/spirv/unified1/extinst.debuginfo.grammar.json
+1 −1 include/spirv/unified1/extinst.glsl.std.450.grammar.json
+11 −1 include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json
+1 −1 include/spirv/unified1/extinst.nonsemantic.shader.debuginfo.100.grammar.json
+138 −0 include/spirv/unified1/extinst.nonsemantic.vkspreflection.grammar.json
+1 −1 include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json
+1 −1 include/spirv/unified1/extinst.opencl.std.100.grammar.json
+339 −12 include/spirv/unified1/spirv.bf
+2,213 −1,022 include/spirv/unified1/spirv.core.grammar.json
+339 −12 include/spirv/unified1/spirv.cs
+2,280 −17 include/spirv/unified1/spirv.h
+2,296 −17 include/spirv/unified1/spirv.hpp
+2,296 −17 include/spirv/unified1/spirv.hpp11
+270 −19 include/spirv/unified1/spirv.json
+326 −12 include/spirv/unified1/spirv.lua
+269 −12 include/spirv/unified1/spirv.py
+339 −12 include/spirv/unified1/spv.d
+15 −8 tests/CMakeLists.txt
+37 −0 tests/example.c
+9 −5 tests/example.cpp
+41 −0 tests/example11.cpp
+2 −2 tools/buildHeaders/bin/generate_language_headers.py
+1 −0 tools/buildHeaders/bin/makeExtinstHeaders.py
+102 −54 tools/buildHeaders/header.cpp
+1 −1 tools/buildHeaders/header.h
+97 −15 tools/buildHeaders/jsonToSpirv.cpp
+25 −16 tools/buildHeaders/jsonToSpirv.h
+7 −7 tools/buildHeaders/jsoncpp/dist/json/json-forwards.h
+9 −9 tools/buildHeaders/jsoncpp/dist/json/json.h
+8 −8 tools/buildHeaders/jsoncpp/dist/jsoncpp.cpp
+1 −1 tools/buildHeaders/main.cpp
3 changes: 0 additions & 3 deletions autogen/src/binary.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::collections::HashSet;

use crate::structs;
use crate::utils::*;

Expand Down Expand Up @@ -128,7 +126,6 @@ fn gen_operand_param_parse_methods(grammar: &[structs::OperandKind]) -> Vec<(&st
}).filter_map(|element| {
// Get the symbol and all the parameters for each enumerant.
let pairs: Vec<(&str, Vec<&str>)> = element.enumerants.iter()
.scan(HashSet::new(), |seen_values, e| Some(if seen_values.insert(e.value) { Some(e) } else { None })).flatten()
.filter_map(|e| {
let params: Vec<&str> = e.parameters.iter().map(
|p| { p.kind.as_str() }
Expand Down
130 changes: 65 additions & 65 deletions autogen/src/dr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,8 @@ pub fn gen_dr_operand_kinds(grammar: &[structs::OperandKind]) -> TokenStream {
let mut operand_clauses = BTreeMap::new();

let kind = as_ident(kind);
let mut seen_discriminator = BTreeMap::new();

for e in enumerators {
if let std::collections::btree_map::Entry::Vacant(seen_entry) = seen_discriminator.entry(e.value) {
let name = match category {
structs::Category::BitEnum => {
use heck::ShoutySnakeCase;
Expand All @@ -412,7 +410,6 @@ pub fn gen_dr_operand_kinds(grammar: &[structs::OperandKind]) -> TokenStream {
_ => panic!("Unexpected operand type"),
};

seen_entry.insert(name.clone());

capability_clauses
.entry(&e.capabilities)
Expand All @@ -430,7 +427,6 @@ pub fn gen_dr_operand_kinds(grammar: &[structs::OperandKind]) -> TokenStream {
.or_insert_with(Vec::new)
.push(name.clone())
}
}
}

let extensions = if category == &structs::Category::BitEnum {
Expand Down Expand Up @@ -772,84 +768,88 @@ pub fn gen_dr_builder_normal_insts(grammar: &structs::Grammar) -> TokenStream {
let kinds = &grammar.operand_kinds;
// Generate build methods for all normal instructions (instructions must be
// in some block).
let elements = grammar.instructions.iter().filter(|inst| {
let skip = matches!(
inst.class,
Some(Type | Constant | ExtensionDecl | Debug | Annotation | ModeSetting | Exclude)
) || matches!(
inst.opname.as_str(),
// Labels should not be inserted but attached instead.
"OpLabel"
| "OpTypeForwardPointer"
| "OpTypePointer"
| "OpTypeOpaque"
| "OpUndef"
| "OpVariable"
| "OpSamplerImageAddressingModeNV" // https://github.com/gfx-rs/rspirv/pull/226#issuecomment-979469790
) || (inst.class == Some(FunctionStruct) && inst.opname != "OpFunctionCall")
|| is_terminator_instruction(inst)
|| inst.opname.starts_with("OpType");
!skip
}).map(|inst| {
let params = get_param_list(&inst.operands, true, kinds);
let extras = get_push_extras(&inst.operands, kinds, quote! { inst.operands });
let opcode = as_ident(&inst.opname[2..]);
let comment = format!("Appends an Op{} instruction to the current block.", opcode);
let insert_comment = format!("Appends an Op{} instruction to the current block.", opcode);
let name = get_function_name(&inst.opname);
let insert_name = get_function_name_with_prepend("insert_", &inst.opname);
let init = get_init_list(&inst.operands);

if !inst.operands.is_empty() && inst.operands[0].kind == "IdResultType" {
// For normal instructions, they either have both result type and
// result id or have none.
quote! {
#[doc = #comment]
pub fn #name(&mut self,#(#params),*) -> BuildResult<spirv::Word> {
let _id = result_id.unwrap_or_else(|| self.id());
#[allow(unused_mut)]
let mut inst = dr::Instruction::new(
spirv::Op::#opcode, Some(result_type), Some(_id), vec![#(#init),*]);
#(#extras)*
self.insert_into_block(InsertPoint::End, inst)?;
Ok(_id)
}
let elements = grammar
.instructions
.iter()
.filter(|inst| {
let skip = matches!(
inst.class,
Some(Type | Constant | ExtensionDecl | Debug | Annotation | ModeSetting | Exclude)
) || matches!(
inst.opname.as_str(),
// Labels should not be inserted but attached instead.
"OpLabel"
| "OpTypeForwardPointer"
| "OpTypePointer"
| "OpTypeOpaque"
| "OpUndef"
| "OpVariable"
| "OpSamplerImageAddressingModeNV" // https://github.com/gfx-rs/rspirv/pull/226#issuecomment-979469790
) || (inst.class == Some(FunctionStruct) && inst.opname != "OpFunctionCall")
|| is_terminator_instruction(inst)
|| inst.opname.starts_with("OpType");
!skip
})
.map(|inst| {
let params = get_param_list(&inst.operands, true, kinds);
let extras = get_push_extras(&inst.operands, kinds, quote! { inst.operands });
let opcode = as_ident(&inst.opname[2..]);
let comment = format!("Appends an Op{} instruction to the current block.", opcode);
let name = get_function_name(&inst.opname);
let insert_name = get_function_name_with_prepend("insert_", &inst.opname);
let init = get_init_list(&inst.operands);

#[doc = #insert_comment]
pub fn #insert_name(&mut self,insert_point: InsertPoint, #(#params),*) -> BuildResult<spirv::Word> {
let _id = result_id.unwrap_or_else(|| self.id());
#[allow(unused_mut)]
let mut inst = dr::Instruction::new(
spirv::Op::#opcode, Some(result_type), Some(_id), vec![#(#init),*]);
#(#extras)*
self.insert_into_block(insert_point, inst)?;
Ok(_id)
}
let mut result_get = quote!(None);
let mut id_typ = quote!(());
let mut id_gen = quote!();
let mut id_get = quote!(None);
let mut id_ret = quote!(());
let mut has_result = false;

if inst
.operands
.first()
.is_some_and(|o| o.kind == "IdResultType")
{
// For normal instructions, they either have both result type and
// result id or have none.
result_get = quote!(Some(result_type));
assert!(inst.operands[1].kind == "IdResult");
has_result = true;
}
// Otherwise, some `provisional` AMDX instructions seem to have a result without IdResultType
if has_result || inst.operands.first().is_some_and(|o| o.kind == "IdResult") {
id_typ = quote!(spirv::Word);
id_gen = quote!(let _id = result_id.unwrap_or_else(|| self.id()););
id_get = quote!(Some(_id));
id_ret = quote!(_id);
}
} else {

quote! {
#[doc = #comment]
pub fn #name(&mut self,#(#params),*) -> BuildResult<()> {
pub fn #name(&mut self,#(#params),*) -> BuildResult<#id_typ> {
#id_gen
#[allow(unused_mut)]
let mut inst = dr::Instruction::new(
spirv::Op::#opcode, None, None, vec![#(#init),*]);
spirv::Op::#opcode, #result_get, #id_get, vec![#(#init),*]);
#(#extras)*
self.insert_into_block(InsertPoint::End, inst)?;
Ok(())
Ok(#id_ret)
}

#[doc = #comment]
pub fn #insert_name(&mut self,insert_point: InsertPoint, #(#params),*) -> BuildResult<()> {
pub fn #insert_name(&mut self, insert_point: InsertPoint, #(#params),*)
-> BuildResult<#id_typ> {
#id_gen
#[allow(unused_mut)]
let mut inst = dr::Instruction::new(
spirv::Op::#opcode, None, None, vec![#(#init),*]);
spirv::Op::#opcode, #result_get, #id_get, vec![#(#init),*]);
#(#extras)*
self.insert_into_block(insert_point, inst)?;
Ok(())
Ok(#id_ret)
}
}
}
});
});
quote! {
#[allow(clippy::useless_conversion, clippy::too_many_arguments)]
impl Builder {
Expand Down
Loading
Loading