From c16591f0cc32cde2233ab329eb856ef8e54eae52 Mon Sep 17 00:00:00 2001 From: exrook Date: Fri, 1 Dec 2023 13:46:03 -0500 Subject: [PATCH] Regenerate on `sdk-1.3.268` (#244) --- autogen/external/SPIRV-Headers | 2 +- autogen/src/binary.rs | 11 +- autogen/src/dr.rs | 1 + autogen/src/sr.rs | 5 + autogen/src/utils.rs | 12 +- rspirv/Cargo.toml | 2 +- rspirv/binary/assemble.rs | 7 + rspirv/binary/autogen_decode_operand.rs | 74 +++ rspirv/binary/autogen_disas_operand.rs | 24 + rspirv/binary/autogen_error.rs | 42 ++ rspirv/binary/autogen_parse_operand.rs | 64 +++ rspirv/dr/autogen_operand.rs | 422 ++++++++++++++-- rspirv/dr/build/autogen_norm_insts.rs | 626 ++++++++++++++++++++++++ rspirv/dr/build/autogen_type.rs | 45 ++ rspirv/grammar/autogen_table.rs | 145 ++++++ rspirv/lift/autogen_context.rs | 266 ++++++++++ rspirv/sr/autogen_decoration.rs | 10 + rspirv/sr/autogen_ops.rs | 62 +++ rspirv/sr/autogen_types.rs | 7 + spirv/Cargo.toml | 2 +- spirv/autogen_spirv.rs | 360 +++++++++++++- 21 files changed, 2136 insertions(+), 53 deletions(-) diff --git a/autogen/external/SPIRV-Headers b/autogen/external/SPIRV-Headers index 1feaf441..e867c066 160000 --- a/autogen/external/SPIRV-Headers +++ b/autogen/external/SPIRV-Headers @@ -1 +1 @@ -Subproject commit 1feaf4414eb2b353764d01d88f8aa4bcc67b60db +Subproject commit e867c06631767a2d96424cbec530f9ee5e78180f diff --git a/autogen/src/binary.rs b/autogen/src/binary.rs index bed9d061..f880b8f9 100644 --- a/autogen/src/binary.rs +++ b/autogen/src/binary.rs @@ -14,14 +14,11 @@ fn get_decode_method(kind: &str) -> Ident { return as_ident("id"); } - let mut kind = kind; - if kind.starts_with("Literal") { - kind = &kind["Literal".len()..]; - if kind == "Integer" { - return as_ident("bit32"); - } + match kind.strip_prefix("Literal") { + Some("Integer" | "Float") => as_ident("bit32"), + Some(kind) => as_ident(&kind.to_snake_case()), + None => as_ident(&kind.to_snake_case()), } - as_ident(&kind.to_snake_case()) } /// Returns the generated operand decoding errors for binary::Decoder by diff --git a/autogen/src/dr.rs b/autogen/src/dr.rs index cb686c25..bc5b4125 100644 --- a/autogen/src/dr.rs +++ b/autogen/src/dr.rs @@ -231,6 +231,7 @@ pub fn gen_dr_operand_kinds(grammar: &[structs::OperandKind]) -> TokenStream { | "LiteralInteger" | "IdResult" | "IdResultType" + | "LiteralFloat" )) }) .map(as_ident) diff --git a/autogen/src/sr.rs b/autogen/src/sr.rs index a1ca7626..21dfe3f6 100644 --- a/autogen/src/sr.rs +++ b/autogen/src/sr.rs @@ -112,6 +112,11 @@ impl OperandTokens { quote! { *value }, OperandTy::Single("LiteralBit32"), ), + "LiteralFloat" => ( + quote! { u32 }, + quote! { *value }, + OperandTy::Single("LiteralBit32"), + ), "LiteralExtInstInteger" => ( quote! { u32 }, quote! { *value }, diff --git a/autogen/src/utils.rs b/autogen/src/utils.rs index cc1303be..5761ec8a 100644 --- a/autogen/src/utils.rs +++ b/autogen/src/utils.rs @@ -27,7 +27,10 @@ pub fn as_ident(ident: &str) -> Ident { /// given operand `kind` in the grammar. pub fn get_dr_operand_kind(kind: &str) -> Ident { as_ident( - if matches!(kind, "LiteralInteger" | "LiteralContextDependentNumber") { + if matches!( + kind, + "LiteralInteger" | "LiteralContextDependentNumber" | "LiteralFloat" + ) { // TODO: LiteralContextDependentNumber should use the correct type to decode "LiteralBit32" } else { @@ -41,7 +44,8 @@ pub fn get_dr_operand_kind(kind: &str) -> Ident { pub fn get_enum_underlying_type(kind: &str, generic_string: bool) -> TokenStream { if kind.starts_with("Id") { quote! { spirv::Word } - } else if kind == "LiteralInteger" || kind == "LiteralExtInstInteger" { + } else if kind == "LiteralInteger" || kind == "LiteralExtInstInteger" || kind == "LiteralFloat" + { quote! { u32 } } else if kind == "LiteralSpecConstantOpInteger" { quote! { spirv::Op } @@ -92,9 +96,13 @@ pub fn get_param_name(params: &[structs::Operand], param_index: usize) -> Ident let mut name = raw_name.to_snake_case(); + // Rename/remap rust reserved keywords if name == "type" { name = "ty".to_owned(); } + if name == "use" { + name = "usage".to_owned(); + } if duplicate_count > 0 { name = format!("{}_{}", name, duplicate_count + 1); diff --git a/rspirv/Cargo.toml b/rspirv/Cargo.toml index 30b3fc6e..ae8775bd 100644 --- a/rspirv/Cargo.toml +++ b/rspirv/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rspirv" -version = "0.11.0+sdk-1.3.243.0" +version = "0.11.0+sdk-1.3.268.0" authors = ["Lei Zhang "] edition = "2018" diff --git a/rspirv/binary/assemble.rs b/rspirv/binary/assemble.rs index 76fc309a..f20222ea 100644 --- a/rspirv/binary/assemble.rs +++ b/rspirv/binary/assemble.rs @@ -47,6 +47,7 @@ impl Assemble for dr::Operand { Self::MemorySemantics(v) => result.push(v.bits()), Self::MemoryAccess(v) => result.push(v.bits()), Self::KernelProfilingInfo(v) => result.push(v.bits()), + Self::CooperativeMatrixOperands(v) => result.push(v.bits()), Self::SourceLanguage(v) => result.push(v as u32), Self::ExecutionModel(v) => result.push(v as u32), Self::AddressingModel(v) => result.push(v as u32), @@ -87,6 +88,12 @@ impl Assemble for dr::Operand { Self::FPOperationMode(v) => result.push(v as u32), Self::OverflowModes(v) => result.push(v as u32), Self::PackedVectorFormat(v) => result.push(v as u32), + Self::HostAccessQualifier(v) => result.push(v as u32), + Self::CooperativeMatrixLayout(v) => result.push(v as u32), + Self::CooperativeMatrixUse(v) => result.push(v as u32), + Self::InitializationModeQualifier(v) => result.push(v as u32), + Self::LoadCacheControl(v) => result.push(v as u32), + Self::StoreCacheControl(v) => result.push(v as u32), } } } diff --git a/rspirv/binary/autogen_decode_operand.rs b/rspirv/binary/autogen_decode_operand.rs index 05d9aedd..7821d94e 100644 --- a/rspirv/binary/autogen_decode_operand.rs +++ b/rspirv/binary/autogen_decode_operand.rs @@ -317,6 +317,17 @@ impl<'a> Decoder<'a> { Err(Error::StreamExpected(self.offset)) } } + #[doc = "Decodes and returns the next SPIR-V word as\na SPIR-V HostAccessQualifier value."] + pub fn host_access_qualifier(&mut self) -> Result { + if let Ok(word) = self.word() { + spirv::HostAccessQualifier::from_u32(word).ok_or(Error::HostAccessQualifierUnknown( + self.offset - WORD_NUM_BYTES, + word, + )) + } else { + Err(Error::StreamExpected(self.offset)) + } + } #[doc = "Decodes and returns the next SPIR-V word as\na SPIR-V FunctionParameterAttribute value."] pub fn function_parameter_attribute(&mut self) -> Result { if let Ok(word) = self.word() { @@ -431,4 +442,67 @@ impl<'a> Decoder<'a> { Err(Error::StreamExpected(self.offset)) } } + #[doc = "Decodes and returns the next SPIR-V word as\na SPIR-V CooperativeMatrixOperands value."] + pub fn cooperative_matrix_operands(&mut self) -> Result { + if let Ok(word) = self.word() { + spirv::CooperativeMatrixOperands::from_bits(word).ok_or( + Error::CooperativeMatrixOperandsUnknown(self.offset - WORD_NUM_BYTES, word), + ) + } else { + Err(Error::StreamExpected(self.offset)) + } + } + #[doc = "Decodes and returns the next SPIR-V word as\na SPIR-V CooperativeMatrixLayout value."] + pub fn cooperative_matrix_layout(&mut self) -> Result { + if let Ok(word) = self.word() { + spirv::CooperativeMatrixLayout::from_u32(word).ok_or( + Error::CooperativeMatrixLayoutUnknown(self.offset - WORD_NUM_BYTES, word), + ) + } else { + Err(Error::StreamExpected(self.offset)) + } + } + #[doc = "Decodes and returns the next SPIR-V word as\na SPIR-V CooperativeMatrixUse value."] + pub fn cooperative_matrix_use(&mut self) -> Result { + if let Ok(word) = self.word() { + spirv::CooperativeMatrixUse::from_u32(word).ok_or(Error::CooperativeMatrixUseUnknown( + self.offset - WORD_NUM_BYTES, + word, + )) + } else { + Err(Error::StreamExpected(self.offset)) + } + } + #[doc = "Decodes and returns the next SPIR-V word as\na SPIR-V InitializationModeQualifier value."] + pub fn initialization_mode_qualifier(&mut self) -> Result { + if let Ok(word) = self.word() { + spirv::InitializationModeQualifier::from_u32(word).ok_or( + Error::InitializationModeQualifierUnknown(self.offset - WORD_NUM_BYTES, word), + ) + } else { + Err(Error::StreamExpected(self.offset)) + } + } + #[doc = "Decodes and returns the next SPIR-V word as\na SPIR-V LoadCacheControl value."] + pub fn load_cache_control(&mut self) -> Result { + if let Ok(word) = self.word() { + spirv::LoadCacheControl::from_u32(word).ok_or(Error::LoadCacheControlUnknown( + self.offset - WORD_NUM_BYTES, + word, + )) + } else { + Err(Error::StreamExpected(self.offset)) + } + } + #[doc = "Decodes and returns the next SPIR-V word as\na SPIR-V StoreCacheControl value."] + pub fn store_cache_control(&mut self) -> Result { + if let Ok(word) = self.word() { + spirv::StoreCacheControl::from_u32(word).ok_or(Error::StoreCacheControlUnknown( + self.offset - WORD_NUM_BYTES, + word, + )) + } else { + Err(Error::StreamExpected(self.offset)) + } + } } diff --git a/rspirv/binary/autogen_disas_operand.rs b/rspirv/binary/autogen_disas_operand.rs index da801864..466836fe 100644 --- a/rspirv/binary/autogen_disas_operand.rs +++ b/rspirv/binary/autogen_disas_operand.rs @@ -383,3 +383,27 @@ impl Disassemble for spirv::FragmentShadingRate { bits.join("|") } } +impl Disassemble for spirv::CooperativeMatrixOperands { + fn disassemble(&self) -> String { + if self.is_empty() { + return "None".to_string(); + } + let mut bits = vec![]; + if self.contains(spirv::CooperativeMatrixOperands::MATRIX_A_SIGNED_COMPONENTS_KHR) { + bits.push("MatrixASignedComponentsKHR") + } + if self.contains(spirv::CooperativeMatrixOperands::MATRIX_B_SIGNED_COMPONENTS_KHR) { + bits.push("MatrixBSignedComponentsKHR") + } + if self.contains(spirv::CooperativeMatrixOperands::MATRIX_C_SIGNED_COMPONENTS_KHR) { + bits.push("MatrixCSignedComponentsKHR") + } + if self.contains(spirv::CooperativeMatrixOperands::MATRIX_RESULT_SIGNED_COMPONENTS_KHR) { + bits.push("MatrixResultSignedComponentsKHR") + } + if self.contains(spirv::CooperativeMatrixOperands::SATURATING_ACCUMULATION_KHR) { + bits.push("SaturatingAccumulationKHR") + } + bits.join("|") + } +} diff --git a/rspirv/binary/autogen_error.rs b/rspirv/binary/autogen_error.rs index 2855184a..21b9e5f4 100644 --- a/rspirv/binary/autogen_error.rs +++ b/rspirv/binary/autogen_error.rs @@ -38,6 +38,7 @@ pub enum Error { OverflowModesUnknown(usize, spirv::Word), LinkageTypeUnknown(usize, spirv::Word), AccessQualifierUnknown(usize, spirv::Word), + HostAccessQualifierUnknown(usize, spirv::Word), FunctionParameterAttributeUnknown(usize, spirv::Word), DecorationUnknown(usize, spirv::Word), BuiltInUnknown(usize, spirv::Word), @@ -49,6 +50,12 @@ pub enum Error { RayQueryCommittedIntersectionTypeUnknown(usize, spirv::Word), RayQueryCandidateIntersectionTypeUnknown(usize, spirv::Word), PackedVectorFormatUnknown(usize, spirv::Word), + CooperativeMatrixOperandsUnknown(usize, spirv::Word), + CooperativeMatrixLayoutUnknown(usize, spirv::Word), + CooperativeMatrixUseUnknown(usize, spirv::Word), + InitializationModeQualifierUnknown(usize, spirv::Word), + LoadCacheControlUnknown(usize, spirv::Word), + StoreCacheControlUnknown(usize, spirv::Word), #[doc = r"Failed to decode a string."] #[doc = r""] #[doc = r"For structured error handling, the second element could be"] @@ -208,6 +215,11 @@ impl fmt::Display for Error { "unknown value {} for operand kind AccessQualifier at index {}", word, index ), + Error::HostAccessQualifierUnknown(index, word) => write!( + f, + "unknown value {} for operand kind HostAccessQualifier at index {}", + word, index + ), Error::FunctionParameterAttributeUnknown(index, word) => write!( f, "unknown value {} for operand kind FunctionParameterAttribute at index {}", @@ -263,6 +275,36 @@ impl fmt::Display for Error { "unknown value {} for operand kind PackedVectorFormat at index {}", word, index ), + Error::CooperativeMatrixOperandsUnknown(index, word) => write!( + f, + "unknown value {} for operand kind CooperativeMatrixOperands at index {}", + word, index + ), + Error::CooperativeMatrixLayoutUnknown(index, word) => write!( + f, + "unknown value {} for operand kind CooperativeMatrixLayout at index {}", + word, index + ), + Error::CooperativeMatrixUseUnknown(index, word) => write!( + f, + "unknown value {} for operand kind CooperativeMatrixUse at index {}", + word, index + ), + Error::InitializationModeQualifierUnknown(index, word) => write!( + f, + "unknown value {} for operand kind InitializationModeQualifier at index {}", + word, index + ), + Error::LoadCacheControlUnknown(index, word) => write!( + f, + "unknown value {} for operand kind LoadCacheControl at index {}", + word, index + ), + Error::StoreCacheControlUnknown(index, word) => write!( + f, + "unknown value {} for operand kind StoreCacheControl at index {}", + word, index + ), Error::DecodeStringFailed(index, ref e) => { write!(f, "cannot decode string at index {}: {}", index, e) } diff --git a/rspirv/binary/autogen_parse_operand.rs b/rspirv/binary/autogen_parse_operand.rs index 474bb8a8..a8d4004a 100644 --- a/rspirv/binary/autogen_parse_operand.rs +++ b/rspirv/binary/autogen_parse_operand.rs @@ -68,6 +68,9 @@ impl<'c, 'd> Parser<'c, 'd> { GOpKind::AccessQualifier => vec![dr::Operand::AccessQualifier( self.decoder.access_qualifier()?, )], + GOpKind::HostAccessQualifier => vec![dr::Operand::HostAccessQualifier( + self.decoder.host_access_qualifier()?, + )], GOpKind::FunctionParameterAttribute => vec![dr::Operand::FunctionParameterAttribute( self.decoder.function_parameter_attribute()?, )], @@ -96,11 +99,30 @@ impl<'c, 'd> Parser<'c, 'd> { GOpKind::PackedVectorFormat => vec![dr::Operand::PackedVectorFormat( self.decoder.packed_vector_format()?, )], + GOpKind::CooperativeMatrixOperands => vec![dr::Operand::CooperativeMatrixOperands( + self.decoder.cooperative_matrix_operands()?, + )], + GOpKind::CooperativeMatrixLayout => vec![dr::Operand::CooperativeMatrixLayout( + self.decoder.cooperative_matrix_layout()?, + )], + GOpKind::CooperativeMatrixUse => vec![dr::Operand::CooperativeMatrixUse( + self.decoder.cooperative_matrix_use()?, + )], + GOpKind::InitializationModeQualifier => vec![dr::Operand::InitializationModeQualifier( + self.decoder.initialization_mode_qualifier()?, + )], + GOpKind::LoadCacheControl => vec![dr::Operand::LoadCacheControl( + self.decoder.load_cache_control()?, + )], + GOpKind::StoreCacheControl => vec![dr::Operand::StoreCacheControl( + self.decoder.store_cache_control()?, + )], GOpKind::IdMemorySemantics => vec![dr::Operand::IdMemorySemantics(self.decoder.id()?)], GOpKind::IdScope => vec![dr::Operand::IdScope(self.decoder.id()?)], GOpKind::IdRef => vec![dr::Operand::IdRef(self.decoder.id()?)], GOpKind::LiteralInteger => vec![dr::Operand::LiteralBit32(self.decoder.bit32()?)], GOpKind::LiteralString => vec![dr::Operand::LiteralString(self.decoder.string()?)], + GOpKind::LiteralFloat => vec![dr::Operand::LiteralBit32(self.decoder.bit32()?)], GOpKind::LiteralExtInstInteger => vec![dr::Operand::LiteralExtInstInteger( self.decoder.ext_inst_integer()?, )], @@ -325,6 +347,20 @@ impl<'c, 'd> Parser<'c, 'd> { spirv::ExecutionMode::RoundingModeRTZ => { vec![dr::Operand::LiteralBit32(self.decoder.bit32()?)] } + spirv::ExecutionMode::MaxNodeRecursionAMDX => { + vec![dr::Operand::IdRef(self.decoder.id()?)] + } + spirv::ExecutionMode::StaticNumWorkgroupsAMDX => vec![ + dr::Operand::IdRef(self.decoder.id()?), + dr::Operand::IdRef(self.decoder.id()?), + dr::Operand::IdRef(self.decoder.id()?), + ], + spirv::ExecutionMode::ShaderIndexAMDX => vec![dr::Operand::IdRef(self.decoder.id()?)], + spirv::ExecutionMode::MaxNumWorkgroupsAMDX => vec![ + dr::Operand::IdRef(self.decoder.id()?), + dr::Operand::IdRef(self.decoder.id()?), + dr::Operand::IdRef(self.decoder.id()?), + ], spirv::ExecutionMode::OutputPrimitivesNV => { vec![dr::Operand::LiteralBit32(self.decoder.bit32()?)] } @@ -417,6 +453,13 @@ impl<'c, 'd> Parser<'c, 'd> { } spirv::Decoration::AlignmentId => vec![dr::Operand::IdRef(self.decoder.id()?)], spirv::Decoration::MaxByteOffsetId => vec![dr::Operand::IdRef(self.decoder.id()?)], + spirv::Decoration::NodeSharesPayloadLimitsWithAMDX => { + vec![dr::Operand::IdRef(self.decoder.id()?)] + } + spirv::Decoration::NodeMaxPayloadsAMDX => vec![dr::Operand::IdRef(self.decoder.id()?)], + spirv::Decoration::PayloadNodeNameAMDX => { + vec![dr::Operand::LiteralString(self.decoder.string()?)] + } spirv::Decoration::SecondaryViewportRelativeNV => { vec![dr::Operand::LiteralBit32(self.decoder.bit32()?)] } @@ -503,6 +546,19 @@ impl<'c, 'd> Parser<'c, 'd> { dr::Operand::LiteralBit32(self.decoder.bit32()?), dr::Operand::FPOperationMode(self.decoder.fp_operation_mode()?), ], + spirv::Decoration::InitModeINTEL => vec![dr::Operand::InitializationModeQualifier( + self.decoder.initialization_mode_qualifier()?, + )], + spirv::Decoration::ImplementInRegisterMapINTEL => { + vec![dr::Operand::LiteralBit32(self.decoder.bit32()?)] + } + spirv::Decoration::HostAccessINTEL => vec![ + dr::Operand::HostAccessQualifier(self.decoder.host_access_qualifier()?), + dr::Operand::LiteralString(self.decoder.string()?), + ], + spirv::Decoration::FPMaxErrorDecorationINTEL => { + vec![dr::Operand::LiteralBit32(self.decoder.bit32()?)] + } spirv::Decoration::LatencyControlLabelINTEL => { vec![dr::Operand::LiteralBit32(self.decoder.bit32()?)] } @@ -531,6 +587,14 @@ impl<'c, 'd> Parser<'c, 'd> { spirv::Decoration::MMHostInterfaceWaitRequestINTEL => { vec![dr::Operand::LiteralBit32(self.decoder.bit32()?)] } + spirv::Decoration::CacheControlLoadINTEL => vec![ + dr::Operand::LiteralBit32(self.decoder.bit32()?), + dr::Operand::LoadCacheControl(self.decoder.load_cache_control()?), + ], + spirv::Decoration::CacheControlStoreINTEL => vec![ + dr::Operand::LiteralBit32(self.decoder.bit32()?), + dr::Operand::StoreCacheControl(self.decoder.store_cache_control()?), + ], _ => vec![], }) } diff --git a/rspirv/dr/autogen_operand.rs b/rspirv/dr/autogen_operand.rs index 0eae3a15..c3832255 100644 --- a/rspirv/dr/autogen_operand.rs +++ b/rspirv/dr/autogen_operand.rs @@ -35,6 +35,7 @@ pub enum Operand { OverflowModes(spirv::OverflowModes), LinkageType(spirv::LinkageType), AccessQualifier(spirv::AccessQualifier), + HostAccessQualifier(spirv::HostAccessQualifier), FunctionParameterAttribute(spirv::FunctionParameterAttribute), Decoration(spirv::Decoration), BuiltIn(spirv::BuiltIn), @@ -46,6 +47,12 @@ pub enum Operand { RayQueryCommittedIntersectionType(spirv::RayQueryCommittedIntersectionType), RayQueryCandidateIntersectionType(spirv::RayQueryCandidateIntersectionType), PackedVectorFormat(spirv::PackedVectorFormat), + CooperativeMatrixOperands(spirv::CooperativeMatrixOperands), + CooperativeMatrixLayout(spirv::CooperativeMatrixLayout), + CooperativeMatrixUse(spirv::CooperativeMatrixUse), + InitializationModeQualifier(spirv::InitializationModeQualifier), + LoadCacheControl(spirv::LoadCacheControl), + StoreCacheControl(spirv::StoreCacheControl), IdMemorySemantics(spirv::Word), IdScope(spirv::Word), IdRef(spirv::Word), @@ -200,6 +207,11 @@ impl From for Operand { Self::AccessQualifier(o) } } +impl From for Operand { + fn from(o: spirv::HostAccessQualifier) -> Self { + Self::HostAccessQualifier(o) + } +} impl From for Operand { fn from(o: spirv::FunctionParameterAttribute) -> Self { Self::FunctionParameterAttribute(o) @@ -255,6 +267,36 @@ impl From for Operand { Self::PackedVectorFormat(o) } } +impl From for Operand { + fn from(o: spirv::CooperativeMatrixOperands) -> Self { + Self::CooperativeMatrixOperands(o) + } +} +impl From for Operand { + fn from(o: spirv::CooperativeMatrixLayout) -> Self { + Self::CooperativeMatrixLayout(o) + } +} +impl From for Operand { + fn from(o: spirv::CooperativeMatrixUse) -> Self { + Self::CooperativeMatrixUse(o) + } +} +impl From for Operand { + fn from(o: spirv::InitializationModeQualifier) -> Self { + Self::InitializationModeQualifier(o) + } +} +impl From for Operand { + fn from(o: spirv::LoadCacheControl) -> Self { + Self::LoadCacheControl(o) + } +} +impl From for Operand { + fn from(o: spirv::StoreCacheControl) -> Self { + Self::StoreCacheControl(o) + } +} impl From for Operand { fn from(o: u32) -> Self { Self::LiteralBit32(o) @@ -307,6 +349,7 @@ impl fmt::Display for Operand { Operand::OverflowModes(ref v) => write!(f, "{:?}", v), Operand::LinkageType(ref v) => write!(f, "{:?}", v), Operand::AccessQualifier(ref v) => write!(f, "{:?}", v), + Operand::HostAccessQualifier(ref v) => write!(f, "{:?}", v), Operand::FunctionParameterAttribute(ref v) => write!(f, "{:?}", v), Operand::Decoration(ref v) => write!(f, "{:?}", v), Operand::BuiltIn(ref v) => write!(f, "{:?}", v), @@ -318,6 +361,12 @@ impl fmt::Display for Operand { Operand::RayQueryCommittedIntersectionType(ref v) => write!(f, "{:?}", v), Operand::RayQueryCandidateIntersectionType(ref v) => write!(f, "{:?}", v), Operand::PackedVectorFormat(ref v) => write!(f, "{:?}", v), + Operand::CooperativeMatrixOperands(ref v) => write!(f, "{:?}", v), + Operand::CooperativeMatrixLayout(ref v) => write!(f, "{:?}", v), + Operand::CooperativeMatrixUse(ref v) => write!(f, "{:?}", v), + Operand::InitializationModeQualifier(ref v) => write!(f, "{:?}", v), + Operand::LoadCacheControl(ref v) => write!(f, "{:?}", v), + Operand::StoreCacheControl(ref v) => write!(f, "{:?}", v), Operand::IdMemorySemantics(ref v) => write!(f, "%{}", v), Operand::IdScope(ref v) => write!(f, "%{}", v), Operand::IdRef(ref v) => write!(f, "%{}", v), @@ -516,6 +565,15 @@ impl Operand { ref other => panic!("Expected Operand::AccessQualifier, got {} instead", other), } } + pub fn unwrap_host_access_qualifier(&self) -> spirv::HostAccessQualifier { + match *self { + Self::HostAccessQualifier(v) => v, + ref other => panic!( + "Expected Operand::HostAccessQualifier, got {} instead", + other + ), + } + } pub fn unwrap_function_parameter_attribute(&self) -> spirv::FunctionParameterAttribute { match *self { Self::FunctionParameterAttribute(v) => v, @@ -604,6 +662,54 @@ impl Operand { ), } } + pub fn unwrap_cooperative_matrix_operands(&self) -> spirv::CooperativeMatrixOperands { + match *self { + Self::CooperativeMatrixOperands(v) => v, + ref other => panic!( + "Expected Operand::CooperativeMatrixOperands, got {} instead", + other + ), + } + } + pub fn unwrap_cooperative_matrix_layout(&self) -> spirv::CooperativeMatrixLayout { + match *self { + Self::CooperativeMatrixLayout(v) => v, + ref other => panic!( + "Expected Operand::CooperativeMatrixLayout, got {} instead", + other + ), + } + } + pub fn unwrap_cooperative_matrix_use(&self) -> spirv::CooperativeMatrixUse { + match *self { + Self::CooperativeMatrixUse(v) => v, + ref other => panic!( + "Expected Operand::CooperativeMatrixUse, got {} instead", + other + ), + } + } + pub fn unwrap_initialization_mode_qualifier(&self) -> spirv::InitializationModeQualifier { + match *self { + Self::InitializationModeQualifier(v) => v, + ref other => panic!( + "Expected Operand::InitializationModeQualifier, got {} instead", + other + ), + } + } + pub fn unwrap_load_cache_control(&self) -> spirv::LoadCacheControl { + match *self { + Self::LoadCacheControl(v) => v, + ref other => panic!("Expected Operand::LoadCacheControl, got {} instead", other), + } + } + pub fn unwrap_store_cache_control(&self) -> spirv::StoreCacheControl { + match *self { + Self::StoreCacheControl(v) => v, + ref other => panic!("Expected Operand::StoreCacheControl, got {} instead", other), + } + } pub fn unwrap_id_memory_semantics(&self) -> spirv::Word { match *self { Self::IdMemorySemantics(v) => v, @@ -816,7 +922,11 @@ impl Operand { | s::SourceLanguage::OpenCL_CPP | s::SourceLanguage::HLSL | s::SourceLanguage::CPP_for_OpenCL - | s::SourceLanguage::SYCL => vec![], + | s::SourceLanguage::SYCL + | s::SourceLanguage::HERO_C + | s::SourceLanguage::NZSL + | s::SourceLanguage::WGSL + | s::SourceLanguage::Slang => vec![], }, Self::ExecutionModel(v) => match v { s::ExecutionModel::Geometry => vec![spirv::Capability::Geometry], @@ -947,6 +1057,13 @@ impl Operand { | s::ExecutionMode::DepthUnchanged | s::ExecutionMode::SubgroupUniformControlFlowKHR | s::ExecutionMode::EarlyAndLateFragmentTestsAMD => vec![spirv::Capability::Shader], + s::ExecutionMode::CoalescingAMDX + | s::ExecutionMode::MaxNodeRecursionAMDX + | s::ExecutionMode::StaticNumWorkgroupsAMDX + | s::ExecutionMode::ShaderIndexAMDX + | s::ExecutionMode::MaxNumWorkgroupsAMDX => { + vec![spirv::Capability::ShaderEnqueueAMDX] + } s::ExecutionMode::SignedZeroInfNanPreserve => { vec![spirv::Capability::SignedZeroInfNanPreserve] } @@ -972,6 +1089,15 @@ impl Operand { | s::ExecutionMode::PointMode | s::ExecutionMode::Quads | s::ExecutionMode::Isolines => vec![spirv::Capability::Tessellation], + s::ExecutionMode::NonCoherentColorAttachmentReadEXT => { + vec![spirv::Capability::TileImageColorReadAccessEXT] + } + s::ExecutionMode::NonCoherentDepthAttachmentReadEXT => { + vec![spirv::Capability::TileImageDepthReadAccessEXT] + } + s::ExecutionMode::NonCoherentStencilAttachmentReadEXT => { + vec![spirv::Capability::TileImageStencilReadAccessEXT] + } s::ExecutionMode::Xfb => vec![spirv::Capability::TransformFeedback], s::ExecutionMode::SharedLocalMemorySizeINTEL | s::ExecutionMode::NamedBarrierCountINTEL => { @@ -1009,44 +1135,37 @@ impl Operand { spirv::Capability::Shader, spirv::Capability::VectorComputeINTEL, ], + s::StorageClass::NodePayloadAMDX | s::StorageClass::NodeOutputPayloadAMDX => { + vec![spirv::Capability::ShaderEnqueueAMDX] + } s::StorageClass::HitObjectAttributeNV => { vec![spirv::Capability::ShaderInvocationReorderNV] } + s::StorageClass::TileImageEXT => { + vec![spirv::Capability::TileImageColorReadAccessEXT] + } s::StorageClass::DeviceOnlyINTEL | s::StorageClass::HostOnlyINTEL => { vec![spirv::Capability::USMStorageClassesINTEL] } }, Self::Dim(v) => match v { - s::Dim::Dim3D => vec![], + s::Dim::Dim2D | s::Dim::Dim3D => vec![], s::Dim::DimSubpassData => vec![spirv::Capability::InputAttachment], - s::Dim::Dim1D => vec![spirv::Capability::Sampled1D, spirv::Capability::Image1D], - s::Dim::DimBuffer => vec![ - spirv::Capability::SampledBuffer, - spirv::Capability::ImageBuffer, - ], - s::Dim::DimRect => { - vec![spirv::Capability::SampledRect, spirv::Capability::ImageRect] - } - s::Dim::DimCube => { - vec![spirv::Capability::Shader, spirv::Capability::ImageCubeArray] - } - s::Dim::Dim2D => vec![ - spirv::Capability::Shader, - spirv::Capability::Kernel, - spirv::Capability::ImageMSArray, - ], + s::Dim::Dim1D => vec![spirv::Capability::Sampled1D], + s::Dim::DimBuffer => vec![spirv::Capability::SampledBuffer], + s::Dim::DimRect => vec![spirv::Capability::SampledRect], + s::Dim::DimCube => vec![spirv::Capability::Shader], + s::Dim::DimTileImageDataEXT => vec![spirv::Capability::TileImageColorReadAccessEXT], }, Self::SamplerAddressingMode(v) => match v { s::SamplerAddressingMode::None | s::SamplerAddressingMode::ClampToEdge | s::SamplerAddressingMode::Clamp | s::SamplerAddressingMode::Repeat - | s::SamplerAddressingMode::RepeatMirrored => vec![spirv::Capability::Kernel], + | s::SamplerAddressingMode::RepeatMirrored => vec![], }, Self::SamplerFilterMode(v) => match v { - s::SamplerFilterMode::Nearest | s::SamplerFilterMode::Linear => { - vec![spirv::Capability::Kernel] - } + s::SamplerFilterMode::Nearest | s::SamplerFilterMode::Linear => vec![], }, Self::ImageFormat(v) => match v { s::ImageFormat::Unknown => vec![], @@ -1132,7 +1251,9 @@ impl Operand { | s::ImageChannelDataType::HalfFloat | s::ImageChannelDataType::Float | s::ImageChannelDataType::UnormInt24 - | s::ImageChannelDataType::UnormInt101010_2 => vec![spirv::Capability::Kernel], + | s::ImageChannelDataType::UnormInt101010_2 + | s::ImageChannelDataType::UnsignedIntRaw10EXT + | s::ImageChannelDataType::UnsignedIntRaw12EXT => vec![spirv::Capability::Kernel], }, Self::FPRoundingMode(v) => match v { s::FPRoundingMode::RTE @@ -1180,6 +1301,14 @@ impl Operand { | s::AccessQualifier::WriteOnly | s::AccessQualifier::ReadWrite => vec![spirv::Capability::Kernel], }, + Self::HostAccessQualifier(v) => match v { + s::HostAccessQualifier::NoneINTEL + | s::HostAccessQualifier::ReadINTEL + | s::HostAccessQualifier::WriteINTEL + | s::HostAccessQualifier::ReadWriteINTEL => { + vec![spirv::Capability::GlobalVariableHostAccessINTEL] + } + }, Self::FunctionParameterAttribute(v) => match v { s::FunctionParameterAttribute::Zext | s::FunctionParameterAttribute::Sext @@ -1220,6 +1349,9 @@ impl Operand { | s::Decoration::BindlessImageNV | s::Decoration::BoundSamplerNV | s::Decoration::BoundImageNV => vec![spirv::Capability::BindlessTextureNV], + s::Decoration::CacheControlLoadINTEL | s::Decoration::CacheControlStoreINTEL => { + vec![spirv::Capability::CacheControlsINTEL] + } s::Decoration::ConduitKernelArgumentINTEL | s::Decoration::RegisterMapKernelArgumentINTEL | s::Decoration::MMHostInterfaceAddressWidthINTEL @@ -1265,6 +1397,9 @@ impl Operand { | s::Decoration::ForcePow2DepthINTEL => { vec![spirv::Capability::FPGAMemoryAttributesINTEL] } + s::Decoration::FPMaxErrorDecorationINTEL => { + vec![spirv::Capability::FPMaxErrorINTEL] + } s::Decoration::PerVertexKHR => vec![ spirv::Capability::FragmentBarycentricNV, spirv::Capability::FragmentBarycentricKHR, @@ -1278,6 +1413,12 @@ impl Operand { vec![spirv::Capability::GeometryShaderPassthroughNV] } s::Decoration::Stream => vec![spirv::Capability::GeometryStreams], + s::Decoration::InitModeINTEL | s::Decoration::ImplementInRegisterMapINTEL => { + vec![spirv::Capability::GlobalVariableFPGADecorationsINTEL] + } + s::Decoration::HostAccessINTEL => { + vec![spirv::Capability::GlobalVariableHostAccessINTEL] + } s::Decoration::IOPipeStorageINTEL => vec![spirv::Capability::IOPipesINTEL], s::Decoration::ReferencedIndirectlyINTEL => { vec![spirv::Capability::IndirectReferencesINTEL] @@ -1332,6 +1473,10 @@ impl Operand { spirv::Capability::Shader, spirv::Capability::UniformDecoration, ], + s::Decoration::NodeSharesPayloadLimitsWithAMDX + | s::Decoration::NodeMaxPayloadsAMDX + | s::Decoration::TrackFinishWritingAMDX + | s::Decoration::PayloadNodeNameAMDX => vec![spirv::Capability::ShaderEnqueueAMDX], s::Decoration::HitObjectShaderRecordBufferNV => { vec![spirv::Capability::ShaderInvocationReorderNV] } @@ -1455,6 +1600,12 @@ impl Operand { spirv::Capability::MeshShadingNV, ], s::BuiltIn::CullMaskKHR => vec![spirv::Capability::RayCullMaskKHR], + s::BuiltIn::HitMicroTriangleVertexPositionsNV + | s::BuiltIn::HitMicroTriangleVertexBarycentricsNV + | s::BuiltIn::HitKindFrontFacingMicroTriangleNV + | s::BuiltIn::HitKindBackFacingMicroTriangleNV => { + vec![spirv::Capability::RayTracingDisplacementMicromapNV] + } s::BuiltIn::RayGeometryIndexKHR => vec![spirv::Capability::RayTracingKHR], s::BuiltIn::CurrentRayTimeNV => vec![spirv::Capability::RayTracingMotionBlurNV], s::BuiltIn::HitTNV => vec![spirv::Capability::RayTracingNV], @@ -1474,6 +1625,9 @@ impl Operand { spirv::Capability::RayTracingNV, spirv::Capability::RayTracingKHR, ], + s::BuiltIn::HitTriangleVertexPositionsKHR => { + vec![spirv::Capability::RayTracingPositionFetchKHR] + } s::BuiltIn::SampleId | s::BuiltIn::SamplePosition => { vec![spirv::Capability::SampleRateShading] } @@ -1489,6 +1643,9 @@ impl Operand { | s::BuiltIn::HelperInvocation | s::BuiltIn::VertexIndex | s::BuiltIn::InstanceIndex => vec![spirv::Capability::Shader], + s::BuiltIn::CoalescedInputCountAMDX | s::BuiltIn::ShaderIndexAMDX => { + vec![spirv::Capability::ShaderEnqueueAMDX] + } s::BuiltIn::WarpsPerSMNV | s::BuiltIn::SMCountNV | s::BuiltIn::WarpIDNV @@ -1563,6 +1720,9 @@ impl Operand { | s::Capability::ShaderViewportIndex | s::Capability::UniformDecoration | s::Capability::CoreBuiltinsARM + | s::Capability::TileImageColorReadAccessEXT + | s::Capability::TileImageDepthReadAccessEXT + | s::Capability::TileImageStencilReadAccessEXT | s::Capability::SubgroupBallotKHR | s::Capability::SubgroupVoteKHR | s::Capability::StorageBuffer16BitAccess @@ -1633,6 +1793,7 @@ impl Operand { | s::Capability::DotProductInput4x8BitPacked | s::Capability::DotProduct | s::Capability::RayCullMaskKHR + | s::Capability::CooperativeMatrixKHR | s::Capability::BitInstructions | s::Capability::AtomicFloat32AddEXT | s::Capability::AtomicFloat64AddEXT @@ -1642,9 +1803,13 @@ impl Operand { | s::Capability::DebugInfoModuleINTEL | s::Capability::BFloat16ConversionINTEL | s::Capability::SplitBarrierINTEL + | s::Capability::GlobalVariableFPGADecorationsINTEL + | s::Capability::GlobalVariableHostAccessINTEL + | s::Capability::FPMaxErrorINTEL | s::Capability::FPGALatencyControlINTEL | s::Capability::FPGAArgumentInterfacesINTEL - | s::Capability::GroupUniformArithmeticKHR => vec![], + | s::Capability::GroupUniformArithmeticKHR + | s::Capability::CacheControlsINTEL => vec![], s::Capability::GenericPointer => vec![spirv::Capability::Addresses], s::Capability::SubgroupDispatch => vec![spirv::Capability::DeviceEnqueue], s::Capability::FPGAKernelAttributesv2INTEL => { @@ -1702,7 +1867,10 @@ impl Operand { spirv::Capability::RayQueryKHR, spirv::Capability::RayTracingKHR, ], - s::Capability::ShaderInvocationReorderNV => vec![spirv::Capability::RayTracingKHR], + s::Capability::ShaderInvocationReorderNV + | s::Capability::RayTracingDisplacementMicromapNV => { + vec![spirv::Capability::RayTracingKHR] + } s::Capability::SampleMaskOverrideCoverageNV => { vec![spirv::Capability::SampleRateShading] } @@ -1757,12 +1925,14 @@ impl Operand { | s::Capability::StencilExportEXT | s::Capability::ImageReadWriteLodAMD | s::Capability::Int64ImageEXT + | s::Capability::ShaderEnqueueAMDX | s::Capability::FragmentFullyCoveredEXT | s::Capability::MeshShadingNV | s::Capability::MeshShadingEXT | s::Capability::FragmentDensityEXT | s::Capability::ShaderNonUniform | s::Capability::RuntimeDescriptorArray + | s::Capability::RayTracingPositionFetchKHR | s::Capability::RayTracingNV | s::Capability::RayTracingMotionBlurNV | s::Capability::PhysicalStorageBufferAddresses @@ -1773,6 +1943,8 @@ impl Operand { | s::Capability::ShaderSMBuiltinsNV | s::Capability::FragmentShaderPixelInterlockEXT | s::Capability::DemoteToHelperInvocation + | s::Capability::DisplacementMicromapNV + | s::Capability::RayQueryPositionFetchKHR | s::Capability::IntegerFunctions2INTEL => vec![spirv::Capability::Shader], s::Capability::UniformBufferArrayNonUniformIndexing | s::Capability::SampledImageArrayNonUniformIndexing @@ -1822,6 +1994,38 @@ impl Operand { Self::PackedVectorFormat(v) => match v { s::PackedVectorFormat::PackedVectorFormat4x8Bit => vec![], }, + Self::CooperativeMatrixLayout(v) => match v { + s::CooperativeMatrixLayout::RowMajorKHR + | s::CooperativeMatrixLayout::ColumnMajorKHR => vec![], + }, + Self::CooperativeMatrixUse(v) => match v { + s::CooperativeMatrixUse::MatrixAKHR + | s::CooperativeMatrixUse::MatrixBKHR + | s::CooperativeMatrixUse::MatrixAccumulatorKHR => vec![], + }, + Self::InitializationModeQualifier(v) => match v { + s::InitializationModeQualifier::InitOnDeviceReprogramINTEL + | s::InitializationModeQualifier::InitOnDeviceResetINTEL => { + vec![spirv::Capability::GlobalVariableFPGADecorationsINTEL] + } + }, + Self::LoadCacheControl(v) => match v { + s::LoadCacheControl::UncachedINTEL + | s::LoadCacheControl::CachedINTEL + | s::LoadCacheControl::StreamingINTEL + | s::LoadCacheControl::InvalidateAfterReadINTEL + | s::LoadCacheControl::ConstCachedINTEL => { + vec![spirv::Capability::CacheControlsINTEL] + } + }, + Self::StoreCacheControl(v) => match v { + s::StoreCacheControl::UncachedINTEL + | s::StoreCacheControl::WriteThroughINTEL + | s::StoreCacheControl::WriteBackINTEL + | s::StoreCacheControl::StreamingINTEL => { + vec![spirv::Capability::CacheControlsINTEL] + } + }, _ => vec![], } } @@ -1852,7 +2056,11 @@ impl Operand { | s::SourceLanguage::OpenCL_CPP | s::SourceLanguage::HLSL | s::SourceLanguage::CPP_for_OpenCL - | s::SourceLanguage::SYCL => vec![], + | s::SourceLanguage::SYCL + | s::SourceLanguage::HERO_C + | s::SourceLanguage::NZSL + | s::SourceLanguage::WGSL + | s::SourceLanguage::Slang => vec![], }, Self::ExecutionModel(v) => match v { s::ExecutionModel::Vertex @@ -1927,6 +2135,14 @@ impl Operand { | s::ExecutionMode::SubgroupsPerWorkgroupId | s::ExecutionMode::LocalSizeId | s::ExecutionMode::LocalSizeHintId + | s::ExecutionMode::NonCoherentColorAttachmentReadEXT + | s::ExecutionMode::NonCoherentDepthAttachmentReadEXT + | s::ExecutionMode::NonCoherentStencilAttachmentReadEXT + | s::ExecutionMode::CoalescingAMDX + | s::ExecutionMode::MaxNodeRecursionAMDX + | s::ExecutionMode::StaticNumWorkgroupsAMDX + | s::ExecutionMode::ShaderIndexAMDX + | s::ExecutionMode::MaxNumWorkgroupsAMDX | s::ExecutionMode::SharedLocalMemorySizeINTEL | s::ExecutionMode::RoundingModeRTPINTEL | s::ExecutionMode::RoundingModeRTNINTEL @@ -1993,6 +2209,9 @@ impl Operand { | s::StorageClass::PushConstant | s::StorageClass::AtomicCounter | s::StorageClass::Image + | s::StorageClass::TileImageEXT + | s::StorageClass::NodePayloadAMDX + | s::StorageClass::NodeOutputPayloadAMDX | s::StorageClass::HitObjectAttributeNV => vec![], s::StorageClass::TaskPayloadWorkgroupEXT => vec!["SPV_EXT_mesh_shader"], s::StorageClass::PhysicalStorageBuffer => vec![ @@ -2023,7 +2242,8 @@ impl Operand { | s::Dim::DimCube | s::Dim::DimRect | s::Dim::DimBuffer - | s::Dim::DimSubpassData => vec![], + | s::Dim::DimSubpassData + | s::Dim::DimTileImageDataEXT => vec![], }, Self::SamplerAddressingMode(v) => match v { s::SamplerAddressingMode::None @@ -2118,7 +2338,9 @@ impl Operand { | s::ImageChannelDataType::HalfFloat | s::ImageChannelDataType::Float | s::ImageChannelDataType::UnormInt24 - | s::ImageChannelDataType::UnormInt101010_2 => vec![], + | s::ImageChannelDataType::UnormInt101010_2 + | s::ImageChannelDataType::UnsignedIntRaw10EXT + | s::ImageChannelDataType::UnsignedIntRaw12EXT => vec![], }, Self::FPRoundingMode(v) => match v { s::FPRoundingMode::RTE @@ -2157,6 +2379,12 @@ impl Operand { | s::AccessQualifier::WriteOnly | s::AccessQualifier::ReadWrite => vec![], }, + Self::HostAccessQualifier(v) => match v { + s::HostAccessQualifier::NoneINTEL + | s::HostAccessQualifier::ReadINTEL + | s::HostAccessQualifier::WriteINTEL + | s::HostAccessQualifier::ReadWriteINTEL => vec![], + }, Self::FunctionParameterAttribute(v) => match v { s::FunctionParameterAttribute::Zext | s::FunctionParameterAttribute::Sext @@ -2216,6 +2444,10 @@ impl Operand { | s::Decoration::MaxByteOffset | s::Decoration::AlignmentId | s::Decoration::MaxByteOffsetId + | s::Decoration::NodeSharesPayloadLimitsWithAMDX + | s::Decoration::NodeMaxPayloadsAMDX + | s::Decoration::TrackFinishWritingAMDX + | s::Decoration::PayloadNodeNameAMDX | s::Decoration::ViewportRelativeNV | s::Decoration::NonUniform | s::Decoration::HitObjectShaderRecordBufferNV @@ -2253,6 +2485,10 @@ impl Operand { | s::Decoration::SingleElementVectorINTEL | s::Decoration::VectorComputeCallableFunctionINTEL | s::Decoration::MediaBlockIOINTEL + | s::Decoration::InitModeINTEL + | s::Decoration::ImplementInRegisterMapINTEL + | s::Decoration::HostAccessINTEL + | s::Decoration::FPMaxErrorDecorationINTEL | s::Decoration::LatencyControlLabelINTEL | s::Decoration::LatencyControlConstraintINTEL | s::Decoration::ConduitKernelArgumentINTEL @@ -2263,7 +2499,9 @@ impl Operand { | s::Decoration::MMHostInterfaceReadWriteModeINTEL | s::Decoration::MMHostInterfaceMaxBurstINTEL | s::Decoration::MMHostInterfaceWaitRequestINTEL - | s::Decoration::StableKernelArgumentINTEL => vec![], + | s::Decoration::StableKernelArgumentINTEL + | s::Decoration::CacheControlLoadINTEL + | s::Decoration::CacheControlStoreINTEL => vec![], s::Decoration::ExplicitInterpAMD => { vec!["SPV_AMD_shader_explicit_vertex_parameter"] } @@ -2354,7 +2592,14 @@ impl Operand { | s::BuiltIn::SubgroupGeMask | s::BuiltIn::SubgroupGtMask | s::BuiltIn::SubgroupLeMask - | s::BuiltIn::SubgroupLtMask => vec![], + | s::BuiltIn::SubgroupLtMask + | s::BuiltIn::CoalescedInputCountAMDX + | s::BuiltIn::ShaderIndexAMDX + | s::BuiltIn::HitTriangleVertexPositionsKHR + | s::BuiltIn::HitMicroTriangleVertexPositionsNV + | s::BuiltIn::HitMicroTriangleVertexBarycentricsNV + | s::BuiltIn::HitKindFrontFacingMicroTriangleNV + | s::BuiltIn::HitKindBackFacingMicroTriangleNV => vec![], s::BuiltIn::BaryCoordNoPerspAMD | s::BuiltIn::BaryCoordNoPerspCentroidAMD | s::BuiltIn::BaryCoordNoPerspSampleAMD @@ -2544,6 +2789,7 @@ impl Operand { | s::Capability::DotProductInput4x8Bit | s::Capability::DotProductInput4x8BitPacked | s::Capability::DotProduct => vec![], + s::Capability::ShaderEnqueueAMDX => vec!["SPV_AMDX_shader_enqueue"], s::Capability::Float16ImageAMD => vec!["SPV_AMD_gpu_shader_half_float_fetch"], s::Capability::Groups => vec!["SPV_AMD_shader_ballot"], s::Capability::FragmentMaskAMD => vec!["SPV_AMD_shader_fragment_mask"], @@ -2576,6 +2822,9 @@ impl Operand { } s::Capability::Int64ImageEXT => vec!["SPV_EXT_shader_image_int64"], s::Capability::StencilExportEXT => vec!["SPV_EXT_shader_stencil_export"], + s::Capability::TileImageColorReadAccessEXT + | s::Capability::TileImageDepthReadAccessEXT + | s::Capability::TileImageStencilReadAccessEXT => vec!["SPV_EXT_shader_tile_image"], s::Capability::ShaderViewportIndexLayerEXT => { vec!["SPV_EXT_shader_viewport_index_layer"] } @@ -2590,6 +2839,7 @@ impl Operand { } s::Capability::BFloat16ConversionINTEL => vec!["SPV_INTEL_bfloat16_conversion"], s::Capability::BlockingPipesINTEL => vec!["SPV_INTEL_blocking_pipes"], + s::Capability::CacheControlsINTEL => vec!["SPV_INTEL_cache_controls"], s::Capability::DebugInfoModuleINTEL => vec!["SPV_INTEL_debug_module"], s::Capability::SubgroupAvcMotionEstimationINTEL | s::Capability::SubgroupAvcMotionEstimationIntraINTEL @@ -2600,6 +2850,7 @@ impl Operand { | s::Capability::FloatingPointModeINTEL | s::Capability::FunctionFloatControlINTEL => vec!["SPV_INTEL_float_controls2"], s::Capability::FPFastMathModeINTEL => vec!["SPV_INTEL_fp_fast_math_mode"], + s::Capability::FPMaxErrorINTEL => vec!["SPV_INTEL_fp_max_error"], s::Capability::FPGAArgumentInterfacesINTEL => { vec!["SPV_INTEL_fpga_argument_interfaces"] } @@ -2621,6 +2872,12 @@ impl Operand { s::Capability::FunctionPointersINTEL | s::Capability::IndirectReferencesINTEL => { vec!["SPV_INTEL_function_pointers"] } + s::Capability::GlobalVariableFPGADecorationsINTEL => { + vec!["SPV_INTEL_global_variable_fpga_decorations"] + } + s::Capability::GlobalVariableHostAccessINTEL => { + vec!["SPV_INTEL_global_variable_host_access"] + } s::Capability::AsmINTEL => vec!["SPV_INTEL_inline_assembly"], s::Capability::IOPipesINTEL => vec!["SPV_INTEL_io_pipes"], s::Capability::KernelAttributesINTEL @@ -2659,6 +2916,7 @@ impl Operand { | s::Capability::UniformAndStorageBuffer8BitAccess | s::Capability::StoragePushConstant8 => vec!["SPV_KHR_8bit_storage"], s::Capability::BitInstructions => vec!["SPV_KHR_bit_instructions"], + s::Capability::CooperativeMatrixKHR => vec!["SPV_KHR_cooperative_matrix"], s::Capability::DeviceGroup => vec!["SPV_KHR_device_group"], s::Capability::ExpectAssumeKHR => vec!["SPV_KHR_expect_assume"], s::Capability::DenormPreserve @@ -2679,6 +2937,10 @@ impl Operand { s::Capability::RayTracingKHR | s::Capability::RayTracingProvisionalKHR => { vec!["SPV_KHR_ray_tracing"] } + s::Capability::RayTracingPositionFetchKHR + | s::Capability::RayQueryPositionFetchKHR => { + vec!["SPV_KHR_ray_tracing_position_fetch"] + } s::Capability::AtomicStorageOps => vec!["SPV_KHR_shader_atomic_counter_ops"], s::Capability::SubgroupBallotKHR => vec!["SPV_KHR_shader_ballot"], s::Capability::ShaderClockKHR => vec!["SPV_KHR_shader_clock"], @@ -2703,6 +2965,10 @@ impl Operand { vec!["SPV_NV_compute_shader_derivatives"] } s::Capability::CooperativeMatrixNV => vec!["SPV_NV_cooperative_matrix"], + s::Capability::DisplacementMicromapNV + | s::Capability::RayTracingDisplacementMicromapNV => { + vec!["SPV_NV_displacement_micromap"] + } s::Capability::FragmentBarycentricKHR => vec![ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric", @@ -2750,6 +3016,32 @@ impl Operand { Self::PackedVectorFormat(v) => match v { s::PackedVectorFormat::PackedVectorFormat4x8Bit => vec![], }, + Self::CooperativeMatrixLayout(v) => match v { + s::CooperativeMatrixLayout::RowMajorKHR + | s::CooperativeMatrixLayout::ColumnMajorKHR => vec![], + }, + Self::CooperativeMatrixUse(v) => match v { + s::CooperativeMatrixUse::MatrixAKHR + | s::CooperativeMatrixUse::MatrixBKHR + | s::CooperativeMatrixUse::MatrixAccumulatorKHR => vec![], + }, + Self::InitializationModeQualifier(v) => match v { + s::InitializationModeQualifier::InitOnDeviceReprogramINTEL + | s::InitializationModeQualifier::InitOnDeviceResetINTEL => vec![], + }, + Self::LoadCacheControl(v) => match v { + s::LoadCacheControl::UncachedINTEL + | s::LoadCacheControl::CachedINTEL + | s::LoadCacheControl::StreamingINTEL + | s::LoadCacheControl::InvalidateAfterReadINTEL + | s::LoadCacheControl::ConstCachedINTEL => vec![], + }, + Self::StoreCacheControl(v) => match v { + s::StoreCacheControl::UncachedINTEL + | s::StoreCacheControl::WriteThroughINTEL + | s::StoreCacheControl::WriteBackINTEL + | s::StoreCacheControl::StreamingINTEL => vec![], + }, _ => vec![], } } @@ -2900,6 +3192,14 @@ impl Operand { result } Self::ExecutionMode(v) => match v { + s::ExecutionMode::MaxNodeRecursionAMDX => vec![crate::grammar::LogicalOperand { + kind: crate::grammar::OperandKind::IdRef, + quantifier: crate::grammar::OperandQuantifier::One, + }], + s::ExecutionMode::ShaderIndexAMDX => vec![crate::grammar::LogicalOperand { + kind: crate::grammar::OperandKind::IdRef, + quantifier: crate::grammar::OperandQuantifier::One, + }], s::ExecutionMode::SubgroupsPerWorkgroupId => vec![crate::grammar::LogicalOperand { kind: crate::grammar::OperandKind::IdRef, quantifier: crate::grammar::OperandQuantifier::One, @@ -2918,7 +3218,9 @@ impl Operand { quantifier: crate::grammar::OperandQuantifier::One, }, ], - s::ExecutionMode::LocalSizeId => vec![ + s::ExecutionMode::LocalSizeId + | s::ExecutionMode::StaticNumWorkgroupsAMDX + | s::ExecutionMode::MaxNumWorkgroupsAMDX => vec![ crate::grammar::LogicalOperand { kind: crate::grammar::OperandKind::IdRef, quantifier: crate::grammar::OperandQuantifier::One, @@ -3057,6 +3359,16 @@ impl Operand { kind: crate::grammar::OperandKind::FunctionParameterAttribute, quantifier: crate::grammar::OperandQuantifier::One, }], + s::Decoration::HostAccessINTEL => vec![ + crate::grammar::LogicalOperand { + kind: crate::grammar::OperandKind::HostAccessQualifier, + quantifier: crate::grammar::OperandQuantifier::One, + }, + crate::grammar::LogicalOperand { + kind: crate::grammar::OperandKind::LiteralString, + quantifier: crate::grammar::OperandQuantifier::One, + }, + ], s::Decoration::AliasScopeINTEL | s::Decoration::NoAliasINTEL => { vec![crate::grammar::LogicalOperand { kind: crate::grammar::OperandKind::IdRef, @@ -3075,10 +3387,28 @@ impl Operand { kind: crate::grammar::OperandKind::IdRef, quantifier: crate::grammar::OperandQuantifier::One, }], + s::Decoration::NodeMaxPayloadsAMDX => vec![crate::grammar::LogicalOperand { + kind: crate::grammar::OperandKind::IdRef, + quantifier: crate::grammar::OperandQuantifier::One, + }], + s::Decoration::NodeSharesPayloadLimitsWithAMDX => { + vec![crate::grammar::LogicalOperand { + kind: crate::grammar::OperandKind::IdRef, + quantifier: crate::grammar::OperandQuantifier::One, + }] + } s::Decoration::UniformId => vec![crate::grammar::LogicalOperand { kind: crate::grammar::OperandKind::IdScope, quantifier: crate::grammar::OperandQuantifier::One, }], + s::Decoration::InitModeINTEL => vec![crate::grammar::LogicalOperand { + kind: crate::grammar::OperandKind::InitializationModeQualifier, + quantifier: crate::grammar::OperandQuantifier::One, + }], + s::Decoration::FPMaxErrorDecorationINTEL => vec![crate::grammar::LogicalOperand { + kind: crate::grammar::OperandKind::LiteralFloat, + quantifier: crate::grammar::OperandQuantifier::One, + }], s::Decoration::MMHostInterfaceAddressWidthINTEL => { vec![crate::grammar::LogicalOperand { kind: crate::grammar::OperandKind::LiteralInteger, @@ -3121,6 +3451,26 @@ impl Operand { kind: crate::grammar::OperandKind::LiteralInteger, quantifier: crate::grammar::OperandQuantifier::One, }], + s::Decoration::CacheControlLoadINTEL => vec![ + crate::grammar::LogicalOperand { + kind: crate::grammar::OperandKind::LiteralInteger, + quantifier: crate::grammar::OperandQuantifier::One, + }, + crate::grammar::LogicalOperand { + kind: crate::grammar::OperandKind::LoadCacheControl, + quantifier: crate::grammar::OperandQuantifier::One, + }, + ], + s::Decoration::CacheControlStoreINTEL => vec![ + crate::grammar::LogicalOperand { + kind: crate::grammar::OperandKind::LiteralInteger, + quantifier: crate::grammar::OperandQuantifier::One, + }, + crate::grammar::LogicalOperand { + kind: crate::grammar::OperandKind::StoreCacheControl, + quantifier: crate::grammar::OperandQuantifier::One, + }, + ], s::Decoration::CacheSizeINTEL => vec![crate::grammar::LogicalOperand { kind: crate::grammar::OperandKind::LiteralInteger, quantifier: crate::grammar::OperandQuantifier::One, @@ -3294,6 +3644,12 @@ impl Operand { kind: crate::grammar::OperandKind::LiteralInteger, quantifier: crate::grammar::OperandQuantifier::One, }], + s::Decoration::ImplementInRegisterMapINTEL => { + vec![crate::grammar::LogicalOperand { + kind: crate::grammar::OperandKind::LiteralInteger, + quantifier: crate::grammar::OperandQuantifier::One, + }] + } s::Decoration::MemoryINTEL => vec![crate::grammar::LogicalOperand { kind: crate::grammar::OperandKind::LiteralString, quantifier: crate::grammar::OperandQuantifier::One, @@ -3318,6 +3674,10 @@ impl Operand { quantifier: crate::grammar::OperandQuantifier::One, }, ], + s::Decoration::PayloadNodeNameAMDX => vec![crate::grammar::LogicalOperand { + kind: crate::grammar::OperandKind::LiteralString, + quantifier: crate::grammar::OperandQuantifier::One, + }], s::Decoration::ClobberINTEL => vec![crate::grammar::LogicalOperand { kind: crate::grammar::OperandKind::LiteralString, quantifier: crate::grammar::OperandQuantifier::One, diff --git a/rspirv/dr/build/autogen_norm_insts.rs b/rspirv/dr/build/autogen_norm_insts.rs index 537ea11c..09c96e0a 100644 --- a/rspirv/dr/build/autogen_norm_insts.rs +++ b/rspirv/dr/build/autogen_norm_insts.rs @@ -12147,6 +12147,137 @@ impl Builder { self.insert_into_block(insert_point, inst)?; Ok(_id) } + #[doc = "Appends an OpColorAttachmentReadEXT instruction to the current block."] + pub fn color_attachment_read_ext( + &mut self, + result_type: spirv::Word, + result_id: Option, + attachment: spirv::Word, + sample: Option, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::ColorAttachmentReadEXT, + Some(result_type), + Some(_id), + vec![dr::Operand::IdRef(attachment)], + ); + if let Some(v) = sample { + inst.operands.push(dr::Operand::IdRef(v)); + } + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpColorAttachmentReadEXT instruction to the current block."] + pub fn insert_color_attachment_read_ext( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + attachment: spirv::Word, + sample: Option, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::ColorAttachmentReadEXT, + Some(result_type), + Some(_id), + vec![dr::Operand::IdRef(attachment)], + ); + if let Some(v) = sample { + inst.operands.push(dr::Operand::IdRef(v)); + } + self.insert_into_block(insert_point, inst)?; + Ok(_id) + } + #[doc = "Appends an OpDepthAttachmentReadEXT instruction to the current block."] + pub fn depth_attachment_read_ext( + &mut self, + result_type: spirv::Word, + result_id: Option, + sample: Option, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::DepthAttachmentReadEXT, + Some(result_type), + Some(_id), + vec![], + ); + if let Some(v) = sample { + inst.operands.push(dr::Operand::IdRef(v)); + } + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpDepthAttachmentReadEXT instruction to the current block."] + pub fn insert_depth_attachment_read_ext( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + sample: Option, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::DepthAttachmentReadEXT, + Some(result_type), + Some(_id), + vec![], + ); + if let Some(v) = sample { + inst.operands.push(dr::Operand::IdRef(v)); + } + self.insert_into_block(insert_point, inst)?; + Ok(_id) + } + #[doc = "Appends an OpStencilAttachmentReadEXT instruction to the current block."] + pub fn stencil_attachment_read_ext( + &mut self, + result_type: spirv::Word, + result_id: Option, + sample: Option, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::StencilAttachmentReadEXT, + Some(result_type), + Some(_id), + vec![], + ); + if let Some(v) = sample { + inst.operands.push(dr::Operand::IdRef(v)); + } + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpStencilAttachmentReadEXT instruction to the current block."] + pub fn insert_stencil_attachment_read_ext( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + sample: Option, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::StencilAttachmentReadEXT, + Some(result_type), + Some(_id), + vec![], + ); + if let Some(v) = sample { + inst.operands.push(dr::Operand::IdRef(v)); + } + self.insert_into_block(insert_point, inst)?; + Ok(_id) + } #[doc = "Appends an OpSubgroupBallotKHR instruction to the current block."] pub fn subgroup_ballot_khr( &mut self, @@ -13203,6 +13334,230 @@ impl Builder { self.insert_into_block(insert_point, inst)?; Ok(_id) } + #[doc = "Appends an OpCooperativeMatrixLoadKHR instruction to the current block."] + pub fn cooperative_matrix_load_khr( + &mut self, + result_type: spirv::Word, + result_id: Option, + pointer: spirv::Word, + memory_layout: spirv::Word, + stride: Option, + memory_operand: Option, + additional_params: impl IntoIterator, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::CooperativeMatrixLoadKHR, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(pointer), + dr::Operand::IdRef(memory_layout), + ], + ); + if let Some(v) = stride { + inst.operands.push(dr::Operand::IdRef(v)); + } + if let Some(v) = memory_operand { + inst.operands.push(dr::Operand::MemoryAccess(v)); + } + inst.operands.extend(additional_params); + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpCooperativeMatrixLoadKHR instruction to the current block."] + pub fn insert_cooperative_matrix_load_khr( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + pointer: spirv::Word, + memory_layout: spirv::Word, + stride: Option, + memory_operand: Option, + additional_params: impl IntoIterator, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::CooperativeMatrixLoadKHR, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(pointer), + dr::Operand::IdRef(memory_layout), + ], + ); + if let Some(v) = stride { + inst.operands.push(dr::Operand::IdRef(v)); + } + if let Some(v) = memory_operand { + inst.operands.push(dr::Operand::MemoryAccess(v)); + } + inst.operands.extend(additional_params); + self.insert_into_block(insert_point, inst)?; + Ok(_id) + } + #[doc = "Appends an OpCooperativeMatrixStoreKHR instruction to the current block."] + pub fn cooperative_matrix_store_khr( + &mut self, + pointer: spirv::Word, + object: spirv::Word, + memory_layout: spirv::Word, + stride: Option, + memory_operand: Option, + additional_params: impl IntoIterator, + ) -> BuildResult<()> { + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::CooperativeMatrixStoreKHR, + None, + None, + vec![ + dr::Operand::IdRef(pointer), + dr::Operand::IdRef(object), + dr::Operand::IdRef(memory_layout), + ], + ); + if let Some(v) = stride { + inst.operands.push(dr::Operand::IdRef(v)); + } + if let Some(v) = memory_operand { + inst.operands.push(dr::Operand::MemoryAccess(v)); + } + inst.operands.extend(additional_params); + self.insert_into_block(InsertPoint::End, inst)?; + Ok(()) + } + #[doc = "Appends an OpCooperativeMatrixStoreKHR instruction to the current block."] + pub fn insert_cooperative_matrix_store_khr( + &mut self, + insert_point: InsertPoint, + pointer: spirv::Word, + object: spirv::Word, + memory_layout: spirv::Word, + stride: Option, + memory_operand: Option, + additional_params: impl IntoIterator, + ) -> BuildResult<()> { + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::CooperativeMatrixStoreKHR, + None, + None, + vec![ + dr::Operand::IdRef(pointer), + dr::Operand::IdRef(object), + dr::Operand::IdRef(memory_layout), + ], + ); + if let Some(v) = stride { + inst.operands.push(dr::Operand::IdRef(v)); + } + if let Some(v) = memory_operand { + inst.operands.push(dr::Operand::MemoryAccess(v)); + } + inst.operands.extend(additional_params); + self.insert_into_block(insert_point, inst)?; + Ok(()) + } + #[doc = "Appends an OpCooperativeMatrixMulAddKHR instruction to the current block."] + pub fn cooperative_matrix_mul_add_khr( + &mut self, + result_type: spirv::Word, + result_id: Option, + a: spirv::Word, + b: spirv::Word, + c: spirv::Word, + cooperative_matrix_operands: Option, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::CooperativeMatrixMulAddKHR, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(a), + dr::Operand::IdRef(b), + dr::Operand::IdRef(c), + ], + ); + if let Some(v) = cooperative_matrix_operands { + inst.operands + .push(dr::Operand::CooperativeMatrixOperands(v)); + } + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpCooperativeMatrixMulAddKHR instruction to the current block."] + pub fn insert_cooperative_matrix_mul_add_khr( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + a: spirv::Word, + b: spirv::Word, + c: spirv::Word, + cooperative_matrix_operands: Option, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::CooperativeMatrixMulAddKHR, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(a), + dr::Operand::IdRef(b), + dr::Operand::IdRef(c), + ], + ); + if let Some(v) = cooperative_matrix_operands { + inst.operands + .push(dr::Operand::CooperativeMatrixOperands(v)); + } + self.insert_into_block(insert_point, inst)?; + Ok(_id) + } + #[doc = "Appends an OpCooperativeMatrixLengthKHR instruction to the current block."] + pub fn cooperative_matrix_length_khr( + &mut self, + result_type: spirv::Word, + result_id: Option, + ty: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::CooperativeMatrixLengthKHR, + Some(result_type), + Some(_id), + vec![dr::Operand::IdRef(ty)], + ); + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpCooperativeMatrixLengthKHR instruction to the current block."] + pub fn insert_cooperative_matrix_length_khr( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + ty: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::CooperativeMatrixLengthKHR, + Some(result_type), + Some(_id), + vec![dr::Operand::IdRef(ty)], + ); + self.insert_into_block(insert_point, inst)?; + Ok(_id) + } #[doc = "Appends an OpRayQueryInitializeKHR instruction to the current block."] pub fn ray_query_initialize_khr( &mut self, @@ -14169,6 +14524,118 @@ impl Builder { self.insert_into_block(insert_point, inst)?; Ok(_id) } + #[doc = "Appends an OpFinalizeNodePayloadsAMDX instruction to the current block."] + pub fn finalize_node_payloads_amdx(&mut self, payload_array: spirv::Word) -> BuildResult<()> { + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::FinalizeNodePayloadsAMDX, + None, + None, + vec![dr::Operand::IdRef(payload_array)], + ); + self.insert_into_block(InsertPoint::End, inst)?; + Ok(()) + } + #[doc = "Appends an OpFinalizeNodePayloadsAMDX instruction to the current block."] + pub fn insert_finalize_node_payloads_amdx( + &mut self, + insert_point: InsertPoint, + payload_array: spirv::Word, + ) -> BuildResult<()> { + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::FinalizeNodePayloadsAMDX, + None, + None, + vec![dr::Operand::IdRef(payload_array)], + ); + self.insert_into_block(insert_point, inst)?; + Ok(()) + } + #[doc = "Appends an OpFinishWritingNodePayloadAMDX instruction to the current block."] + pub fn finish_writing_node_payload_amdx( + &mut self, + result_type: spirv::Word, + result_id: Option, + payload: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::FinishWritingNodePayloadAMDX, + Some(result_type), + Some(_id), + vec![dr::Operand::IdRef(payload)], + ); + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpFinishWritingNodePayloadAMDX instruction to the current block."] + pub fn insert_finish_writing_node_payload_amdx( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + payload: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::FinishWritingNodePayloadAMDX, + Some(result_type), + Some(_id), + vec![dr::Operand::IdRef(payload)], + ); + self.insert_into_block(insert_point, inst)?; + Ok(_id) + } + #[doc = "Appends an OpInitializeNodePayloadsAMDX instruction to the current block."] + pub fn initialize_node_payloads_amdx( + &mut self, + payload_array: spirv::Word, + visibility: spirv::Word, + payload_count: spirv::Word, + node_index: spirv::Word, + ) -> BuildResult<()> { + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::InitializeNodePayloadsAMDX, + None, + None, + vec![ + dr::Operand::IdRef(payload_array), + dr::Operand::IdScope(visibility), + dr::Operand::IdRef(payload_count), + dr::Operand::IdRef(node_index), + ], + ); + self.insert_into_block(InsertPoint::End, inst)?; + Ok(()) + } + #[doc = "Appends an OpInitializeNodePayloadsAMDX instruction to the current block."] + pub fn insert_initialize_node_payloads_amdx( + &mut self, + insert_point: InsertPoint, + payload_array: spirv::Word, + visibility: spirv::Word, + payload_count: spirv::Word, + node_index: spirv::Word, + ) -> BuildResult<()> { + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::InitializeNodePayloadsAMDX, + None, + None, + vec![ + dr::Operand::IdRef(payload_array), + dr::Operand::IdScope(visibility), + dr::Operand::IdRef(payload_count), + dr::Operand::IdRef(node_index), + ], + ); + self.insert_into_block(insert_point, inst)?; + Ok(()) + } #[doc = "Appends an OpHitObjectRecordHitMotionNV instruction to the current block."] pub fn hit_object_record_hit_motion_nv( &mut self, @@ -15840,6 +16307,120 @@ impl Builder { self.insert_into_block(insert_point, inst)?; Ok(()) } + #[doc = "Appends an OpFetchMicroTriangleVertexPositionNV instruction to the current block."] + pub fn fetch_micro_triangle_vertex_position_nv( + &mut self, + result_type: spirv::Word, + result_id: Option, + accel: spirv::Word, + instance_id: spirv::Word, + geometry_index: spirv::Word, + primitive_index: spirv::Word, + barycentric: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::FetchMicroTriangleVertexPositionNV, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(accel), + dr::Operand::IdRef(instance_id), + dr::Operand::IdRef(geometry_index), + dr::Operand::IdRef(primitive_index), + dr::Operand::IdRef(barycentric), + ], + ); + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpFetchMicroTriangleVertexPositionNV instruction to the current block."] + pub fn insert_fetch_micro_triangle_vertex_position_nv( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + accel: spirv::Word, + instance_id: spirv::Word, + geometry_index: spirv::Word, + primitive_index: spirv::Word, + barycentric: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::FetchMicroTriangleVertexPositionNV, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(accel), + dr::Operand::IdRef(instance_id), + dr::Operand::IdRef(geometry_index), + dr::Operand::IdRef(primitive_index), + dr::Operand::IdRef(barycentric), + ], + ); + self.insert_into_block(insert_point, inst)?; + Ok(_id) + } + #[doc = "Appends an OpFetchMicroTriangleVertexBarycentricNV instruction to the current block."] + pub fn fetch_micro_triangle_vertex_barycentric_nv( + &mut self, + result_type: spirv::Word, + result_id: Option, + accel: spirv::Word, + instance_id: spirv::Word, + geometry_index: spirv::Word, + primitive_index: spirv::Word, + barycentric: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::FetchMicroTriangleVertexBarycentricNV, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(accel), + dr::Operand::IdRef(instance_id), + dr::Operand::IdRef(geometry_index), + dr::Operand::IdRef(primitive_index), + dr::Operand::IdRef(barycentric), + ], + ); + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpFetchMicroTriangleVertexBarycentricNV instruction to the current block."] + pub fn insert_fetch_micro_triangle_vertex_barycentric_nv( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + accel: spirv::Word, + instance_id: spirv::Word, + geometry_index: spirv::Word, + primitive_index: spirv::Word, + barycentric: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::FetchMicroTriangleVertexBarycentricNV, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(accel), + dr::Operand::IdRef(instance_id), + dr::Operand::IdRef(geometry_index), + dr::Operand::IdRef(primitive_index), + dr::Operand::IdRef(barycentric), + ], + ); + self.insert_into_block(insert_point, inst)?; + Ok(_id) + } #[doc = "Appends an OpReportIntersectionKHR instruction to the current block."] pub fn report_intersection_khr( &mut self, @@ -16179,6 +16760,51 @@ impl Builder { self.insert_into_block(insert_point, inst)?; Ok(()) } + #[doc = "Appends an OpRayQueryGetIntersectionTriangleVertexPositionsKHR instruction to the current block."] + pub fn ray_query_get_intersection_triangle_vertex_positions_khr( + &mut self, + result_type: spirv::Word, + result_id: Option, + ray_query: spirv::Word, + intersection: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::RayQueryGetIntersectionTriangleVertexPositionsKHR, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(ray_query), + dr::Operand::IdRef(intersection), + ], + ); + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpRayQueryGetIntersectionTriangleVertexPositionsKHR instruction to the current block."] + pub fn insert_ray_query_get_intersection_triangle_vertex_positions_khr( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + ray_query: spirv::Word, + intersection: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::RayQueryGetIntersectionTriangleVertexPositionsKHR, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(ray_query), + dr::Operand::IdRef(intersection), + ], + ); + self.insert_into_block(insert_point, inst)?; + Ok(_id) + } #[doc = "Appends an OpExecuteCallableNV instruction to the current block."] pub fn execute_callable_nv( &mut self, diff --git a/rspirv/dr/build/autogen_type.rs b/rspirv/dr/build/autogen_type.rs index 80ca081b..c60b1d93 100644 --- a/rspirv/dr/build/autogen_type.rs +++ b/rspirv/dr/build/autogen_type.rs @@ -546,6 +546,51 @@ impl Builder { new_id } } + #[doc = "Appends an OpTypeCooperativeMatrixKHR instruction and returns the result id, or return the existing id if the instruction was already present."] + pub fn type_cooperative_matrix_khr( + &mut self, + component_type: spirv::Word, + scope: spirv::Word, + rows: spirv::Word, + columns: spirv::Word, + usage: spirv::Word, + ) -> spirv::Word { + self.type_cooperative_matrix_khr_id(None, component_type, scope, rows, columns, usage) + } + #[doc = "Appends an OpTypeCooperativeMatrixKHR instruction and returns the result id, or return the existing id if the instruction was already present."] + pub fn type_cooperative_matrix_khr_id( + &mut self, + result_id: Option, + component_type: spirv::Word, + scope: spirv::Word, + rows: spirv::Word, + columns: spirv::Word, + usage: spirv::Word, + ) -> spirv::Word { + let mut inst = dr::Instruction::new( + spirv::Op::TypeCooperativeMatrixKHR, + None, + result_id, + vec![ + dr::Operand::IdRef(component_type), + dr::Operand::IdScope(scope), + dr::Operand::IdRef(rows), + dr::Operand::IdRef(columns), + dr::Operand::IdRef(usage), + ], + ); + if let Some(result_id) = result_id { + self.module.types_global_values.push(inst); + result_id + } else if let Some(id) = self.dedup_insert_type(&inst) { + id + } else { + let new_id = self.id(); + inst.result_id = Some(new_id); + self.module.types_global_values.push(inst); + new_id + } + } #[doc = "Appends an OpTypeRayQueryKHR instruction and returns the result id, or return the existing id if the instruction was already present."] pub fn type_ray_query_khr(&mut self) -> spirv::Word { self.type_ray_query_khr_id(None) diff --git a/rspirv/grammar/autogen_table.rs b/rspirv/grammar/autogen_table.rs index e74b1047..5f491f80 100644 --- a/rspirv/grammar/autogen_table.rs +++ b/rspirv/grammar/autogen_table.rs @@ -35,6 +35,7 @@ pub enum OperandKind { OverflowModes, LinkageType, AccessQualifier, + HostAccessQualifier, FunctionParameterAttribute, Decoration, BuiltIn, @@ -46,6 +47,12 @@ pub enum OperandKind { RayQueryCommittedIntersectionType, RayQueryCandidateIntersectionType, PackedVectorFormat, + CooperativeMatrixOperands, + CooperativeMatrixLayout, + CooperativeMatrixUse, + InitializationModeQualifier, + LoadCacheControl, + StoreCacheControl, IdResultType, IdResult, IdMemorySemantics, @@ -53,6 +60,7 @@ pub enum OperandKind { IdRef, LiteralInteger, LiteralString, + LiteralFloat, LiteralContextDependentNumber, LiteralExtInstInteger, LiteralSpecConstantOpInteger, @@ -3223,6 +3231,29 @@ static INSTRUCTION_TABLE: &[Instruction<'static>] = &[ (IdRef, One) ] ), + inst!( + ColorAttachmentReadEXT, + [TileImageColorReadAccessEXT], + [], + [ + (IdResultType, One), + (IdResult, One), + (IdRef, One), + (IdRef, ZeroOrOne) + ] + ), + inst!( + DepthAttachmentReadEXT, + [TileImageDepthReadAccessEXT], + [], + [(IdResultType, One), (IdResult, One), (IdRef, ZeroOrOne)] + ), + inst!( + StencilAttachmentReadEXT, + [TileImageStencilReadAccessEXT], + [], + [(IdResultType, One), (IdResult, One), (IdRef, ZeroOrOne)] + ), inst!( TerminateInvocation, [Shader], @@ -3475,6 +3506,63 @@ static INSTRUCTION_TABLE: &[Instruction<'static>] = &[ (PackedVectorFormat, ZeroOrOne) ] ), + inst!( + TypeCooperativeMatrixKHR, + [CooperativeMatrixKHR], + [], + [ + (IdResult, One), + (IdRef, One), + (IdScope, One), + (IdRef, One), + (IdRef, One), + (IdRef, One) + ] + ), + inst!( + CooperativeMatrixLoadKHR, + [CooperativeMatrixKHR], + [], + [ + (IdResultType, One), + (IdResult, One), + (IdRef, One), + (IdRef, One), + (IdRef, ZeroOrOne), + (MemoryAccess, ZeroOrOne) + ] + ), + inst!( + CooperativeMatrixStoreKHR, + [CooperativeMatrixKHR], + [], + [ + (IdRef, One), + (IdRef, One), + (IdRef, One), + (IdRef, ZeroOrOne), + (MemoryAccess, ZeroOrOne) + ] + ), + inst!( + CooperativeMatrixMulAddKHR, + [CooperativeMatrixKHR], + [], + [ + (IdResultType, One), + (IdResult, One), + (IdRef, One), + (IdRef, One), + (IdRef, One), + (CooperativeMatrixOperands, ZeroOrOne) + ] + ), + inst!( + CooperativeMatrixLengthKHR, + [CooperativeMatrixKHR], + [], + [(IdResultType, One), (IdResult, One), (IdRef, One)] + ), inst!( TypeRayQueryKHR, [RayQueryKHR], @@ -3708,6 +3796,24 @@ static INSTRUCTION_TABLE: &[Instruction<'static>] = &[ [], [(IdResultType, One), (IdResult, One), (IdScope, One)] ), + inst!( + FinalizeNodePayloadsAMDX, + [ShaderEnqueueAMDX], + [], + [(IdRef, One)] + ), + inst!( + FinishWritingNodePayloadAMDX, + [ShaderEnqueueAMDX], + [], + [(IdResultType, One), (IdResult, One), (IdRef, One)] + ), + inst!( + InitializeNodePayloadsAMDX, + [ShaderEnqueueAMDX], + [], + [(IdRef, One), (IdScope, One), (IdRef, One), (IdRef, One)] + ), inst!( HitObjectRecordHitMotionNV, [ShaderInvocationReorderNV, RayTracingMotionBlurNV], @@ -4042,6 +4148,34 @@ static INSTRUCTION_TABLE: &[Instruction<'static>] = &[ ["SPV_NV_mesh_shader"], [(IdRef, One), (IdRef, One)] ), + inst!( + FetchMicroTriangleVertexPositionNV, + [DisplacementMicromapNV], + [], + [ + (IdResultType, One), + (IdResult, One), + (IdRef, One), + (IdRef, One), + (IdRef, One), + (IdRef, One), + (IdRef, One) + ] + ), + inst!( + FetchMicroTriangleVertexBarycentricNV, + [DisplacementMicromapNV], + [], + [ + (IdResultType, One), + (IdResult, One), + (IdRef, One), + (IdRef, One), + (IdRef, One), + (IdRef, One), + (IdRef, One) + ] + ), inst!( ReportIntersectionKHR, [RayTracingNV, RayTracingKHR], @@ -4127,6 +4261,17 @@ static INSTRUCTION_TABLE: &[Instruction<'static>] = &[ (IdRef, One) ] ), + inst!( + RayQueryGetIntersectionTriangleVertexPositionsKHR, + [RayQueryPositionFetchKHR], + [], + [ + (IdResultType, One), + (IdResult, One), + (IdRef, One), + (IdRef, One) + ] + ), inst!( TypeAccelerationStructureKHR, [RayTracingNV, RayTracingKHR, RayQueryKHR], diff --git a/rspirv/lift/autogen_context.rs b/rspirv/lift/autogen_context.rs index 1eca2c20..045d7e29 100644 --- a/rspirv/lift/autogen_context.rs +++ b/rspirv/lift/autogen_context.rs @@ -5221,6 +5221,33 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, }), + 4160u32 => Ok(ops::Op::ColorAttachmentReadEXT { + attachment: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + sample: match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }, + }), + 4161u32 => Ok(ops::Op::DepthAttachmentReadEXT { + sample: match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }, + }), + 4162u32 => Ok(ops::Op::StencilAttachmentReadEXT { + sample: match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }, + }), 4421u32 => Ok(ops::Op::SubgroupBallotKHR { predicate: (match operands.next() { Some(dr::Operand::IdRef(value)) => Some(*value), @@ -5522,6 +5549,93 @@ impl LiftContext { None => None, }, }), + 4457u32 => Ok(ops::Op::CooperativeMatrixLoadKHR { + pointer: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + memory_layout: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + stride: match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }, + memory_operand: match operands.next() { + Some(dr::Operand::MemoryAccess(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }, + }), + 4458u32 => Ok(ops::Op::CooperativeMatrixStoreKHR { + pointer: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + object: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + memory_layout: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + stride: match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }, + memory_operand: match operands.next() { + Some(dr::Operand::MemoryAccess(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }, + }), + 4459u32 => Ok(ops::Op::CooperativeMatrixMulAddKHR { + a: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + b: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + c: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + cooperative_matrix_operands: match operands.next() { + Some(dr::Operand::CooperativeMatrixOperands(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }, + }), + 4460u32 => Ok(ops::Op::CooperativeMatrixLengthKHR { + ty: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(self.types.lookup_token(*value)), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + }), 4473u32 => Ok(ops::Op::RayQueryInitializeKHR { ray_query: (match operands.next() { Some(dr::Operand::IdRef(value)) => Some(*value), @@ -5930,6 +6044,48 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, }), + 5075u32 => Ok(ops::Op::FinalizeNodePayloadsAMDX { + payload_array: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + }), + 5078u32 => Ok(ops::Op::FinishWritingNodePayloadAMDX { + payload: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + }), + 5090u32 => Ok(ops::Op::InitializeNodePayloadsAMDX { + payload_array: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + visibility: (match operands.next() { + Some(dr::Operand::IdScope(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + payload_count: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + node_index: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + }), 5249u32 => Ok(ops::Op::HitObjectRecordHitMotionNV { hit_object: (match operands.next() { Some(dr::Operand::IdRef(value)) => Some(*value), @@ -6781,6 +6937,70 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, }), + 5300u32 => Ok(ops::Op::FetchMicroTriangleVertexPositionNV { + accel: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + instance_id: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + geometry_index: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + primitive_index: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + barycentric: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + }), + 5301u32 => Ok(ops::Op::FetchMicroTriangleVertexBarycentricNV { + accel: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + instance_id: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + geometry_index: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + primitive_index: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + barycentric: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + }), 5334u32 => Ok(ops::Op::ReportIntersectionKHR { hit: (match operands.next() { Some(dr::Operand::IdRef(value)) => Some(*value), @@ -7013,6 +7233,20 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, }), + 5340u32 => Ok(ops::Op::RayQueryGetIntersectionTriangleVertexPositionsKHR { + ray_query: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + intersection: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + }), 5344u32 => Ok(ops::Op::ExecuteCallableNV { sbt_index: (match operands.next() { Some(dr::Operand::IdRef(value)) => Some(*value), @@ -12262,6 +12496,38 @@ impl LiftContext { }), 322u32 => Ok(Type::PipeStorage), 327u32 => Ok(Type::NamedBarrier), + 4456u32 => Ok(Type::CooperativeMatrixKHR { + component_type: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(self.types.lookup_token(*value)), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + scope: (match operands.next() { + Some(dr::Operand::IdScope(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + rows: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + columns: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + usage: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + }), 4472u32 => Ok(Type::RayQueryKHR), 5281u32 => Ok(Type::HitObjectNV), 5341u32 => Ok(Type::AccelerationStructureKHR), diff --git a/rspirv/sr/autogen_decoration.rs b/rspirv/sr/autogen_decoration.rs index 460fdcf9..92a2fd27 100644 --- a/rspirv/sr/autogen_decoration.rs +++ b/rspirv/sr/autogen_decoration.rs @@ -58,6 +58,10 @@ pub enum Decoration { WeightTextureQCOM, BlockMatchTextureQCOM, ExplicitInterpAMD, + NodeSharesPayloadLimitsWithAMDX(spirv::Word), + NodeMaxPayloadsAMDX(spirv::Word), + TrackFinishWritingAMDX, + PayloadNodeNameAMDX(String), OverrideCoverageNV, PassthroughNV, ViewportRelativeNV, @@ -125,6 +129,10 @@ pub enum Decoration { SingleElementVectorINTEL, VectorComputeCallableFunctionINTEL, MediaBlockIOINTEL, + InitModeINTEL(spirv::InitializationModeQualifier), + ImplementInRegisterMapINTEL(u32), + HostAccessINTEL(spirv::HostAccessQualifier, String), + FPMaxErrorDecorationINTEL(u32), LatencyControlLabelINTEL(u32), LatencyControlConstraintINTEL(u32, u32, u32), ConduitKernelArgumentINTEL, @@ -136,4 +144,6 @@ pub enum Decoration { MMHostInterfaceMaxBurstINTEL(u32), MMHostInterfaceWaitRequestINTEL(u32), StableKernelArgumentINTEL, + CacheControlLoadINTEL(u32, spirv::LoadCacheControl), + CacheControlStoreINTEL(u32, spirv::StoreCacheControl), } diff --git a/rspirv/sr/autogen_ops.rs b/rspirv/sr/autogen_ops.rs index 11458c42..2188fb86 100644 --- a/rspirv/sr/autogen_ops.rs +++ b/rspirv/sr/autogen_ops.rs @@ -1333,6 +1333,16 @@ pub enum Op { operand_1: spirv::Word, operand_2: spirv::Word, }, + ColorAttachmentReadEXT { + attachment: spirv::Word, + sample: Option, + }, + DepthAttachmentReadEXT { + sample: Option, + }, + StencilAttachmentReadEXT { + sample: Option, + }, SubgroupBallotKHR { predicate: spirv::Word, }, @@ -1411,6 +1421,28 @@ pub enum Op { accumulator: spirv::Word, packed_vector_format: Option, }, + CooperativeMatrixLoadKHR { + pointer: spirv::Word, + memory_layout: spirv::Word, + stride: Option, + memory_operand: Option, + }, + CooperativeMatrixStoreKHR { + pointer: spirv::Word, + object: spirv::Word, + memory_layout: spirv::Word, + stride: Option, + memory_operand: Option, + }, + CooperativeMatrixMulAddKHR { + a: spirv::Word, + b: spirv::Word, + c: spirv::Word, + cooperative_matrix_operands: Option, + }, + CooperativeMatrixLengthKHR { + ty: Token, + }, RayQueryInitializeKHR { ray_query: spirv::Word, accel: spirv::Word, @@ -1514,6 +1546,18 @@ pub enum Op { ReadClockKHR { scope: spirv::Word, }, + FinalizeNodePayloadsAMDX { + payload_array: spirv::Word, + }, + FinishWritingNodePayloadAMDX { + payload: spirv::Word, + }, + InitializeNodePayloadsAMDX { + payload_array: spirv::Word, + visibility: spirv::Word, + payload_count: spirv::Word, + node_index: spirv::Word, + }, HitObjectRecordHitMotionNV { hit_object: spirv::Word, acceleration_structure: spirv::Word, @@ -1715,6 +1759,20 @@ pub enum Op { index_offset: spirv::Word, packed_indices: spirv::Word, }, + FetchMicroTriangleVertexPositionNV { + accel: spirv::Word, + instance_id: spirv::Word, + geometry_index: spirv::Word, + primitive_index: spirv::Word, + barycentric: spirv::Word, + }, + FetchMicroTriangleVertexBarycentricNV { + accel: spirv::Word, + instance_id: spirv::Word, + geometry_index: spirv::Word, + primitive_index: spirv::Word, + barycentric: spirv::Word, + }, ReportIntersectionKHR { hit: spirv::Word, hit_kind: spirv::Word, @@ -1762,6 +1820,10 @@ pub enum Op { time: spirv::Word, payload: spirv::Word, }, + RayQueryGetIntersectionTriangleVertexPositionsKHR { + ray_query: spirv::Word, + intersection: spirv::Word, + }, ExecuteCallableNV { sbt_index: spirv::Word, callable_data_id: spirv::Word, diff --git a/rspirv/sr/autogen_types.rs b/rspirv/sr/autogen_types.rs index 339ed0c4..5ebf7c17 100644 --- a/rspirv/sr/autogen_types.rs +++ b/rspirv/sr/autogen_types.rs @@ -70,6 +70,13 @@ pub enum Type { }, PipeStorage, NamedBarrier, + CooperativeMatrixKHR { + component_type: Token, + scope: spirv::Word, + rows: spirv::Word, + columns: spirv::Word, + usage: spirv::Word, + }, RayQueryKHR, HitObjectNV, AccelerationStructureKHR, diff --git a/spirv/Cargo.toml b/spirv/Cargo.toml index 3c0a2fe9..129b6b54 100644 --- a/spirv/Cargo.toml +++ b/spirv/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "spirv" -version = "0.2.0+sdk-1.3.243.0" +version = "0.2.0+sdk-1.3.268.0" authors = ["Lei Zhang "] edition = "2018" diff --git a/spirv/autogen_spirv.rs b/spirv/autogen_spirv.rs index 52b8fcff..b0d4c7b4 100644 --- a/spirv/autogen_spirv.rs +++ b/spirv/autogen_spirv.rs @@ -32,11 +32,15 @@ pub enum SourceLanguage { HLSL = 5u32, CPP_for_OpenCL = 6u32, SYCL = 7u32, + HERO_C = 8u32, + NZSL = 9u32, + WGSL = 10u32, + Slang = 11u32, } impl SourceLanguage { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=7u32 => unsafe { core::mem::transmute::(n) }, + 0u32..=11u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } @@ -55,6 +59,10 @@ impl core::str::FromStr for SourceLanguage { "HLSL" => Ok(Self::HLSL), "CPP_for_OpenCL" => Ok(Self::CPP_for_OpenCL), "SYCL" => Ok(Self::SYCL), + "HERO_C" => Ok(Self::HERO_C), + "NZSL" => Ok(Self::NZSL), + "WGSL" => Ok(Self::WGSL), + "Slang" => Ok(Self::Slang), _ => Err(()), } } @@ -255,6 +263,9 @@ pub enum ExecutionMode { SubgroupsPerWorkgroupId = 37u32, LocalSizeId = 38u32, LocalSizeHintId = 39u32, + NonCoherentColorAttachmentReadEXT = 4169u32, + NonCoherentDepthAttachmentReadEXT = 4170u32, + NonCoherentStencilAttachmentReadEXT = 4171u32, SubgroupUniformControlFlowKHR = 4421u32, PostDepthCoverage = 4446u32, DenormPreserve = 4459u32, @@ -264,6 +275,11 @@ pub enum ExecutionMode { RoundingModeRTZ = 4463u32, EarlyAndLateFragmentTestsAMD = 5017u32, StencilRefReplacingEXT = 5027u32, + CoalescingAMDX = 5069u32, + MaxNodeRecursionAMDX = 5071u32, + StaticNumWorkgroupsAMDX = 5072u32, + ShaderIndexAMDX = 5073u32, + MaxNumWorkgroupsAMDX = 5077u32, StencilRefUnchangedFrontAMD = 5079u32, StencilRefGreaterFrontAMD = 5080u32, StencilRefLessFrontAMD = 5081u32, @@ -301,11 +317,15 @@ impl ExecutionMode { 0u32..=12u32 => unsafe { core::mem::transmute::(n) }, 14u32..=31u32 => unsafe { core::mem::transmute::(n) }, 33u32..=39u32 => unsafe { core::mem::transmute::(n) }, + 4169u32..=4171u32 => unsafe { core::mem::transmute::(n) }, 4421u32 => unsafe { core::mem::transmute::(4421u32) }, 4446u32 => unsafe { core::mem::transmute::(4446u32) }, 4459u32..=4463u32 => unsafe { core::mem::transmute::(n) }, 5017u32 => unsafe { core::mem::transmute::(5017u32) }, 5027u32 => unsafe { core::mem::transmute::(5027u32) }, + 5069u32 => unsafe { core::mem::transmute::(5069u32) }, + 5071u32..=5073u32 => unsafe { core::mem::transmute::(n) }, + 5077u32 => unsafe { core::mem::transmute::(5077u32) }, 5079u32..=5084u32 => unsafe { core::mem::transmute::(n) }, 5269u32..=5270u32 => unsafe { core::mem::transmute::(n) }, 5289u32..=5290u32 => unsafe { core::mem::transmute::(n) }, @@ -370,6 +390,9 @@ impl core::str::FromStr for ExecutionMode { "SubgroupsPerWorkgroupId" => Ok(Self::SubgroupsPerWorkgroupId), "LocalSizeId" => Ok(Self::LocalSizeId), "LocalSizeHintId" => Ok(Self::LocalSizeHintId), + "NonCoherentColorAttachmentReadEXT" => Ok(Self::NonCoherentColorAttachmentReadEXT), + "NonCoherentDepthAttachmentReadEXT" => Ok(Self::NonCoherentDepthAttachmentReadEXT), + "NonCoherentStencilAttachmentReadEXT" => Ok(Self::NonCoherentStencilAttachmentReadEXT), "SubgroupUniformControlFlowKHR" => Ok(Self::SubgroupUniformControlFlowKHR), "PostDepthCoverage" => Ok(Self::PostDepthCoverage), "DenormPreserve" => Ok(Self::DenormPreserve), @@ -379,6 +402,11 @@ impl core::str::FromStr for ExecutionMode { "RoundingModeRTZ" => Ok(Self::RoundingModeRTZ), "EarlyAndLateFragmentTestsAMD" => Ok(Self::EarlyAndLateFragmentTestsAMD), "StencilRefReplacingEXT" => Ok(Self::StencilRefReplacingEXT), + "CoalescingAMDX" => Ok(Self::CoalescingAMDX), + "MaxNodeRecursionAMDX" => Ok(Self::MaxNodeRecursionAMDX), + "StaticNumWorkgroupsAMDX" => Ok(Self::StaticNumWorkgroupsAMDX), + "ShaderIndexAMDX" => Ok(Self::ShaderIndexAMDX), + "MaxNumWorkgroupsAMDX" => Ok(Self::MaxNumWorkgroupsAMDX), "StencilRefUnchangedFrontAMD" => Ok(Self::StencilRefUnchangedFrontAMD), "StencilRefGreaterFrontAMD" => Ok(Self::StencilRefGreaterFrontAMD), "StencilRefLessFrontAMD" => Ok(Self::StencilRefLessFrontAMD), @@ -436,6 +464,9 @@ pub enum StorageClass { AtomicCounter = 10u32, Image = 11u32, StorageBuffer = 12u32, + TileImageEXT = 4172u32, + NodePayloadAMDX = 5068u32, + NodeOutputPayloadAMDX = 5076u32, CallableDataNV = 5328u32, IncomingCallableDataNV = 5329u32, RayPayloadNV = 5338u32, @@ -453,6 +484,9 @@ impl StorageClass { pub fn from_u32(n: u32) -> Option { Some(match n { 0u32..=12u32 => unsafe { core::mem::transmute::(n) }, + 4172u32 => unsafe { core::mem::transmute::(4172u32) }, + 5068u32 => unsafe { core::mem::transmute::(5068u32) }, + 5076u32 => unsafe { core::mem::transmute::(5076u32) }, 5328u32..=5329u32 => unsafe { core::mem::transmute::(n) }, 5338u32..=5339u32 => unsafe { core::mem::transmute::(n) }, 5342u32..=5343u32 => unsafe { core::mem::transmute::(n) }, @@ -492,6 +526,9 @@ impl core::str::FromStr for StorageClass { "AtomicCounter" => Ok(Self::AtomicCounter), "Image" => Ok(Self::Image), "StorageBuffer" => Ok(Self::StorageBuffer), + "TileImageEXT" => Ok(Self::TileImageEXT), + "NodePayloadAMDX" => Ok(Self::NodePayloadAMDX), + "NodeOutputPayloadAMDX" => Ok(Self::NodeOutputPayloadAMDX), "CallableDataNV" => Ok(Self::CallableDataNV), "CallableDataKHR" => Ok(Self::CallableDataNV), "IncomingCallableDataNV" => Ok(Self::IncomingCallableDataNV), @@ -529,11 +566,13 @@ pub enum Dim { DimRect = 4u32, DimBuffer = 5u32, DimSubpassData = 6u32, + DimTileImageDataEXT = 4173u32, } impl Dim { pub fn from_u32(n: u32) -> Option { Some(match n { 0u32..=6u32 => unsafe { core::mem::transmute::(n) }, + 4173u32 => unsafe { core::mem::transmute::(4173u32) }, _ => return None, }) } @@ -551,6 +590,7 @@ impl core::str::FromStr for Dim { "DimRect" => Ok(Self::DimRect), "DimBuffer" => Ok(Self::DimBuffer), "DimSubpassData" => Ok(Self::DimSubpassData), + "DimTileImageDataEXT" => Ok(Self::DimTileImageDataEXT), _ => Err(()), } } @@ -821,11 +861,14 @@ pub enum ImageChannelDataType { Float = 14u32, UnormInt24 = 15u32, UnormInt101010_2 = 16u32, + UnsignedIntRaw10EXT = 19u32, + UnsignedIntRaw12EXT = 20u32, } impl ImageChannelDataType { pub fn from_u32(n: u32) -> Option { Some(match n { 0u32..=16u32 => unsafe { core::mem::transmute::(n) }, + 19u32..=20u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } @@ -853,6 +896,8 @@ impl core::str::FromStr for ImageChannelDataType { "Float" => Ok(Self::Float), "UnormInt24" => Ok(Self::UnormInt24), "UnormInt101010_2" => Ok(Self::UnormInt101010_2), + "UnsignedIntRaw10EXT" => Ok(Self::UnsignedIntRaw10EXT), + "UnsignedIntRaw12EXT" => Ok(Self::UnsignedIntRaw12EXT), _ => Err(()), } } @@ -1091,6 +1136,40 @@ impl core::str::FromStr for AccessQualifier { } } } +#[doc = "SPIR-V operand kind: [HostAccessQualifier](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_host_access_qualifier_a_host_access_qualifier)"] +#[repr(u32)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[cfg_attr(feature = "serialize", derive(serde::Serialize))] +#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] +#[allow(clippy::upper_case_acronyms)] +pub enum HostAccessQualifier { + NoneINTEL = 0u32, + ReadINTEL = 1u32, + WriteINTEL = 2u32, + ReadWriteINTEL = 3u32, +} +impl HostAccessQualifier { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=3u32 => unsafe { core::mem::transmute::(n) }, + _ => return None, + }) + } +} +#[allow(non_upper_case_globals)] +impl HostAccessQualifier {} +impl core::str::FromStr for HostAccessQualifier { + type Err = (); + fn from_str(s: &str) -> Result { + match s { + "NoneINTEL" => Ok(Self::NoneINTEL), + "ReadINTEL" => Ok(Self::ReadINTEL), + "WriteINTEL" => Ok(Self::WriteINTEL), + "ReadWriteINTEL" => Ok(Self::ReadWriteINTEL), + _ => Err(()), + } + } +} #[doc = "SPIR-V operand kind: [FunctionParameterAttribute](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_function_parameter_attribute_a_function_parameter_attribute)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] @@ -1195,6 +1274,10 @@ pub enum Decoration { WeightTextureQCOM = 4487u32, BlockMatchTextureQCOM = 4488u32, ExplicitInterpAMD = 4999u32, + NodeSharesPayloadLimitsWithAMDX = 5019u32, + NodeMaxPayloadsAMDX = 5020u32, + TrackFinishWritingAMDX = 5078u32, + PayloadNodeNameAMDX = 5091u32, OverrideCoverageNV = 5248u32, PassthroughNV = 5250u32, ViewportRelativeNV = 5252u32, @@ -1255,6 +1338,10 @@ pub enum Decoration { SingleElementVectorINTEL = 6085u32, VectorComputeCallableFunctionINTEL = 6087u32, MediaBlockIOINTEL = 6140u32, + InitModeINTEL = 6147u32, + ImplementInRegisterMapINTEL = 6148u32, + HostAccessINTEL = 6168u32, + FPMaxErrorDecorationINTEL = 6170u32, LatencyControlLabelINTEL = 6172u32, LatencyControlConstraintINTEL = 6173u32, ConduitKernelArgumentINTEL = 6175u32, @@ -1266,6 +1353,8 @@ pub enum Decoration { MMHostInterfaceMaxBurstINTEL = 6181u32, MMHostInterfaceWaitRequestINTEL = 6182u32, StableKernelArgumentINTEL = 6183u32, + CacheControlLoadINTEL = 6442u32, + CacheControlStoreINTEL = 6443u32, } impl Decoration { pub fn from_u32(n: u32) -> Option { @@ -1275,6 +1364,9 @@ impl Decoration { 4469u32..=4470u32 => unsafe { core::mem::transmute::(n) }, 4487u32..=4488u32 => unsafe { core::mem::transmute::(n) }, 4999u32 => unsafe { core::mem::transmute::(4999u32) }, + 5019u32..=5020u32 => unsafe { core::mem::transmute::(n) }, + 5078u32 => unsafe { core::mem::transmute::(5078u32) }, + 5091u32 => unsafe { core::mem::transmute::(5091u32) }, 5248u32 => unsafe { core::mem::transmute::(5248u32) }, 5250u32 => unsafe { core::mem::transmute::(5250u32) }, 5252u32 => unsafe { core::mem::transmute::(5252u32) }, @@ -1304,8 +1396,12 @@ impl Decoration { 6085u32 => unsafe { core::mem::transmute::(6085u32) }, 6087u32 => unsafe { core::mem::transmute::(6087u32) }, 6140u32 => unsafe { core::mem::transmute::(6140u32) }, + 6147u32..=6148u32 => unsafe { core::mem::transmute::(n) }, + 6168u32 => unsafe { core::mem::transmute::(6168u32) }, + 6170u32 => unsafe { core::mem::transmute::(6170u32) }, 6172u32..=6173u32 => unsafe { core::mem::transmute::(n) }, 6175u32..=6183u32 => unsafe { core::mem::transmute::(n) }, + 6442u32..=6443u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } @@ -1376,6 +1472,10 @@ impl core::str::FromStr for Decoration { "WeightTextureQCOM" => Ok(Self::WeightTextureQCOM), "BlockMatchTextureQCOM" => Ok(Self::BlockMatchTextureQCOM), "ExplicitInterpAMD" => Ok(Self::ExplicitInterpAMD), + "NodeSharesPayloadLimitsWithAMDX" => Ok(Self::NodeSharesPayloadLimitsWithAMDX), + "NodeMaxPayloadsAMDX" => Ok(Self::NodeMaxPayloadsAMDX), + "TrackFinishWritingAMDX" => Ok(Self::TrackFinishWritingAMDX), + "PayloadNodeNameAMDX" => Ok(Self::PayloadNodeNameAMDX), "OverrideCoverageNV" => Ok(Self::OverrideCoverageNV), "PassthroughNV" => Ok(Self::PassthroughNV), "ViewportRelativeNV" => Ok(Self::ViewportRelativeNV), @@ -1443,6 +1543,10 @@ impl core::str::FromStr for Decoration { "SingleElementVectorINTEL" => Ok(Self::SingleElementVectorINTEL), "VectorComputeCallableFunctionINTEL" => Ok(Self::VectorComputeCallableFunctionINTEL), "MediaBlockIOINTEL" => Ok(Self::MediaBlockIOINTEL), + "InitModeINTEL" => Ok(Self::InitModeINTEL), + "ImplementInRegisterMapINTEL" => Ok(Self::ImplementInRegisterMapINTEL), + "HostAccessINTEL" => Ok(Self::HostAccessINTEL), + "FPMaxErrorDecorationINTEL" => Ok(Self::FPMaxErrorDecorationINTEL), "LatencyControlLabelINTEL" => Ok(Self::LatencyControlLabelINTEL), "LatencyControlConstraintINTEL" => Ok(Self::LatencyControlConstraintINTEL), "ConduitKernelArgumentINTEL" => Ok(Self::ConduitKernelArgumentINTEL), @@ -1454,6 +1558,8 @@ impl core::str::FromStr for Decoration { "MMHostInterfaceMaxBurstINTEL" => Ok(Self::MMHostInterfaceMaxBurstINTEL), "MMHostInterfaceWaitRequestINTEL" => Ok(Self::MMHostInterfaceWaitRequestINTEL), "StableKernelArgumentINTEL" => Ok(Self::StableKernelArgumentINTEL), + "CacheControlLoadINTEL" => Ok(Self::CacheControlLoadINTEL), + "CacheControlStoreINTEL" => Ok(Self::CacheControlStoreINTEL), _ => Err(()), } } @@ -1531,6 +1637,8 @@ pub enum BuiltIn { BaryCoordSmoothSampleAMD = 4997u32, BaryCoordPullModelAMD = 4998u32, FragStencilRefEXT = 5014u32, + CoalescedInputCountAMDX = 5021u32, + ShaderIndexAMDX = 5073u32, ViewportMaskNV = 5253u32, SecondaryPositionNV = 5257u32, SecondaryViewportMaskNV = 5258u32, @@ -1567,12 +1675,17 @@ pub enum BuiltIn { HitTNV = 5332u32, HitKindNV = 5333u32, CurrentRayTimeNV = 5334u32, + HitTriangleVertexPositionsKHR = 5335u32, + HitMicroTriangleVertexPositionsNV = 5337u32, + HitMicroTriangleVertexBarycentricsNV = 5344u32, IncomingRayFlagsNV = 5351u32, RayGeometryIndexKHR = 5352u32, WarpsPerSMNV = 5374u32, SMCountNV = 5375u32, WarpIDNV = 5376u32, SMIDNV = 5377u32, + HitKindFrontFacingMicroTriangleNV = 5405u32, + HitKindBackFacingMicroTriangleNV = 5406u32, CullMaskKHR = 6021u32, } impl BuiltIn { @@ -1591,6 +1704,8 @@ impl BuiltIn { 4444u32 => unsafe { core::mem::transmute::(4444u32) }, 4992u32..=4998u32 => unsafe { core::mem::transmute::(n) }, 5014u32 => unsafe { core::mem::transmute::(5014u32) }, + 5021u32 => unsafe { core::mem::transmute::(5021u32) }, + 5073u32 => unsafe { core::mem::transmute::(5073u32) }, 5253u32 => unsafe { core::mem::transmute::(5253u32) }, 5257u32..=5258u32 => unsafe { core::mem::transmute::(n) }, 5261u32..=5262u32 => unsafe { core::mem::transmute::(n) }, @@ -1600,9 +1715,12 @@ impl BuiltIn { 5292u32..=5296u32 => unsafe { core::mem::transmute::(n) }, 5299u32 => unsafe { core::mem::transmute::(5299u32) }, 5319u32..=5327u32 => unsafe { core::mem::transmute::(n) }, - 5330u32..=5334u32 => unsafe { core::mem::transmute::(n) }, + 5330u32..=5335u32 => unsafe { core::mem::transmute::(n) }, + 5337u32 => unsafe { core::mem::transmute::(5337u32) }, + 5344u32 => unsafe { core::mem::transmute::(5344u32) }, 5351u32..=5352u32 => unsafe { core::mem::transmute::(n) }, 5374u32..=5377u32 => unsafe { core::mem::transmute::(n) }, + 5405u32..=5406u32 => unsafe { core::mem::transmute::(n) }, 6021u32 => unsafe { core::mem::transmute::(6021u32) }, _ => return None, }) @@ -1708,6 +1826,8 @@ impl core::str::FromStr for BuiltIn { "BaryCoordSmoothSampleAMD" => Ok(Self::BaryCoordSmoothSampleAMD), "BaryCoordPullModelAMD" => Ok(Self::BaryCoordPullModelAMD), "FragStencilRefEXT" => Ok(Self::FragStencilRefEXT), + "CoalescedInputCountAMDX" => Ok(Self::CoalescedInputCountAMDX), + "ShaderIndexAMDX" => Ok(Self::ShaderIndexAMDX), "ViewportMaskNV" => Ok(Self::ViewportMaskNV), "SecondaryPositionNV" => Ok(Self::SecondaryPositionNV), "SecondaryViewportMaskNV" => Ok(Self::SecondaryViewportMaskNV), @@ -1760,6 +1880,11 @@ impl core::str::FromStr for BuiltIn { "HitKindNV" => Ok(Self::HitKindNV), "HitKindKHR" => Ok(Self::HitKindNV), "CurrentRayTimeNV" => Ok(Self::CurrentRayTimeNV), + "HitTriangleVertexPositionsKHR" => Ok(Self::HitTriangleVertexPositionsKHR), + "HitMicroTriangleVertexPositionsNV" => Ok(Self::HitMicroTriangleVertexPositionsNV), + "HitMicroTriangleVertexBarycentricsNV" => { + Ok(Self::HitMicroTriangleVertexBarycentricsNV) + } "IncomingRayFlagsNV" => Ok(Self::IncomingRayFlagsNV), "IncomingRayFlagsKHR" => Ok(Self::IncomingRayFlagsNV), "RayGeometryIndexKHR" => Ok(Self::RayGeometryIndexKHR), @@ -1767,6 +1892,8 @@ impl core::str::FromStr for BuiltIn { "SMCountNV" => Ok(Self::SMCountNV), "WarpIDNV" => Ok(Self::WarpIDNV), "SMIDNV" => Ok(Self::SMIDNV), + "HitKindFrontFacingMicroTriangleNV" => Ok(Self::HitKindFrontFacingMicroTriangleNV), + "HitKindBackFacingMicroTriangleNV" => Ok(Self::HitKindBackFacingMicroTriangleNV), "CullMaskKHR" => Ok(Self::CullMaskKHR), _ => Err(()), } @@ -1966,6 +2093,9 @@ pub enum Capability { ShaderViewportIndex = 70u32, UniformDecoration = 71u32, CoreBuiltinsARM = 4165u32, + TileImageColorReadAccessEXT = 4166u32, + TileImageDepthReadAccessEXT = 4167u32, + TileImageStencilReadAccessEXT = 4168u32, FragmentShadingRateKHR = 4422u32, SubgroupBallotKHR = 4423u32, DrawParameters = 4427u32, @@ -2005,6 +2135,7 @@ pub enum Capability { ImageReadWriteLodAMD = 5015u32, Int64ImageEXT = 5016u32, ShaderClockKHR = 5055u32, + ShaderEnqueueAMDX = 5067u32, SampleMaskOverrideCoverageNV = 5249u32, GeometryShaderPassthroughNV = 5251u32, ShaderViewportIndexLayerEXT = 5254u32, @@ -2031,6 +2162,7 @@ pub enum Capability { InputAttachmentArrayNonUniformIndexing = 5310u32, UniformTexelBufferArrayNonUniformIndexing = 5311u32, StorageTexelBufferArrayNonUniformIndexing = 5312u32, + RayTracingPositionFetchKHR = 5336u32, RayTracingNV = 5340u32, RayTracingMotionBlurNV = 5341u32, VulkanMemoryModel = 5345u32, @@ -2044,9 +2176,12 @@ pub enum Capability { ShaderSMBuiltinsNV = 5373u32, FragmentShaderPixelInterlockEXT = 5378u32, DemoteToHelperInvocation = 5379u32, + DisplacementMicromapNV = 5380u32, RayTracingOpacityMicromapEXT = 5381u32, ShaderInvocationReorderNV = 5383u32, BindlessTextureNV = 5390u32, + RayQueryPositionFetchKHR = 5391u32, + RayTracingDisplacementMicromapNV = 5409u32, SubgroupShuffleINTEL = 5568u32, SubgroupBufferBlockIOINTEL = 5569u32, SubgroupImageBlockIOINTEL = 5570u32, @@ -2094,6 +2229,7 @@ pub enum Capability { DotProductInput4x8BitPacked = 6018u32, DotProduct = 6019u32, RayCullMaskKHR = 6020u32, + CooperativeMatrixKHR = 6022u32, BitInstructions = 6025u32, GroupNonUniformRotateKHR = 6026u32, AtomicFloat32AddEXT = 6033u32, @@ -2104,10 +2240,14 @@ pub enum Capability { DebugInfoModuleINTEL = 6114u32, BFloat16ConversionINTEL = 6115u32, SplitBarrierINTEL = 6141u32, + GlobalVariableFPGADecorationsINTEL = 6146u32, FPGAKernelAttributesv2INTEL = 6161u32, + GlobalVariableHostAccessINTEL = 6167u32, + FPMaxErrorINTEL = 6169u32, FPGALatencyControlINTEL = 6171u32, FPGAArgumentInterfacesINTEL = 6174u32, GroupUniformArithmeticKHR = 6400u32, + CacheControlsINTEL = 6441u32, } impl Capability { pub fn from_u32(n: u32) -> Option { @@ -2115,7 +2255,7 @@ impl Capability { 0u32..=15u32 => unsafe { core::mem::transmute::(n) }, 17u32..=25u32 => unsafe { core::mem::transmute::(n) }, 27u32..=71u32 => unsafe { core::mem::transmute::(n) }, - 4165u32 => unsafe { core::mem::transmute::(4165u32) }, + 4165u32..=4168u32 => unsafe { core::mem::transmute::(n) }, 4422u32..=4423u32 => unsafe { core::mem::transmute::(n) }, 4427u32..=4431u32 => unsafe { core::mem::transmute::(n) }, 4433u32..=4437u32 => unsafe { core::mem::transmute::(n) }, @@ -2131,6 +2271,7 @@ impl Capability { 5013u32 => unsafe { core::mem::transmute::(5013u32) }, 5015u32..=5016u32 => unsafe { core::mem::transmute::(n) }, 5055u32 => unsafe { core::mem::transmute::(5055u32) }, + 5067u32 => unsafe { core::mem::transmute::(5067u32) }, 5249u32 => unsafe { core::mem::transmute::(5249u32) }, 5251u32 => unsafe { core::mem::transmute::(5251u32) }, 5254u32..=5255u32 => unsafe { core::mem::transmute::(n) }, @@ -2141,6 +2282,7 @@ impl Capability { 5291u32 => unsafe { core::mem::transmute::(5291u32) }, 5297u32 => unsafe { core::mem::transmute::(5297u32) }, 5301u32..=5312u32 => unsafe { core::mem::transmute::(n) }, + 5336u32 => unsafe { core::mem::transmute::(5336u32) }, 5340u32..=5341u32 => unsafe { core::mem::transmute::(n) }, 5345u32..=5347u32 => unsafe { core::mem::transmute::(n) }, 5350u32 => unsafe { core::mem::transmute::(5350u32) }, @@ -2148,10 +2290,10 @@ impl Capability { 5357u32 => unsafe { core::mem::transmute::(5357u32) }, 5363u32 => unsafe { core::mem::transmute::(5363u32) }, 5372u32..=5373u32 => unsafe { core::mem::transmute::(n) }, - 5378u32..=5379u32 => unsafe { core::mem::transmute::(n) }, - 5381u32 => unsafe { core::mem::transmute::(5381u32) }, + 5378u32..=5381u32 => unsafe { core::mem::transmute::(n) }, 5383u32 => unsafe { core::mem::transmute::(5383u32) }, - 5390u32 => unsafe { core::mem::transmute::(5390u32) }, + 5390u32..=5391u32 => unsafe { core::mem::transmute::(n) }, + 5409u32 => unsafe { core::mem::transmute::(5409u32) }, 5568u32..=5570u32 => unsafe { core::mem::transmute::(n) }, 5579u32 => unsafe { core::mem::transmute::(5579u32) }, 5582u32..=5584u32 => unsafe { core::mem::transmute::(n) }, @@ -2184,16 +2326,21 @@ impl Capability { 5945u32 => unsafe { core::mem::transmute::(5945u32) }, 5948u32 => unsafe { core::mem::transmute::(5948u32) }, 6016u32..=6020u32 => unsafe { core::mem::transmute::(n) }, + 6022u32 => unsafe { core::mem::transmute::(6022u32) }, 6025u32..=6026u32 => unsafe { core::mem::transmute::(n) }, 6033u32..=6034u32 => unsafe { core::mem::transmute::(n) }, 6089u32 => unsafe { core::mem::transmute::(6089u32) }, 6094u32..=6095u32 => unsafe { core::mem::transmute::(n) }, 6114u32..=6115u32 => unsafe { core::mem::transmute::(n) }, 6141u32 => unsafe { core::mem::transmute::(6141u32) }, + 6146u32 => unsafe { core::mem::transmute::(6146u32) }, 6161u32 => unsafe { core::mem::transmute::(6161u32) }, + 6167u32 => unsafe { core::mem::transmute::(6167u32) }, + 6169u32 => unsafe { core::mem::transmute::(6169u32) }, 6171u32 => unsafe { core::mem::transmute::(6171u32) }, 6174u32 => unsafe { core::mem::transmute::(6174u32) }, 6400u32 => unsafe { core::mem::transmute::(6400u32) }, + 6441u32 => unsafe { core::mem::transmute::(6441u32) }, _ => return None, }) } @@ -2311,6 +2458,9 @@ impl core::str::FromStr for Capability { "ShaderViewportIndex" => Ok(Self::ShaderViewportIndex), "UniformDecoration" => Ok(Self::UniformDecoration), "CoreBuiltinsARM" => Ok(Self::CoreBuiltinsARM), + "TileImageColorReadAccessEXT" => Ok(Self::TileImageColorReadAccessEXT), + "TileImageDepthReadAccessEXT" => Ok(Self::TileImageDepthReadAccessEXT), + "TileImageStencilReadAccessEXT" => Ok(Self::TileImageStencilReadAccessEXT), "FragmentShadingRateKHR" => Ok(Self::FragmentShadingRateKHR), "SubgroupBallotKHR" => Ok(Self::SubgroupBallotKHR), "DrawParameters" => Ok(Self::DrawParameters), @@ -2356,6 +2506,7 @@ impl core::str::FromStr for Capability { "ImageReadWriteLodAMD" => Ok(Self::ImageReadWriteLodAMD), "Int64ImageEXT" => Ok(Self::Int64ImageEXT), "ShaderClockKHR" => Ok(Self::ShaderClockKHR), + "ShaderEnqueueAMDX" => Ok(Self::ShaderEnqueueAMDX), "SampleMaskOverrideCoverageNV" => Ok(Self::SampleMaskOverrideCoverageNV), "GeometryShaderPassthroughNV" => Ok(Self::GeometryShaderPassthroughNV), "ShaderViewportIndexLayerEXT" => Ok(Self::ShaderViewportIndexLayerEXT), @@ -2431,6 +2582,7 @@ impl core::str::FromStr for Capability { "StorageTexelBufferArrayNonUniformIndexingEXT" => { Ok(Self::StorageTexelBufferArrayNonUniformIndexing) } + "RayTracingPositionFetchKHR" => Ok(Self::RayTracingPositionFetchKHR), "RayTracingNV" => Ok(Self::RayTracingNV), "RayTracingMotionBlurNV" => Ok(Self::RayTracingMotionBlurNV), "VulkanMemoryModel" => Ok(Self::VulkanMemoryModel), @@ -2450,9 +2602,12 @@ impl core::str::FromStr for Capability { "FragmentShaderPixelInterlockEXT" => Ok(Self::FragmentShaderPixelInterlockEXT), "DemoteToHelperInvocation" => Ok(Self::DemoteToHelperInvocation), "DemoteToHelperInvocationEXT" => Ok(Self::DemoteToHelperInvocation), + "DisplacementMicromapNV" => Ok(Self::DisplacementMicromapNV), "RayTracingOpacityMicromapEXT" => Ok(Self::RayTracingOpacityMicromapEXT), "ShaderInvocationReorderNV" => Ok(Self::ShaderInvocationReorderNV), "BindlessTextureNV" => Ok(Self::BindlessTextureNV), + "RayQueryPositionFetchKHR" => Ok(Self::RayQueryPositionFetchKHR), + "RayTracingDisplacementMicromapNV" => Ok(Self::RayTracingDisplacementMicromapNV), "SubgroupShuffleINTEL" => Ok(Self::SubgroupShuffleINTEL), "SubgroupBufferBlockIOINTEL" => Ok(Self::SubgroupBufferBlockIOINTEL), "SubgroupImageBlockIOINTEL" => Ok(Self::SubgroupImageBlockIOINTEL), @@ -2512,6 +2667,7 @@ impl core::str::FromStr for Capability { "DotProduct" => Ok(Self::DotProduct), "DotProductKHR" => Ok(Self::DotProduct), "RayCullMaskKHR" => Ok(Self::RayCullMaskKHR), + "CooperativeMatrixKHR" => Ok(Self::CooperativeMatrixKHR), "BitInstructions" => Ok(Self::BitInstructions), "GroupNonUniformRotateKHR" => Ok(Self::GroupNonUniformRotateKHR), "AtomicFloat32AddEXT" => Ok(Self::AtomicFloat32AddEXT), @@ -2522,10 +2678,14 @@ impl core::str::FromStr for Capability { "DebugInfoModuleINTEL" => Ok(Self::DebugInfoModuleINTEL), "BFloat16ConversionINTEL" => Ok(Self::BFloat16ConversionINTEL), "SplitBarrierINTEL" => Ok(Self::SplitBarrierINTEL), + "GlobalVariableFPGADecorationsINTEL" => Ok(Self::GlobalVariableFPGADecorationsINTEL), "FPGAKernelAttributesv2INTEL" => Ok(Self::FPGAKernelAttributesv2INTEL), + "GlobalVariableHostAccessINTEL" => Ok(Self::GlobalVariableHostAccessINTEL), + "FPMaxErrorINTEL" => Ok(Self::FPMaxErrorINTEL), "FPGALatencyControlINTEL" => Ok(Self::FPGALatencyControlINTEL), "FPGAArgumentInterfacesINTEL" => Ok(Self::FPGAArgumentInterfacesINTEL), "GroupUniformArithmeticKHR" => Ok(Self::GroupUniformArithmeticKHR), + "CacheControlsINTEL" => Ok(Self::CacheControlsINTEL), _ => Err(()), } } @@ -2667,6 +2827,169 @@ impl core::str::FromStr for PackedVectorFormat { } } } +bitflags! { # [doc = "SPIR-V operand kind: [CooperativeMatrixOperands](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_cooperative_matrix_operands_a_cooperative_matrix_operands)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct CooperativeMatrixOperands : u32 { const NONE_KHR = 0u32 ; const MATRIX_A_SIGNED_COMPONENTS_KHR = 1u32 ; const MATRIX_B_SIGNED_COMPONENTS_KHR = 2u32 ; const MATRIX_C_SIGNED_COMPONENTS_KHR = 4u32 ; const MATRIX_RESULT_SIGNED_COMPONENTS_KHR = 8u32 ; const SATURATING_ACCUMULATION_KHR = 16u32 ; } } +#[doc = "SPIR-V operand kind: [CooperativeMatrixLayout](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_cooperative_matrix_layout_a_cooperative_matrix_layout)"] +#[repr(u32)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[cfg_attr(feature = "serialize", derive(serde::Serialize))] +#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] +#[allow(clippy::upper_case_acronyms)] +pub enum CooperativeMatrixLayout { + RowMajorKHR = 0u32, + ColumnMajorKHR = 1u32, +} +impl CooperativeMatrixLayout { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=1u32 => unsafe { core::mem::transmute::(n) }, + _ => return None, + }) + } +} +#[allow(non_upper_case_globals)] +impl CooperativeMatrixLayout {} +impl core::str::FromStr for CooperativeMatrixLayout { + type Err = (); + fn from_str(s: &str) -> Result { + match s { + "RowMajorKHR" => Ok(Self::RowMajorKHR), + "ColumnMajorKHR" => Ok(Self::ColumnMajorKHR), + _ => Err(()), + } + } +} +#[doc = "SPIR-V operand kind: [CooperativeMatrixUse](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_cooperative_matrix_use_a_cooperative_matrix_use)"] +#[repr(u32)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[cfg_attr(feature = "serialize", derive(serde::Serialize))] +#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] +#[allow(clippy::upper_case_acronyms)] +pub enum CooperativeMatrixUse { + MatrixAKHR = 0u32, + MatrixBKHR = 1u32, + MatrixAccumulatorKHR = 2u32, +} +impl CooperativeMatrixUse { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=2u32 => unsafe { core::mem::transmute::(n) }, + _ => return None, + }) + } +} +#[allow(non_upper_case_globals)] +impl CooperativeMatrixUse {} +impl core::str::FromStr for CooperativeMatrixUse { + type Err = (); + fn from_str(s: &str) -> Result { + match s { + "MatrixAKHR" => Ok(Self::MatrixAKHR), + "MatrixBKHR" => Ok(Self::MatrixBKHR), + "MatrixAccumulatorKHR" => Ok(Self::MatrixAccumulatorKHR), + _ => Err(()), + } + } +} +#[doc = "SPIR-V operand kind: [InitializationModeQualifier](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_initialization_mode_qualifier_a_initialization_mode_qualifier)"] +#[repr(u32)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[cfg_attr(feature = "serialize", derive(serde::Serialize))] +#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] +#[allow(clippy::upper_case_acronyms)] +pub enum InitializationModeQualifier { + InitOnDeviceReprogramINTEL = 0u32, + InitOnDeviceResetINTEL = 1u32, +} +impl InitializationModeQualifier { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=1u32 => unsafe { core::mem::transmute::(n) }, + _ => return None, + }) + } +} +#[allow(non_upper_case_globals)] +impl InitializationModeQualifier {} +impl core::str::FromStr for InitializationModeQualifier { + type Err = (); + fn from_str(s: &str) -> Result { + match s { + "InitOnDeviceReprogramINTEL" => Ok(Self::InitOnDeviceReprogramINTEL), + "InitOnDeviceResetINTEL" => Ok(Self::InitOnDeviceResetINTEL), + _ => Err(()), + } + } +} +#[doc = "SPIR-V operand kind: [LoadCacheControl](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_load_cache_control_a_load_cache_control)"] +#[repr(u32)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[cfg_attr(feature = "serialize", derive(serde::Serialize))] +#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] +#[allow(clippy::upper_case_acronyms)] +pub enum LoadCacheControl { + UncachedINTEL = 0u32, + CachedINTEL = 1u32, + StreamingINTEL = 2u32, + InvalidateAfterReadINTEL = 3u32, + ConstCachedINTEL = 4u32, +} +impl LoadCacheControl { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=4u32 => unsafe { core::mem::transmute::(n) }, + _ => return None, + }) + } +} +#[allow(non_upper_case_globals)] +impl LoadCacheControl {} +impl core::str::FromStr for LoadCacheControl { + type Err = (); + fn from_str(s: &str) -> Result { + match s { + "UncachedINTEL" => Ok(Self::UncachedINTEL), + "CachedINTEL" => Ok(Self::CachedINTEL), + "StreamingINTEL" => Ok(Self::StreamingINTEL), + "InvalidateAfterReadINTEL" => Ok(Self::InvalidateAfterReadINTEL), + "ConstCachedINTEL" => Ok(Self::ConstCachedINTEL), + _ => Err(()), + } + } +} +#[doc = "SPIR-V operand kind: [StoreCacheControl](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_store_cache_control_a_store_cache_control)"] +#[repr(u32)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] +#[cfg_attr(feature = "serialize", derive(serde::Serialize))] +#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))] +#[allow(clippy::upper_case_acronyms)] +pub enum StoreCacheControl { + UncachedINTEL = 0u32, + WriteThroughINTEL = 1u32, + WriteBackINTEL = 2u32, + StreamingINTEL = 3u32, +} +impl StoreCacheControl { + pub fn from_u32(n: u32) -> Option { + Some(match n { + 0u32..=3u32 => unsafe { core::mem::transmute::(n) }, + _ => return None, + }) + } +} +#[allow(non_upper_case_globals)] +impl StoreCacheControl {} +impl core::str::FromStr for StoreCacheControl { + type Err = (); + fn from_str(s: &str) -> Result { + match s { + "UncachedINTEL" => Ok(Self::UncachedINTEL), + "WriteThroughINTEL" => Ok(Self::WriteThroughINTEL), + "WriteBackINTEL" => Ok(Self::WriteBackINTEL), + "StreamingINTEL" => Ok(Self::StreamingINTEL), + _ => Err(()), + } + } +} #[doc = "SPIR-V [instructions](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_instructions_a_instructions) opcodes"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] @@ -3018,6 +3341,9 @@ pub enum Op { PtrEqual = 401u32, PtrNotEqual = 402u32, PtrDiff = 403u32, + ColorAttachmentReadEXT = 4160u32, + DepthAttachmentReadEXT = 4161u32, + StencilAttachmentReadEXT = 4162u32, TerminateInvocation = 4416u32, SubgroupBallotKHR = 4421u32, SubgroupFirstInvocationKHR = 4422u32, @@ -3037,6 +3363,11 @@ pub enum Op { SDotAccSat = 4453u32, UDotAccSat = 4454u32, SUDotAccSat = 4455u32, + TypeCooperativeMatrixKHR = 4456u32, + CooperativeMatrixLoadKHR = 4457u32, + CooperativeMatrixStoreKHR = 4458u32, + CooperativeMatrixMulAddKHR = 4459u32, + CooperativeMatrixLengthKHR = 4460u32, TypeRayQueryKHR = 4472u32, RayQueryInitializeKHR = 4473u32, RayQueryTerminateKHR = 4474u32, @@ -3059,6 +3390,9 @@ pub enum Op { FragmentMaskFetchAMD = 5011u32, FragmentFetchAMD = 5012u32, ReadClockKHR = 5056u32, + FinalizeNodePayloadsAMDX = 5075u32, + FinishWritingNodePayloadAMDX = 5078u32, + InitializeNodePayloadsAMDX = 5090u32, HitObjectRecordHitMotionNV = 5249u32, HitObjectRecordHitWithIndexMotionNV = 5250u32, HitObjectRecordMissMotionNV = 5251u32, @@ -3097,12 +3431,15 @@ pub enum Op { SetMeshOutputsEXT = 5295u32, GroupNonUniformPartitionNV = 5296u32, WritePackedPrimitiveIndices4x8NV = 5299u32, + FetchMicroTriangleVertexPositionNV = 5300u32, + FetchMicroTriangleVertexBarycentricNV = 5301u32, ReportIntersectionKHR = 5334u32, IgnoreIntersectionNV = 5335u32, TerminateRayNV = 5336u32, TraceNV = 5337u32, TraceMotionNV = 5338u32, TraceRayMotionNV = 5339u32, + RayQueryGetIntersectionTriangleVertexPositionsKHR = 5340u32, TypeAccelerationStructureKHR = 5341u32, ExecuteCallableNV = 5344u32, TypeCooperativeMatrixNV = 5358u32, @@ -3399,21 +3736,24 @@ impl Op { 274u32..=288u32 => unsafe { core::mem::transmute::(n) }, 291u32..=366u32 => unsafe { core::mem::transmute::(n) }, 400u32..=403u32 => unsafe { core::mem::transmute::(n) }, + 4160u32..=4162u32 => unsafe { core::mem::transmute::(n) }, 4416u32 => unsafe { core::mem::transmute::(4416u32) }, 4421u32..=4422u32 => unsafe { core::mem::transmute::(n) }, 4428u32..=4432u32 => unsafe { core::mem::transmute::(n) }, - 4445u32..=4455u32 => unsafe { core::mem::transmute::(n) }, + 4445u32..=4460u32 => unsafe { core::mem::transmute::(n) }, 4472u32..=4477u32 => unsafe { core::mem::transmute::(n) }, 4479u32..=4483u32 => unsafe { core::mem::transmute::(n) }, 5000u32..=5007u32 => unsafe { core::mem::transmute::(n) }, 5011u32..=5012u32 => unsafe { core::mem::transmute::(n) }, 5056u32 => unsafe { core::mem::transmute::(5056u32) }, + 5075u32 => unsafe { core::mem::transmute::(5075u32) }, + 5078u32 => unsafe { core::mem::transmute::(5078u32) }, + 5090u32 => unsafe { core::mem::transmute::(5090u32) }, 5249u32..=5281u32 => unsafe { core::mem::transmute::(n) }, 5283u32 => unsafe { core::mem::transmute::(5283u32) }, 5294u32..=5296u32 => unsafe { core::mem::transmute::(n) }, - 5299u32 => unsafe { core::mem::transmute::(5299u32) }, - 5334u32..=5339u32 => unsafe { core::mem::transmute::(n) }, - 5341u32 => unsafe { core::mem::transmute::(5341u32) }, + 5299u32..=5301u32 => unsafe { core::mem::transmute::(n) }, + 5334u32..=5341u32 => unsafe { core::mem::transmute::(n) }, 5344u32 => unsafe { core::mem::transmute::(5344u32) }, 5358u32..=5362u32 => unsafe { core::mem::transmute::(n) }, 5364u32..=5365u32 => unsafe { core::mem::transmute::(n) },