From 25a54a66ab470790f688fe39df9d0c0cf12bee38 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Fri, 1 Nov 2024 11:45:10 +0100 Subject: [PATCH] Regenerate on `sdk-1.3.296.0` --- autogen/external/SPIRV-Headers | 2 +- autogen/src/header.rs | 25 +- rspirv/binary/autogen_decode_operand.rs | 31 + rspirv/binary/autogen_disas_operand.rs | 24 + rspirv/binary/autogen_error.rs | 18 + rspirv/binary/autogen_parse_operand.rs | 26 +- rspirv/dr/autogen_operand.rs | 329 ++++++-- rspirv/dr/build/autogen_constant.rs | 34 + rspirv/dr/build/autogen_norm_insts.rs | 1002 +++++++++++++++++++++-- rspirv/dr/build/autogen_type.rs | 46 +- rspirv/grammar/autogen_table.rs | 259 +++++- rspirv/lift/autogen_context.rs | 481 +++++++++++ rspirv/sr/autogen_decoration.rs | 3 +- rspirv/sr/autogen_instructions.rs | 6 + rspirv/sr/autogen_ops.rs | 100 +++ rspirv/sr/autogen_types.rs | 4 + spirv/Cargo.toml | 2 +- spirv/autogen_spirv.rs | 495 +++++++---- 18 files changed, 2556 insertions(+), 331 deletions(-) diff --git a/autogen/external/SPIRV-Headers b/autogen/external/SPIRV-Headers index 1c6bb274..2a9b6f95 160000 --- a/autogen/external/SPIRV-Headers +++ b/autogen/external/SPIRV-Headers @@ -1 +1 @@ -Subproject commit 1c6bb2743599e6eb6f37b2969acc0aef812e32e3 +Subproject commit 2a9b6f951c7d6b04b6c21fe1bf3f475b68b84801 diff --git a/autogen/src/header.rs b/autogen/src/header.rs index df61e728..3ecd9c5b 100644 --- a/autogen/src/header.rs +++ b/autogen/src/header.rs @@ -51,18 +51,20 @@ fn generate_enum( .iter() .map(|(number, name)| quote! { #name = #number }); - // Each item is a tuple indicating an inclusive range as opposed to an exclusive range like is - // common. - let mut number_runs = vec![(variants[0].0, variants[0].0)]; + // Each item is a tuple indicating an inclusive range as opposed to an exclusive range like + // is common. + let mut number_runs = Vec::<(u32, u32)>::new(); for &(number, _) in variants.iter().skip(1) { - let last_run = number_runs.last_mut().unwrap(); - match number.cmp(&(last_run.1 + 1)) { - Ordering::Equal => last_run.1 = number, - Ordering::Greater => number_runs.push((number, number)), - Ordering::Less => unreachable!("Variants not sorted by discriminant"), + if let Some(last_run) = number_runs.last_mut() { + match number.cmp(&(last_run.1 + 1)) { + Ordering::Equal => last_run.1 = number, + Ordering::Greater => number_runs.push((number, number)), + Ordering::Less => unreachable!("Variants not sorted by discriminant"), + } + } else { + number_runs.push((number, number)); } } - // We try to check if the given number is within a run of valid discriminants and if so // transmute the number directly to the enum type. let from_prim = number_runs @@ -77,11 +79,16 @@ fn generate_enum( }) .collect::>(); + // At least one variant is required for repr(u32). Generate a Max member like Spirv-Headers + // tooling does. + let empty_enum = variants.is_empty().then_some(quote!(Max = 0x7fffffff)); + let attribute = value_enum_attribute(); quote! { #[doc = #comment] #attribute pub enum #enum_name { + #empty_enum #(#enumerants),* } diff --git a/rspirv/binary/autogen_decode_operand.rs b/rspirv/binary/autogen_decode_operand.rs index 7821d94e..4e01335a 100644 --- a/rspirv/binary/autogen_decode_operand.rs +++ b/rspirv/binary/autogen_decode_operand.rs @@ -111,6 +111,16 @@ impl<'a> Decoder<'a> { Err(Error::StreamExpected(self.offset)) } } + #[doc = "Decodes and returns the next SPIR-V word as\na SPIR-V RawAccessChainOperands value."] + pub fn raw_access_chain_operands(&mut self) -> Result { + if let Ok(word) = self.word() { + spirv::RawAccessChainOperands::from_bits(word).ok_or( + Error::RawAccessChainOperandsUnknown(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 SourceLanguage value."] pub fn source_language(&mut self) -> Result { if let Ok(word) = self.word() { @@ -505,4 +515,25 @@ impl<'a> Decoder<'a> { Err(Error::StreamExpected(self.offset)) } } + #[doc = "Decodes and returns the next SPIR-V word as\na SPIR-V NamedMaximumNumberOfRegisters value."] + pub fn named_maximum_number_of_registers( + &mut self, + ) -> Result { + if let Ok(word) = self.word() { + spirv::NamedMaximumNumberOfRegisters::from_u32(word).ok_or( + Error::NamedMaximumNumberOfRegistersUnknown(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 FPEncoding value."] + pub fn fp_encoding(&mut self) -> Result { + if let Ok(word) = self.word() { + spirv::FPEncoding::from_u32(word) + .ok_or(Error::FPEncodingUnknown(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 466836fe..8074abcd 100644 --- a/rspirv/binary/autogen_disas_operand.rs +++ b/rspirv/binary/autogen_disas_operand.rs @@ -92,12 +92,21 @@ impl Disassemble for spirv::FPFastMathMode { if self.contains(spirv::FPFastMathMode::FAST) { bits.push("Fast") } + if self.contains(spirv::FPFastMathMode::ALLOW_CONTRACT) { + bits.push("AllowContract") + } if self.contains(spirv::FPFastMathMode::ALLOW_CONTRACT_FAST_INTEL) { bits.push("AllowContractFastINTEL") } + if self.contains(spirv::FPFastMathMode::ALLOW_REASSOC) { + bits.push("AllowReassoc") + } if self.contains(spirv::FPFastMathMode::ALLOW_REASSOC_INTEL) { bits.push("AllowReassocINTEL") } + if self.contains(spirv::FPFastMathMode::ALLOW_TRANSFORM) { + bits.push("AllowTransform") + } bits.join("|") } } @@ -383,6 +392,21 @@ impl Disassemble for spirv::FragmentShadingRate { bits.join("|") } } +impl Disassemble for spirv::RawAccessChainOperands { + fn disassemble(&self) -> String { + if self.is_empty() { + return "None".to_string(); + } + let mut bits = vec![]; + if self.contains(spirv::RawAccessChainOperands::ROBUSTNESS_PER_COMPONENT_NV) { + bits.push("RobustnessPerComponentNV") + } + if self.contains(spirv::RawAccessChainOperands::ROBUSTNESS_PER_ELEMENT_NV) { + bits.push("RobustnessPerElementNV") + } + bits.join("|") + } +} impl Disassemble for spirv::CooperativeMatrixOperands { fn disassemble(&self) -> String { if self.is_empty() { diff --git a/rspirv/binary/autogen_error.rs b/rspirv/binary/autogen_error.rs index 21b9e5f4..1a78f05e 100644 --- a/rspirv/binary/autogen_error.rs +++ b/rspirv/binary/autogen_error.rs @@ -19,6 +19,7 @@ pub enum Error { KernelProfilingInfoUnknown(usize, spirv::Word), RayFlagsUnknown(usize, spirv::Word), FragmentShadingRateUnknown(usize, spirv::Word), + RawAccessChainOperandsUnknown(usize, spirv::Word), SourceLanguageUnknown(usize, spirv::Word), ExecutionModelUnknown(usize, spirv::Word), AddressingModelUnknown(usize, spirv::Word), @@ -56,6 +57,8 @@ pub enum Error { InitializationModeQualifierUnknown(usize, spirv::Word), LoadCacheControlUnknown(usize, spirv::Word), StoreCacheControlUnknown(usize, spirv::Word), + NamedMaximumNumberOfRegistersUnknown(usize, spirv::Word), + FPEncodingUnknown(usize, spirv::Word), #[doc = r"Failed to decode a string."] #[doc = r""] #[doc = r"For structured error handling, the second element could be"] @@ -120,6 +123,11 @@ impl fmt::Display for Error { "unknown value {} for operand kind FragmentShadingRate at index {}", word, index ), + Error::RawAccessChainOperandsUnknown(index, word) => write!( + f, + "unknown value {} for operand kind RawAccessChainOperands at index {}", + word, index + ), Error::SourceLanguageUnknown(index, word) => write!( f, "unknown value {} for operand kind SourceLanguage at index {}", @@ -305,6 +313,16 @@ impl fmt::Display for Error { "unknown value {} for operand kind StoreCacheControl at index {}", word, index ), + Error::NamedMaximumNumberOfRegistersUnknown(index, word) => write!( + f, + "unknown value {} for operand kind NamedMaximumNumberOfRegisters at index {}", + word, index + ), + Error::FPEncodingUnknown(index, word) => write!( + f, + "unknown value {} for operand kind FPEncoding 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 12cab687..9709215d 100644 --- a/rspirv/binary/autogen_parse_operand.rs +++ b/rspirv/binary/autogen_parse_operand.rs @@ -24,6 +24,9 @@ impl<'c, 'd> Parser<'c, 'd> { GOpKind::FragmentShadingRate => vec![dr::Operand::FragmentShadingRate( self.decoder.fragment_shading_rate()?, )], + GOpKind::RawAccessChainOperands => vec![dr::Operand::RawAccessChainOperands( + self.decoder.raw_access_chain_operands()?, + )], GOpKind::SourceLanguage => { vec![dr::Operand::SourceLanguage(self.decoder.source_language()?)] } @@ -117,6 +120,12 @@ impl<'c, 'd> Parser<'c, 'd> { GOpKind::StoreCacheControl => vec![dr::Operand::StoreCacheControl( self.decoder.store_cache_control()?, )], + GOpKind::NamedMaximumNumberOfRegisters => { + vec![dr::Operand::NamedMaximumNumberOfRegisters( + self.decoder.named_maximum_number_of_registers()?, + )] + } + GOpKind::FPEncoding => vec![dr::Operand::FPEncoding(self.decoder.fp_encoding()?)], 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()?)], @@ -361,7 +370,7 @@ impl<'c, 'd> Parser<'c, 'd> { dr::Operand::IdRef(self.decoder.id()?), dr::Operand::IdRef(self.decoder.id()?), ], - spirv::ExecutionMode::OutputPrimitivesNV => { + spirv::ExecutionMode::OutputPrimitivesEXT => { vec![dr::Operand::LiteralBit32(self.decoder.bit32()?)] } spirv::ExecutionMode::SharedLocalMemorySizeINTEL => { @@ -393,6 +402,10 @@ impl<'c, 'd> Parser<'c, 'd> { spirv::ExecutionMode::SchedulerTargetFmaxMhzINTEL => { vec![dr::Operand::LiteralBit32(self.decoder.bit32()?)] } + spirv::ExecutionMode::FPFastMathDefault => vec![ + dr::Operand::IdRef(self.decoder.id()?), + dr::Operand::IdRef(self.decoder.id()?), + ], spirv::ExecutionMode::StreamingInterfaceINTEL => { vec![dr::Operand::LiteralBit32(self.decoder.bit32()?)] } @@ -402,6 +415,17 @@ impl<'c, 'd> Parser<'c, 'd> { spirv::ExecutionMode::NamedBarrierCountINTEL => { vec![dr::Operand::LiteralBit32(self.decoder.bit32()?)] } + spirv::ExecutionMode::MaximumRegistersINTEL => { + vec![dr::Operand::LiteralBit32(self.decoder.bit32()?)] + } + spirv::ExecutionMode::MaximumRegistersIdINTEL => { + vec![dr::Operand::IdRef(self.decoder.id()?)] + } + spirv::ExecutionMode::NamedMaximumRegistersINTEL => { + vec![dr::Operand::NamedMaximumNumberOfRegisters( + self.decoder.named_maximum_number_of_registers()?, + )] + } _ => vec![], }) } diff --git a/rspirv/dr/autogen_operand.rs b/rspirv/dr/autogen_operand.rs index c5f60c8b..c602254f 100644 --- a/rspirv/dr/autogen_operand.rs +++ b/rspirv/dr/autogen_operand.rs @@ -16,6 +16,7 @@ pub enum Operand { KernelProfilingInfo(spirv::KernelProfilingInfo), RayFlags(spirv::RayFlags), FragmentShadingRate(spirv::FragmentShadingRate), + RawAccessChainOperands(spirv::RawAccessChainOperands), SourceLanguage(spirv::SourceLanguage), ExecutionModel(spirv::ExecutionModel), AddressingModel(spirv::AddressingModel), @@ -53,6 +54,8 @@ pub enum Operand { InitializationModeQualifier(spirv::InitializationModeQualifier), LoadCacheControl(spirv::LoadCacheControl), StoreCacheControl(spirv::StoreCacheControl), + NamedMaximumNumberOfRegisters(spirv::NamedMaximumNumberOfRegisters), + FPEncoding(spirv::FPEncoding), IdMemorySemantics(spirv::Word), IdScope(spirv::Word), IdRef(spirv::Word), @@ -112,6 +115,11 @@ impl From for Operand { Self::FragmentShadingRate(o) } } +impl From for Operand { + fn from(o: spirv::RawAccessChainOperands) -> Self { + Self::RawAccessChainOperands(o) + } +} impl From for Operand { fn from(o: spirv::SourceLanguage) -> Self { Self::SourceLanguage(o) @@ -297,6 +305,16 @@ impl From for Operand { Self::StoreCacheControl(o) } } +impl From for Operand { + fn from(o: spirv::NamedMaximumNumberOfRegisters) -> Self { + Self::NamedMaximumNumberOfRegisters(o) + } +} +impl From for Operand { + fn from(o: spirv::FPEncoding) -> Self { + Self::FPEncoding(o) + } +} impl From for Operand { fn from(o: u32) -> Self { Self::LiteralBit32(o) @@ -330,6 +348,7 @@ impl fmt::Display for Operand { Operand::KernelProfilingInfo(ref v) => write!(f, "{:?}", v), Operand::RayFlags(ref v) => write!(f, "{:?}", v), Operand::FragmentShadingRate(ref v) => write!(f, "{:?}", v), + Operand::RawAccessChainOperands(ref v) => write!(f, "{:?}", v), Operand::SourceLanguage(ref v) => write!(f, "{:?}", v), Operand::ExecutionModel(ref v) => write!(f, "{:?}", v), Operand::AddressingModel(ref v) => write!(f, "{:?}", v), @@ -367,6 +386,8 @@ impl fmt::Display for Operand { Operand::InitializationModeQualifier(ref v) => write!(f, "{:?}", v), Operand::LoadCacheControl(ref v) => write!(f, "{:?}", v), Operand::StoreCacheControl(ref v) => write!(f, "{:?}", v), + Operand::NamedMaximumNumberOfRegisters(ref v) => write!(f, "{:?}", v), + Operand::FPEncoding(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), @@ -445,6 +466,15 @@ impl Operand { ), } } + pub fn unwrap_raw_access_chain_operands(&self) -> spirv::RawAccessChainOperands { + match *self { + Self::RawAccessChainOperands(v) => v, + ref other => panic!( + "Expected Operand::RawAccessChainOperands, got {} instead", + other + ), + } + } pub fn unwrap_source_language(&self) -> spirv::SourceLanguage { match *self { Self::SourceLanguage(v) => v, @@ -710,6 +740,21 @@ impl Operand { ref other => panic!("Expected Operand::StoreCacheControl, got {} instead", other), } } + pub fn unwrap_named_maximum_number_of_registers(&self) -> spirv::NamedMaximumNumberOfRegisters { + match *self { + Self::NamedMaximumNumberOfRegisters(v) => v, + ref other => panic!( + "Expected Operand::NamedMaximumNumberOfRegisters, got {} instead", + other + ), + } + } + pub fn unwrap_fp_encoding(&self) -> spirv::FPEncoding { + match *self { + Self::FPEncoding(v) => v, + ref other => panic!("Expected Operand::FPEncoding, got {} instead", other), + } + } pub fn unwrap_id_memory_semantics(&self) -> spirv::Word { match *self { Self::IdMemorySemantics(v) => v, @@ -802,11 +847,16 @@ impl Operand { } Self::FPFastMathMode(v) => { let mut result = vec![]; + if v.intersects(s::FPFastMathMode::ALLOW_TRANSFORM) { + result.extend_from_slice(&[spirv::Capability::FloatControls2]) + }; if v.intersects( - s::FPFastMathMode::ALLOW_CONTRACT_FAST_INTEL - | s::FPFastMathMode::ALLOW_REASSOC_INTEL, + s::FPFastMathMode::ALLOW_CONTRACT | s::FPFastMathMode::ALLOW_REASSOC, ) { - result.extend_from_slice(&[spirv::Capability::FPFastMathModeINTEL]) + result.extend_from_slice(&[ + spirv::Capability::FloatControls2, + spirv::Capability::FPFastMathModeINTEL, + ]) }; result } @@ -914,6 +964,16 @@ impl Operand { }; result } + Self::RawAccessChainOperands(v) => { + let mut result = vec![]; + if v.intersects( + s::RawAccessChainOperands::ROBUSTNESS_PER_COMPONENT_NV + | s::RawAccessChainOperands::ROBUSTNESS_PER_ELEMENT_NV, + ) { + result.extend_from_slice(&[spirv::Capability::RawAccessChainsNV]) + }; + result + } Self::SourceLanguage(v) => match v { s::SourceLanguage::Unknown | s::SourceLanguage::ESSL @@ -926,7 +986,8 @@ impl Operand { | s::SourceLanguage::HERO_C | s::SourceLanguage::NZSL | s::SourceLanguage::WGSL - | s::SourceLanguage::Slang => vec![], + | s::SourceLanguage::Slang + | s::SourceLanguage::Zig => vec![], }, Self::ExecutionModel(v) => match v { s::ExecutionModel::Geometry => vec![spirv::Capability::Geometry], @@ -937,12 +998,12 @@ impl Operand { s::ExecutionModel::TaskNV | s::ExecutionModel::MeshNV => { vec![spirv::Capability::MeshShadingNV] } - s::ExecutionModel::RayGenerationNV - | s::ExecutionModel::IntersectionNV - | s::ExecutionModel::AnyHitNV - | s::ExecutionModel::ClosestHitNV - | s::ExecutionModel::MissNV - | s::ExecutionModel::CallableNV => vec![ + s::ExecutionModel::RayGenerationKHR + | s::ExecutionModel::IntersectionKHR + | s::ExecutionModel::AnyHitKHR + | s::ExecutionModel::ClosestHitKHR + | s::ExecutionModel::MissKHR + | s::ExecutionModel::CallableKHR => vec![ spirv::Capability::RayTracingNV, spirv::Capability::RayTracingKHR, ], @@ -970,12 +1031,14 @@ impl Operand { }, Self::ExecutionMode(v) => match v { s::ExecutionMode::LocalSize | s::ExecutionMode::LocalSizeId => vec![], - s::ExecutionMode::DerivativeGroupLinearNV => { - vec![spirv::Capability::ComputeDerivativeGroupLinearNV] - } - s::ExecutionMode::DerivativeGroupQuadsNV => { - vec![spirv::Capability::ComputeDerivativeGroupQuadsNV] - } + s::ExecutionMode::DerivativeGroupLinearKHR => vec![ + spirv::Capability::ComputeDerivativeGroupLinearNV, + spirv::Capability::ComputeDerivativeGroupLinearKHR, + ], + s::ExecutionMode::DerivativeGroupQuadsKHR => vec![ + spirv::Capability::ComputeDerivativeGroupQuadsNV, + spirv::Capability::ComputeDerivativeGroupQuadsKHR, + ], s::ExecutionMode::DenormFlushToZero => vec![spirv::Capability::DenormFlushToZero], s::ExecutionMode::DenormPreserve => vec![spirv::Capability::DenormPreserve], s::ExecutionMode::NumSIMDWorkitemsINTEL @@ -986,6 +1049,7 @@ impl Operand { s::ExecutionMode::RegisterMapInterfaceINTEL => { vec![spirv::Capability::FPGAKernelAttributesv2INTEL] } + s::ExecutionMode::FPFastMathDefault => vec![spirv::Capability::FloatControls2], s::ExecutionMode::PixelInterlockOrderedEXT | s::ExecutionMode::PixelInterlockUnorderedEXT => { vec![spirv::Capability::FragmentShaderPixelInterlockEXT] @@ -1030,12 +1094,20 @@ impl Operand { | s::ExecutionMode::NoGlobalOffsetINTEL => { vec![spirv::Capability::KernelAttributesINTEL] } - s::ExecutionMode::OutputLinesNV - | s::ExecutionMode::OutputPrimitivesNV - | s::ExecutionMode::OutputTrianglesNV => vec![ + s::ExecutionMode::OutputLinesEXT + | s::ExecutionMode::OutputPrimitivesEXT + | s::ExecutionMode::OutputTrianglesEXT => vec![ spirv::Capability::MeshShadingNV, spirv::Capability::MeshShadingEXT, ], + s::ExecutionMode::QuadDerivativesKHR | s::ExecutionMode::RequireFullQuadsKHR => { + vec![spirv::Capability::QuadControlKHR] + } + s::ExecutionMode::MaximumRegistersINTEL + | s::ExecutionMode::MaximumRegistersIdINTEL + | s::ExecutionMode::NamedMaximumRegistersINTEL => { + vec![spirv::Capability::RegisterLimitsINTEL] + } s::ExecutionMode::RoundingModeRTPINTEL | s::ExecutionMode::RoundingModeRTNINTEL | s::ExecutionMode::FloatingPointModeALTINTEL @@ -1056,7 +1128,8 @@ impl Operand { | s::ExecutionMode::DepthLess | s::ExecutionMode::DepthUnchanged | s::ExecutionMode::SubgroupUniformControlFlowKHR - | s::ExecutionMode::EarlyAndLateFragmentTestsAMD => vec![spirv::Capability::Shader], + | s::ExecutionMode::EarlyAndLateFragmentTestsAMD + | s::ExecutionMode::MaximallyReconvergesKHR => vec![spirv::Capability::Shader], s::ExecutionMode::CoalescingAMDX | s::ExecutionMode::MaxNodeRecursionAMDX | s::ExecutionMode::StaticNumWorkgroupsAMDX @@ -1118,12 +1191,12 @@ impl Operand { s::StorageClass::PhysicalStorageBuffer => { vec![spirv::Capability::PhysicalStorageBufferAddresses] } - s::StorageClass::CallableDataNV - | s::StorageClass::IncomingCallableDataNV - | s::StorageClass::RayPayloadNV - | s::StorageClass::HitAttributeNV - | s::StorageClass::IncomingRayPayloadNV - | s::StorageClass::ShaderRecordBufferNV => vec![ + s::StorageClass::CallableDataKHR + | s::StorageClass::IncomingCallableDataKHR + | s::StorageClass::RayPayloadKHR + | s::StorageClass::HitAttributeKHR + | s::StorageClass::IncomingRayPayloadKHR + | s::StorageClass::ShaderRecordBufferKHR => vec![ spirv::Capability::RayTracingNV, spirv::Capability::RayTracingKHR, ], @@ -1232,7 +1305,7 @@ impl Operand { | s::ImageChannelOrder::sRGBx | s::ImageChannelOrder::sRGBA | s::ImageChannelOrder::sBGRA - | s::ImageChannelOrder::ABGR => vec![spirv::Capability::Kernel], + | s::ImageChannelOrder::ABGR => vec![], }, Self::ImageChannelDataType(v) => match v { s::ImageChannelDataType::SnormInt8 @@ -1253,7 +1326,8 @@ impl Operand { | s::ImageChannelDataType::UnormInt24 | s::ImageChannelDataType::UnormInt101010_2 | s::ImageChannelDataType::UnsignedIntRaw10EXT - | s::ImageChannelDataType::UnsignedIntRaw12EXT => vec![spirv::Capability::Kernel], + | s::ImageChannelDataType::UnsignedIntRaw12EXT + | s::ImageChannelDataType::UnormInt2_101010EXT => vec![], }, Self::FPRoundingMode(v) => match v { s::FPRoundingMode::RTE @@ -1335,6 +1409,7 @@ impl Operand { | s::Decoration::NoUnsignedWrap | s::Decoration::WeightTextureQCOM | s::Decoration::BlockMatchTextureQCOM + | s::Decoration::BlockMatchSamplerQCOM | s::Decoration::ExplicitInterpAMD | s::Decoration::CounterBuffer | s::Decoration::UserSemantic @@ -1434,9 +1509,11 @@ impl Operand { | s::Decoration::Constant | s::Decoration::SaturatedConversion | s::Decoration::FuncParamAttr - | s::Decoration::FPFastMathMode | s::Decoration::Alignment | s::Decoration::AlignmentId => vec![spirv::Capability::Kernel], + s::Decoration::FPFastMathMode => { + vec![spirv::Capability::Kernel, spirv::Capability::FloatControls2] + } s::Decoration::LinkageAttributes => vec![spirv::Capability::Linkage], s::Decoration::FuseLoopsInFunctionINTEL => vec![spirv::Capability::LoopFuseINTEL], s::Decoration::RowMajor | s::Decoration::ColMajor | s::Decoration::MatrixStride => { @@ -1446,7 +1523,7 @@ impl Operand { vec![spirv::Capability::MemoryAccessAliasingINTEL] } s::Decoration::PerViewNV => vec![spirv::Capability::MeshShadingNV], - s::Decoration::PerPrimitiveNV | s::Decoration::PerTaskNV => vec![ + s::Decoration::PerPrimitiveEXT | s::Decoration::PerTaskNV => vec![ spirv::Capability::MeshShadingNV, spirv::Capability::MeshShadingEXT, ], @@ -1615,19 +1692,19 @@ impl Operand { s::BuiltIn::RayGeometryIndexKHR => vec![spirv::Capability::RayTracingKHR], s::BuiltIn::CurrentRayTimeNV => vec![spirv::Capability::RayTracingMotionBlurNV], s::BuiltIn::HitTNV => vec![spirv::Capability::RayTracingNV], - s::BuiltIn::LaunchIdNV - | s::BuiltIn::LaunchSizeNV - | s::BuiltIn::WorldRayOriginNV - | s::BuiltIn::WorldRayDirectionNV - | s::BuiltIn::ObjectRayOriginNV - | s::BuiltIn::ObjectRayDirectionNV - | s::BuiltIn::RayTminNV - | s::BuiltIn::RayTmaxNV - | s::BuiltIn::InstanceCustomIndexNV - | s::BuiltIn::ObjectToWorldNV - | s::BuiltIn::WorldToObjectNV - | s::BuiltIn::HitKindNV - | s::BuiltIn::IncomingRayFlagsNV => vec![ + s::BuiltIn::LaunchIdKHR + | s::BuiltIn::LaunchSizeKHR + | s::BuiltIn::WorldRayOriginKHR + | s::BuiltIn::WorldRayDirectionKHR + | s::BuiltIn::ObjectRayOriginKHR + | s::BuiltIn::ObjectRayDirectionKHR + | s::BuiltIn::RayTminKHR + | s::BuiltIn::RayTmaxKHR + | s::BuiltIn::InstanceCustomIndexKHR + | s::BuiltIn::ObjectToWorldKHR + | s::BuiltIn::WorldToObjectKHR + | s::BuiltIn::HitKindKHR + | s::BuiltIn::IncomingRayFlagsKHR => vec![ spirv::Capability::RayTracingNV, spirv::Capability::RayTracingKHR, ], @@ -1729,6 +1806,7 @@ impl Operand { | s::Capability::TileImageColorReadAccessEXT | s::Capability::TileImageDepthReadAccessEXT | s::Capability::TileImageStencilReadAccessEXT + | s::Capability::CooperativeMatrixLayoutsARM | s::Capability::SubgroupBallotKHR | s::Capability::SubgroupVoteKHR | s::Capability::StorageBuffer16BitAccess @@ -1744,18 +1822,21 @@ impl Operand { | s::Capability::SignedZeroInfNanPreserve | s::Capability::RoundingModeRTE | s::Capability::RoundingModeRTZ + | s::Capability::UntypedPointersKHR | s::Capability::TextureSampleWeightedQCOM | s::Capability::TextureBoxFilterQCOM | s::Capability::TextureBlockMatchQCOM + | s::Capability::TextureBlockMatch2QCOM | s::Capability::ShaderClockKHR + | s::Capability::QuadControlKHR | s::Capability::ImageFootprintNV | s::Capability::FragmentBarycentricKHR - | s::Capability::ComputeDerivativeGroupQuadsNV | s::Capability::GroupNonUniformPartitionedNV | s::Capability::VulkanMemoryModel | s::Capability::VulkanMemoryModelDeviceScope - | s::Capability::ComputeDerivativeGroupLinearNV | s::Capability::BindlessTextureNV + | s::Capability::AtomicFloat16VectorNV + | s::Capability::RawAccessChainsNV | s::Capability::SubgroupShuffleINTEL | s::Capability::SubgroupBufferBlockIOINTEL | s::Capability::SubgroupImageBlockIOINTEL @@ -1800,7 +1881,9 @@ impl Operand { | s::Capability::DotProduct | s::Capability::RayCullMaskKHR | s::Capability::CooperativeMatrixKHR + | s::Capability::ReplicatedCompositesEXT | s::Capability::BitInstructions + | s::Capability::FloatControls2 | s::Capability::AtomicFloat32AddEXT | s::Capability::AtomicFloat64AddEXT | s::Capability::LongCompositesINTEL @@ -1814,8 +1897,11 @@ impl Operand { | s::Capability::FPGAArgumentInterfacesINTEL | s::Capability::GlobalVariableHostAccessINTEL | s::Capability::GlobalVariableFPGADecorationsINTEL + | s::Capability::SubgroupBufferPrefetchINTEL | s::Capability::GroupUniformArithmeticKHR - | s::Capability::CacheControlsINTEL => vec![], + | s::Capability::MaskedGatherScatterINTEL + | s::Capability::CacheControlsINTEL + | s::Capability::RegisterLimitsINTEL => vec![], s::Capability::GenericPointer => vec![spirv::Capability::Addresses], s::Capability::SubgroupDispatch => vec![spirv::Capability::DeviceEnqueue], s::Capability::FPGAClusterAttributesV2INTEL => { @@ -1937,6 +2023,7 @@ impl Operand { | s::Capability::FragmentFullyCoveredEXT | s::Capability::MeshShadingNV | s::Capability::MeshShadingEXT + | s::Capability::ComputeDerivativeGroupQuadsKHR | s::Capability::FragmentDensityEXT | s::Capability::ShaderNonUniform | s::Capability::RuntimeDescriptorArray @@ -1944,6 +2031,7 @@ impl Operand { | s::Capability::RayTracingNV | s::Capability::RayTracingMotionBlurNV | s::Capability::PhysicalStorageBufferAddresses + | s::Capability::ComputeDerivativeGroupLinearKHR | s::Capability::RayTracingProvisionalKHR | s::Capability::CooperativeMatrixNV | s::Capability::FragmentShaderSampleInterlockEXT @@ -2005,7 +2093,9 @@ impl Operand { }, Self::CooperativeMatrixLayout(v) => match v { s::CooperativeMatrixLayout::RowMajorKHR - | s::CooperativeMatrixLayout::ColumnMajorKHR => vec![], + | s::CooperativeMatrixLayout::ColumnMajorKHR + | s::CooperativeMatrixLayout::RowBlockedInterleavedARM + | s::CooperativeMatrixLayout::ColumnBlockedInterleavedARM => vec![], }, Self::CooperativeMatrixUse(v) => match v { s::CooperativeMatrixUse::MatrixAKHR @@ -2035,6 +2125,11 @@ impl Operand { vec![spirv::Capability::CacheControlsINTEL] } }, + Self::NamedMaximumNumberOfRegisters(v) => match v { + s::NamedMaximumNumberOfRegisters::AutoINTEL => { + vec![spirv::Capability::RegisterLimitsINTEL] + } + }, _ => vec![], } } @@ -2069,7 +2164,8 @@ impl Operand { | s::SourceLanguage::HERO_C | s::SourceLanguage::NZSL | s::SourceLanguage::WGSL - | s::SourceLanguage::Slang => vec![], + | s::SourceLanguage::Slang + | s::SourceLanguage::Zig => vec![], }, Self::ExecutionModel(v) => match v { s::ExecutionModel::Vertex @@ -2081,12 +2177,12 @@ impl Operand { | s::ExecutionModel::Kernel | s::ExecutionModel::TaskNV | s::ExecutionModel::MeshNV - | s::ExecutionModel::RayGenerationNV - | s::ExecutionModel::IntersectionNV - | s::ExecutionModel::AnyHitNV - | s::ExecutionModel::ClosestHitNV - | s::ExecutionModel::MissNV - | s::ExecutionModel::CallableNV + | s::ExecutionModel::RayGenerationKHR + | s::ExecutionModel::IntersectionKHR + | s::ExecutionModel::AnyHitKHR + | s::ExecutionModel::ClosestHitKHR + | s::ExecutionModel::MissKHR + | s::ExecutionModel::CallableKHR | s::ExecutionModel::TaskEXT | s::ExecutionModel::MeshEXT => vec![], }, @@ -2152,15 +2248,21 @@ impl Operand { | s::ExecutionMode::StaticNumWorkgroupsAMDX | s::ExecutionMode::ShaderIndexAMDX | s::ExecutionMode::MaxNumWorkgroupsAMDX + | s::ExecutionMode::QuadDerivativesKHR + | s::ExecutionMode::RequireFullQuadsKHR | s::ExecutionMode::SharedLocalMemorySizeINTEL | s::ExecutionMode::RoundingModeRTPINTEL | s::ExecutionMode::RoundingModeRTNINTEL | s::ExecutionMode::FloatingPointModeALTINTEL | s::ExecutionMode::FloatingPointModeIEEEINTEL | s::ExecutionMode::SchedulerTargetFmaxMhzINTEL + | s::ExecutionMode::FPFastMathDefault | s::ExecutionMode::StreamingInterfaceINTEL | s::ExecutionMode::RegisterMapInterfaceINTEL - | s::ExecutionMode::NamedBarrierCountINTEL => vec![], + | s::ExecutionMode::NamedBarrierCountINTEL + | s::ExecutionMode::MaximumRegistersINTEL + | s::ExecutionMode::MaximumRegistersIdINTEL + | s::ExecutionMode::NamedMaximumRegistersINTEL => vec![], s::ExecutionMode::EarlyAndLateFragmentTestsAMD => { vec!["SPV_AMD_shader_early_and_late_fragment_tests"] } @@ -2191,17 +2293,19 @@ impl Operand { | s::ExecutionMode::SignedZeroInfNanPreserve | s::ExecutionMode::RoundingModeRTE | s::ExecutionMode::RoundingModeRTZ => vec!["SPV_KHR_float_controls"], + s::ExecutionMode::MaximallyReconvergesKHR => vec!["SPV_KHR_maximal_reconvergence"], s::ExecutionMode::PostDepthCoverage => vec!["SPV_KHR_post_depth_coverage"], s::ExecutionMode::SubgroupUniformControlFlowKHR => { vec!["SPV_KHR_subgroup_uniform_control_flow"] } - s::ExecutionMode::DerivativeGroupQuadsNV - | s::ExecutionMode::DerivativeGroupLinearNV => { - vec!["SPV_NV_compute_shader_derivatives"] - } - s::ExecutionMode::OutputLinesNV - | s::ExecutionMode::OutputPrimitivesNV - | s::ExecutionMode::OutputTrianglesNV => { + s::ExecutionMode::DerivativeGroupQuadsKHR + | s::ExecutionMode::DerivativeGroupLinearKHR => vec![ + "SPV_NV_compute_shader_derivatives", + "SPV_KHR_compute_shader_derivatives", + ], + s::ExecutionMode::OutputLinesEXT + | s::ExecutionMode::OutputPrimitivesEXT + | s::ExecutionMode::OutputTrianglesEXT => { vec!["SPV_NV_mesh_shader", "SPV_EXT_mesh_shader"] } }, @@ -2235,12 +2339,12 @@ impl Operand { "SPV_KHR_storage_buffer_storage_class", "SPV_KHR_variable_pointers", ], - s::StorageClass::CallableDataNV - | s::StorageClass::IncomingCallableDataNV - | s::StorageClass::RayPayloadNV - | s::StorageClass::HitAttributeNV - | s::StorageClass::IncomingRayPayloadNV - | s::StorageClass::ShaderRecordBufferNV => { + s::StorageClass::CallableDataKHR + | s::StorageClass::IncomingCallableDataKHR + | s::StorageClass::RayPayloadKHR + | s::StorageClass::HitAttributeKHR + | s::StorageClass::IncomingRayPayloadKHR + | s::StorageClass::ShaderRecordBufferKHR => { vec!["SPV_NV_ray_tracing", "SPV_KHR_ray_tracing"] } }, @@ -2349,7 +2453,8 @@ impl Operand { | s::ImageChannelDataType::UnormInt24 | s::ImageChannelDataType::UnormInt101010_2 | s::ImageChannelDataType::UnsignedIntRaw10EXT - | s::ImageChannelDataType::UnsignedIntRaw12EXT => vec![], + | s::ImageChannelDataType::UnsignedIntRaw12EXT + | s::ImageChannelDataType::UnormInt2_101010EXT => vec![], }, Self::FPRoundingMode(v) => match v { s::FPRoundingMode::RTE @@ -2545,7 +2650,7 @@ impl Operand { ], s::Decoration::PassthroughNV => vec!["SPV_NV_geometry_shader_passthrough"], s::Decoration::PerViewNV => vec!["SPV_NV_mesh_shader"], - s::Decoration::PerPrimitiveNV | s::Decoration::PerTaskNV => { + s::Decoration::PerPrimitiveEXT | s::Decoration::PerTaskNV => { vec!["SPV_NV_mesh_shader", "SPV_EXT_mesh_shader"] } s::Decoration::OverrideCoverageNV => vec!["SPV_NV_sample_mask_override_coverage"], @@ -2553,6 +2658,7 @@ impl Operand { s::Decoration::WeightTextureQCOM | s::Decoration::BlockMatchTextureQCOM => { vec!["SPV_QCOM_image_processing"] } + s::Decoration::BlockMatchSamplerQCOM => vec!["SPV_QCOM_image_processing2"], }, Self::BuiltIn(v) => match v { s::BuiltIn::Position @@ -2663,19 +2769,19 @@ impl Operand { | s::BuiltIn::MeshViewCountNV | s::BuiltIn::MeshViewIndicesNV => vec!["SPV_NV_mesh_shader"], s::BuiltIn::HitTNV => vec!["SPV_NV_ray_tracing"], - s::BuiltIn::LaunchIdNV - | s::BuiltIn::LaunchSizeNV - | s::BuiltIn::WorldRayOriginNV - | s::BuiltIn::WorldRayDirectionNV - | s::BuiltIn::ObjectRayOriginNV - | s::BuiltIn::ObjectRayDirectionNV - | s::BuiltIn::RayTminNV - | s::BuiltIn::RayTmaxNV - | s::BuiltIn::InstanceCustomIndexNV - | s::BuiltIn::ObjectToWorldNV - | s::BuiltIn::WorldToObjectNV - | s::BuiltIn::HitKindNV - | s::BuiltIn::IncomingRayFlagsNV => { + s::BuiltIn::LaunchIdKHR + | s::BuiltIn::LaunchSizeKHR + | s::BuiltIn::WorldRayOriginKHR + | s::BuiltIn::WorldRayDirectionKHR + | s::BuiltIn::ObjectRayOriginKHR + | s::BuiltIn::ObjectRayDirectionKHR + | s::BuiltIn::RayTminKHR + | s::BuiltIn::RayTmaxKHR + | s::BuiltIn::InstanceCustomIndexKHR + | s::BuiltIn::ObjectToWorldKHR + | s::BuiltIn::WorldToObjectKHR + | s::BuiltIn::HitKindKHR + | s::BuiltIn::IncomingRayFlagsKHR => { vec!["SPV_NV_ray_tracing", "SPV_KHR_ray_tracing"] } s::BuiltIn::CurrentRayTimeNV => vec!["SPV_NV_ray_tracing_motion_blur"], @@ -2808,6 +2914,9 @@ impl Operand { s::Capability::FragmentMaskAMD => vec!["SPV_AMD_shader_fragment_mask"], s::Capability::ImageReadWriteLodAMD => vec!["SPV_AMD_shader_image_load_store_lod"], s::Capability::ImageGatherBiasLodAMD => vec!["SPV_AMD_texture_gather_bias_lod"], + s::Capability::CooperativeMatrixLayoutsARM => { + vec!["SPV_ARM_cooperative_matrix_layouts"] + } s::Capability::CoreBuiltinsARM => vec!["SPV_ARM_core_builtins"], s::Capability::FragmentFullyCoveredEXT => vec!["SPV_EXT_fragment_fully_covered"], s::Capability::FragmentDensityEXT => { @@ -2824,6 +2933,7 @@ impl Operand { "SPV_EXT_physical_storage_buffer", "SPV_KHR_physical_storage_buffer", ], + s::Capability::ReplicatedCompositesEXT => vec!["SPV_EXT_replicated_composites"], s::Capability::AtomicFloat16AddEXT => vec!["SPV_EXT_shader_atomic_float16_add"], s::Capability::AtomicFloat32AddEXT | s::Capability::AtomicFloat64AddEXT => { vec!["SPV_EXT_shader_atomic_float_add"] @@ -2899,6 +3009,8 @@ impl Operand { | s::Capability::FPGAKernelAttributesv2INTEL => vec!["SPV_INTEL_kernel_attributes"], s::Capability::LongCompositesINTEL => vec!["SPV_INTEL_long_composites"], s::Capability::LoopFuseINTEL => vec!["SPV_INTEL_loop_fuse"], + s::Capability::MaskedGatherScatterINTEL => vec!["SPV_INTEL_masked_gather_scatter"], + s::Capability::RegisterLimitsINTEL => vec!["SPV_INTEL_maximum_registers"], s::Capability::SubgroupImageMediaBlockIOINTEL => vec!["SPV_INTEL_media_block_io"], s::Capability::MemoryAccessAliasingINTEL => { vec!["SPV_INTEL_memory_access_aliasing"] @@ -2909,6 +3021,9 @@ impl Operand { vec!["SPV_INTEL_shader_integer_functions2"] } s::Capability::SplitBarrierINTEL => vec!["SPV_INTEL_split_barrier"], + s::Capability::SubgroupBufferPrefetchINTEL => { + vec!["SPV_INTEL_subgroup_buffer_prefetch"] + } s::Capability::SubgroupShuffleINTEL | s::Capability::SubgroupBufferBlockIOINTEL | s::Capability::SubgroupImageBlockIOINTEL => vec!["SPV_INTEL_subgroups"], @@ -2936,9 +3051,11 @@ impl Operand { | s::Capability::SignedZeroInfNanPreserve | s::Capability::RoundingModeRTE | s::Capability::RoundingModeRTZ => vec!["SPV_KHR_float_controls"], + s::Capability::FloatControls2 => vec!["SPV_KHR_float_controls2"], s::Capability::FragmentShadingRateKHR => vec!["SPV_KHR_fragment_shading_rate"], s::Capability::MultiView => vec!["SPV_KHR_multiview"], s::Capability::SampleMaskPostDepthCoverage => vec!["SPV_KHR_post_depth_coverage"], + s::Capability::QuadControlKHR => vec!["SPV_KHR_quad_control"], s::Capability::RayCullMaskKHR => vec!["SPV_KHR_ray_cull_mask"], s::Capability::RayQueryProvisionalKHR | s::Capability::RayQueryKHR => { vec!["SPV_KHR_ray_query"] @@ -2962,6 +3079,7 @@ impl Operand { s::Capability::GroupUniformArithmeticKHR => { vec!["SPV_KHR_uniform_group_instructions"] } + s::Capability::UntypedPointersKHR => vec!["SPV_KHR_untyped_pointers"], s::Capability::VariablePointersStorageBuffer | s::Capability::VariablePointers => { vec!["SPV_KHR_variable_pointers"] } @@ -2972,10 +3090,11 @@ impl Operand { } s::Capability::PerViewAttributesNV => vec!["SPV_NVX_multiview_per_view_attributes"], s::Capability::BindlessTextureNV => vec!["SPV_NV_bindless_texture"], - s::Capability::ComputeDerivativeGroupQuadsNV - | s::Capability::ComputeDerivativeGroupLinearNV => { - vec!["SPV_NV_compute_shader_derivatives"] - } + s::Capability::ComputeDerivativeGroupQuadsKHR + | s::Capability::ComputeDerivativeGroupLinearKHR => vec![ + "SPV_NV_compute_shader_derivatives", + "SPV_KHR_compute_shader_derivatives", + ], s::Capability::CooperativeMatrixNV => vec!["SPV_NV_cooperative_matrix"], s::Capability::DisplacementMicromapNV | s::Capability::RayTracingDisplacementMicromapNV => { @@ -2989,11 +3108,13 @@ impl Operand { vec!["SPV_NV_geometry_shader_passthrough"] } s::Capability::MeshShadingNV => vec!["SPV_NV_mesh_shader"], + s::Capability::RawAccessChainsNV => vec!["SPV_NV_raw_access_chains"], s::Capability::RayTracingNV => vec!["SPV_NV_ray_tracing"], s::Capability::RayTracingMotionBlurNV => vec!["SPV_NV_ray_tracing_motion_blur"], s::Capability::SampleMaskOverrideCoverageNV => { vec!["SPV_NV_sample_mask_override_coverage"] } + s::Capability::AtomicFloat16VectorNV => vec!["SPV_NV_shader_atomic_fp16_vector"], s::Capability::ImageFootprintNV => vec!["SPV_NV_shader_image_footprint"], s::Capability::ShaderInvocationReorderNV => { vec!["SPV_NV_shader_invocation_reorder"] @@ -3007,6 +3128,7 @@ impl Operand { s::Capability::TextureSampleWeightedQCOM | s::Capability::TextureBoxFilterQCOM | s::Capability::TextureBlockMatchQCOM => vec!["SPV_QCOM_image_processing"], + s::Capability::TextureBlockMatch2QCOM => vec!["SPV_QCOM_image_processing2"], }, Self::RayQueryIntersection(v) => match v { s::RayQueryIntersection::RayQueryCandidateIntersectionKHR @@ -3030,7 +3152,9 @@ impl Operand { }, Self::CooperativeMatrixLayout(v) => match v { s::CooperativeMatrixLayout::RowMajorKHR - | s::CooperativeMatrixLayout::ColumnMajorKHR => vec![], + | s::CooperativeMatrixLayout::ColumnMajorKHR + | s::CooperativeMatrixLayout::RowBlockedInterleavedARM + | s::CooperativeMatrixLayout::ColumnBlockedInterleavedARM => vec![], }, Self::CooperativeMatrixUse(v) => match v { s::CooperativeMatrixUse::MatrixAKHR @@ -3054,6 +3178,9 @@ impl Operand { | s::StoreCacheControl::WriteBackINTEL | s::StoreCacheControl::StreamingINTEL => vec![], }, + Self::NamedMaximumNumberOfRegisters(v) => match v { + s::NamedMaximumNumberOfRegisters::AutoINTEL => vec![], + }, _ => vec![], } } @@ -3204,6 +3331,10 @@ impl Operand { result } Self::ExecutionMode(v) => match v { + s::ExecutionMode::MaximumRegistersIdINTEL => vec![crate::grammar::LogicalOperand { + kind: crate::grammar::OperandKind::IdRef, + quantifier: crate::grammar::OperandQuantifier::One, + }], s::ExecutionMode::MaxNodeRecursionAMDX => vec![crate::grammar::LogicalOperand { kind: crate::grammar::OperandKind::IdRef, quantifier: crate::grammar::OperandQuantifier::One, @@ -3216,6 +3347,16 @@ impl Operand { kind: crate::grammar::OperandKind::IdRef, quantifier: crate::grammar::OperandQuantifier::One, }], + s::ExecutionMode::FPFastMathDefault => vec![ + crate::grammar::LogicalOperand { + kind: crate::grammar::OperandKind::IdRef, + quantifier: crate::grammar::OperandQuantifier::One, + }, + crate::grammar::LogicalOperand { + kind: crate::grammar::OperandKind::IdRef, + quantifier: crate::grammar::OperandQuantifier::One, + }, + ], s::ExecutionMode::LocalSizeHintId => vec![ crate::grammar::LogicalOperand { kind: crate::grammar::OperandKind::IdRef, @@ -3254,7 +3395,11 @@ impl Operand { kind: crate::grammar::OperandKind::LiteralInteger, quantifier: crate::grammar::OperandQuantifier::One, }], - s::ExecutionMode::OutputPrimitivesNV => vec![crate::grammar::LogicalOperand { + s::ExecutionMode::MaximumRegistersINTEL => vec![crate::grammar::LogicalOperand { + kind: crate::grammar::OperandKind::LiteralInteger, + quantifier: crate::grammar::OperandQuantifier::One, + }], + s::ExecutionMode::OutputPrimitivesEXT => vec![crate::grammar::LogicalOperand { kind: crate::grammar::OperandKind::LiteralInteger, quantifier: crate::grammar::OperandQuantifier::One, }], @@ -3346,6 +3491,12 @@ impl Operand { quantifier: crate::grammar::OperandQuantifier::One, }, ], + s::ExecutionMode::NamedMaximumRegistersINTEL => { + vec![crate::grammar::LogicalOperand { + kind: crate::grammar::OperandKind::NamedMaximumNumberOfRegisters, + quantifier: crate::grammar::OperandQuantifier::One, + }] + } _ => vec![], }, Self::Decoration(v) => match v { diff --git a/rspirv/dr/build/autogen_constant.rs b/rspirv/dr/build/autogen_constant.rs index 0b57a275..ba18a77a 100644 --- a/rspirv/dr/build/autogen_constant.rs +++ b/rspirv/dr/build/autogen_constant.rs @@ -134,4 +134,38 @@ impl Builder { self.module.types_global_values.push(inst); id } + #[doc = "Appends an OpConstantCompositeReplicateEXT instruction."] + pub fn constant_composite_replicate_ext( + &mut self, + result_type: spirv::Word, + value: spirv::Word, + ) -> spirv::Word { + let id = self.id(); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::ConstantCompositeReplicateEXT, + Some(result_type), + Some(id), + vec![dr::Operand::IdRef(value)], + ); + self.module.types_global_values.push(inst); + id + } + #[doc = "Appends an OpSpecConstantCompositeReplicateEXT instruction."] + pub fn spec_constant_composite_replicate_ext( + &mut self, + result_type: spirv::Word, + value: spirv::Word, + ) -> spirv::Word { + let id = self.id(); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::SpecConstantCompositeReplicateEXT, + Some(result_type), + Some(id), + vec![dr::Operand::IdRef(value)], + ); + self.module.types_global_values.push(inst); + id + } } diff --git a/rspirv/dr/build/autogen_norm_insts.rs b/rspirv/dr/build/autogen_norm_insts.rs index 680c182d..747e8e6b 100644 --- a/rspirv/dr/build/autogen_norm_insts.rs +++ b/rspirv/dr/build/autogen_norm_insts.rs @@ -12278,6 +12278,149 @@ impl Builder { self.insert_into_block(insert_point, inst)?; Ok(_id) } + #[doc = "Appends an OpUntypedVariableKHR instruction to the current block."] + pub fn untyped_variable_khr( + &mut self, + result_type: spirv::Word, + result_id: Option, + storage_class: spirv::StorageClass, + data_type: Option, + initializer: Option, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::UntypedVariableKHR, + Some(result_type), + Some(_id), + vec![dr::Operand::StorageClass(storage_class)], + ); + if let Some(v) = data_type { + inst.operands.push(dr::Operand::IdRef(v)); + } + if let Some(v) = initializer { + inst.operands.push(dr::Operand::IdRef(v)); + } + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpUntypedVariableKHR instruction to the current block."] + pub fn insert_untyped_variable_khr( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + storage_class: spirv::StorageClass, + data_type: Option, + initializer: Option, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::UntypedVariableKHR, + Some(result_type), + Some(_id), + vec![dr::Operand::StorageClass(storage_class)], + ); + if let Some(v) = data_type { + inst.operands.push(dr::Operand::IdRef(v)); + } + if let Some(v) = initializer { + inst.operands.push(dr::Operand::IdRef(v)); + } + self.insert_into_block(insert_point, inst)?; + Ok(_id) + } + #[doc = "Appends an OpUntypedAccessChainKHR instruction to the current block."] + pub fn untyped_access_chain_khr( + &mut self, + result_type: spirv::Word, + result_id: Option, + base_type: spirv::Word, + base: spirv::Word, + indexes: impl IntoIterator, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::UntypedAccessChainKHR, + Some(result_type), + Some(_id), + vec![dr::Operand::IdRef(base_type), dr::Operand::IdRef(base)], + ); + inst.operands + .extend(indexes.into_iter().map(dr::Operand::IdRef)); + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpUntypedAccessChainKHR instruction to the current block."] + pub fn insert_untyped_access_chain_khr( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + base_type: spirv::Word, + base: spirv::Word, + indexes: impl IntoIterator, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::UntypedAccessChainKHR, + Some(result_type), + Some(_id), + vec![dr::Operand::IdRef(base_type), dr::Operand::IdRef(base)], + ); + inst.operands + .extend(indexes.into_iter().map(dr::Operand::IdRef)); + self.insert_into_block(insert_point, inst)?; + Ok(_id) + } + #[doc = "Appends an OpUntypedInBoundsAccessChainKHR instruction to the current block."] + pub fn untyped_in_bounds_access_chain_khr( + &mut self, + result_type: spirv::Word, + result_id: Option, + base_type: spirv::Word, + base: spirv::Word, + indexes: impl IntoIterator, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::UntypedInBoundsAccessChainKHR, + Some(result_type), + Some(_id), + vec![dr::Operand::IdRef(base_type), dr::Operand::IdRef(base)], + ); + inst.operands + .extend(indexes.into_iter().map(dr::Operand::IdRef)); + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpUntypedInBoundsAccessChainKHR instruction to the current block."] + pub fn insert_untyped_in_bounds_access_chain_khr( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + base_type: spirv::Word, + base: spirv::Word, + indexes: impl IntoIterator, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::UntypedInBoundsAccessChainKHR, + Some(result_type), + Some(_id), + vec![dr::Operand::IdRef(base_type), dr::Operand::IdRef(base)], + ); + inst.operands + .extend(indexes.into_iter().map(dr::Operand::IdRef)); + 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, @@ -12352,6 +12495,228 @@ impl Builder { self.insert_into_block(insert_point, inst)?; Ok(_id) } + #[doc = "Appends an OpUntypedPtrAccessChainKHR instruction to the current block."] + pub fn untyped_ptr_access_chain_khr( + &mut self, + result_type: spirv::Word, + result_id: Option, + base_type: spirv::Word, + base: spirv::Word, + element: spirv::Word, + indexes: impl IntoIterator, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::UntypedPtrAccessChainKHR, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(base_type), + dr::Operand::IdRef(base), + dr::Operand::IdRef(element), + ], + ); + inst.operands + .extend(indexes.into_iter().map(dr::Operand::IdRef)); + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpUntypedPtrAccessChainKHR instruction to the current block."] + pub fn insert_untyped_ptr_access_chain_khr( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + base_type: spirv::Word, + base: spirv::Word, + element: spirv::Word, + indexes: impl IntoIterator, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::UntypedPtrAccessChainKHR, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(base_type), + dr::Operand::IdRef(base), + dr::Operand::IdRef(element), + ], + ); + inst.operands + .extend(indexes.into_iter().map(dr::Operand::IdRef)); + self.insert_into_block(insert_point, inst)?; + Ok(_id) + } + #[doc = "Appends an OpUntypedInBoundsPtrAccessChainKHR instruction to the current block."] + pub fn untyped_in_bounds_ptr_access_chain_khr( + &mut self, + result_type: spirv::Word, + result_id: Option, + base_type: spirv::Word, + base: spirv::Word, + element: spirv::Word, + indexes: impl IntoIterator, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::UntypedInBoundsPtrAccessChainKHR, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(base_type), + dr::Operand::IdRef(base), + dr::Operand::IdRef(element), + ], + ); + inst.operands + .extend(indexes.into_iter().map(dr::Operand::IdRef)); + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpUntypedInBoundsPtrAccessChainKHR instruction to the current block."] + pub fn insert_untyped_in_bounds_ptr_access_chain_khr( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + base_type: spirv::Word, + base: spirv::Word, + element: spirv::Word, + indexes: impl IntoIterator, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::UntypedInBoundsPtrAccessChainKHR, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(base_type), + dr::Operand::IdRef(base), + dr::Operand::IdRef(element), + ], + ); + inst.operands + .extend(indexes.into_iter().map(dr::Operand::IdRef)); + self.insert_into_block(insert_point, inst)?; + Ok(_id) + } + #[doc = "Appends an OpUntypedArrayLengthKHR instruction to the current block."] + pub fn untyped_array_length_khr( + &mut self, + result_type: spirv::Word, + result_id: Option, + structure: spirv::Word, + pointer: spirv::Word, + array_member: u32, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::UntypedArrayLengthKHR, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(structure), + dr::Operand::IdRef(pointer), + dr::Operand::LiteralBit32(array_member), + ], + ); + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpUntypedArrayLengthKHR instruction to the current block."] + pub fn insert_untyped_array_length_khr( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + structure: spirv::Word, + pointer: spirv::Word, + array_member: u32, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::UntypedArrayLengthKHR, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(structure), + dr::Operand::IdRef(pointer), + dr::Operand::LiteralBit32(array_member), + ], + ); + self.insert_into_block(insert_point, inst)?; + Ok(_id) + } + #[doc = "Appends an OpUntypedPrefetchKHR instruction to the current block."] + pub fn untyped_prefetch_khr( + &mut self, + pointer_type: spirv::Word, + num_bytes: spirv::Word, + rw: Option, + locality: Option, + cache_type: Option, + ) -> BuildResult<()> { + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::UntypedPrefetchKHR, + None, + None, + vec![ + dr::Operand::IdRef(pointer_type), + dr::Operand::IdRef(num_bytes), + ], + ); + if let Some(v) = rw { + inst.operands.push(dr::Operand::IdRef(v)); + } + if let Some(v) = locality { + inst.operands.push(dr::Operand::IdRef(v)); + } + if let Some(v) = cache_type { + inst.operands.push(dr::Operand::IdRef(v)); + } + self.insert_into_block(InsertPoint::End, inst)?; + Ok(()) + } + #[doc = "Appends an OpUntypedPrefetchKHR instruction to the current block."] + pub fn insert_untyped_prefetch_khr( + &mut self, + insert_point: InsertPoint, + pointer_type: spirv::Word, + num_bytes: spirv::Word, + rw: Option, + locality: Option, + cache_type: Option, + ) -> BuildResult<()> { + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::UntypedPrefetchKHR, + None, + None, + vec![ + dr::Operand::IdRef(pointer_type), + dr::Operand::IdRef(num_bytes), + ], + ); + if let Some(v) = rw { + inst.operands.push(dr::Operand::IdRef(v)); + } + if let Some(v) = locality { + inst.operands.push(dr::Operand::IdRef(v)); + } + if let Some(v) = cache_type { + inst.operands.push(dr::Operand::IdRef(v)); + } + self.insert_into_block(insert_point, inst)?; + Ok(()) + } #[doc = "Appends an OpSubgroupAllKHR instruction to the current block."] pub fn subgroup_all_khr( &mut self, @@ -13558,6 +13923,43 @@ impl Builder { self.insert_into_block(insert_point, inst)?; Ok(_id) } + #[doc = "Appends an OpCompositeConstructReplicateEXT instruction to the current block."] + pub fn composite_construct_replicate_ext( + &mut self, + result_type: spirv::Word, + result_id: Option, + value: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::CompositeConstructReplicateEXT, + Some(result_type), + Some(_id), + vec![dr::Operand::IdRef(value)], + ); + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpCompositeConstructReplicateEXT instruction to the current block."] + pub fn insert_composite_construct_replicate_ext( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + value: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::CompositeConstructReplicateEXT, + Some(result_type), + Some(_id), + vec![dr::Operand::IdRef(value)], + ); + 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, @@ -13844,76 +14246,304 @@ impl Builder { self.insert_into_block(insert_point, inst)?; Ok(_id) } - #[doc = "Appends an OpImageBoxFilterQCOM instruction to the current block."] - pub fn image_box_filter_qcom( + #[doc = "Appends an OpImageBoxFilterQCOM instruction to the current block."] + pub fn image_box_filter_qcom( + &mut self, + result_type: spirv::Word, + result_id: Option, + texture: spirv::Word, + coordinates: spirv::Word, + box_size: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::ImageBoxFilterQCOM, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(texture), + dr::Operand::IdRef(coordinates), + dr::Operand::IdRef(box_size), + ], + ); + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpImageBoxFilterQCOM instruction to the current block."] + pub fn insert_image_box_filter_qcom( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + texture: spirv::Word, + coordinates: spirv::Word, + box_size: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::ImageBoxFilterQCOM, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(texture), + dr::Operand::IdRef(coordinates), + dr::Operand::IdRef(box_size), + ], + ); + self.insert_into_block(insert_point, inst)?; + Ok(_id) + } + #[doc = "Appends an OpImageBlockMatchSSDQCOM instruction to the current block."] + pub fn image_block_match_ssdqcom( + &mut self, + result_type: spirv::Word, + result_id: Option, + target: spirv::Word, + target_coordinates: spirv::Word, + reference: spirv::Word, + reference_coordinates: spirv::Word, + block_size: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::ImageBlockMatchSSDQCOM, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(target), + dr::Operand::IdRef(target_coordinates), + dr::Operand::IdRef(reference), + dr::Operand::IdRef(reference_coordinates), + dr::Operand::IdRef(block_size), + ], + ); + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpImageBlockMatchSSDQCOM instruction to the current block."] + pub fn insert_image_block_match_ssdqcom( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + target: spirv::Word, + target_coordinates: spirv::Word, + reference: spirv::Word, + reference_coordinates: spirv::Word, + block_size: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::ImageBlockMatchSSDQCOM, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(target), + dr::Operand::IdRef(target_coordinates), + dr::Operand::IdRef(reference), + dr::Operand::IdRef(reference_coordinates), + dr::Operand::IdRef(block_size), + ], + ); + self.insert_into_block(insert_point, inst)?; + Ok(_id) + } + #[doc = "Appends an OpImageBlockMatchSADQCOM instruction to the current block."] + pub fn image_block_match_sadqcom( + &mut self, + result_type: spirv::Word, + result_id: Option, + target: spirv::Word, + target_coordinates: spirv::Word, + reference: spirv::Word, + reference_coordinates: spirv::Word, + block_size: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::ImageBlockMatchSADQCOM, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(target), + dr::Operand::IdRef(target_coordinates), + dr::Operand::IdRef(reference), + dr::Operand::IdRef(reference_coordinates), + dr::Operand::IdRef(block_size), + ], + ); + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpImageBlockMatchSADQCOM instruction to the current block."] + pub fn insert_image_block_match_sadqcom( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + target: spirv::Word, + target_coordinates: spirv::Word, + reference: spirv::Word, + reference_coordinates: spirv::Word, + block_size: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::ImageBlockMatchSADQCOM, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(target), + dr::Operand::IdRef(target_coordinates), + dr::Operand::IdRef(reference), + dr::Operand::IdRef(reference_coordinates), + dr::Operand::IdRef(block_size), + ], + ); + self.insert_into_block(insert_point, inst)?; + Ok(_id) + } + #[doc = "Appends an OpImageBlockMatchWindowSSDQCOM instruction to the current block."] + pub fn image_block_match_window_ssdqcom( + &mut self, + result_type: spirv::Word, + result_id: Option, + target_sampled_image: spirv::Word, + target_coordinates: spirv::Word, + reference_sampled_image: spirv::Word, + reference_coordinates: spirv::Word, + block_size: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::ImageBlockMatchWindowSSDQCOM, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(target_sampled_image), + dr::Operand::IdRef(target_coordinates), + dr::Operand::IdRef(reference_sampled_image), + dr::Operand::IdRef(reference_coordinates), + dr::Operand::IdRef(block_size), + ], + ); + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpImageBlockMatchWindowSSDQCOM instruction to the current block."] + pub fn insert_image_block_match_window_ssdqcom( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + target_sampled_image: spirv::Word, + target_coordinates: spirv::Word, + reference_sampled_image: spirv::Word, + reference_coordinates: spirv::Word, + block_size: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::ImageBlockMatchWindowSSDQCOM, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(target_sampled_image), + dr::Operand::IdRef(target_coordinates), + dr::Operand::IdRef(reference_sampled_image), + dr::Operand::IdRef(reference_coordinates), + dr::Operand::IdRef(block_size), + ], + ); + self.insert_into_block(insert_point, inst)?; + Ok(_id) + } + #[doc = "Appends an OpImageBlockMatchWindowSADQCOM instruction to the current block."] + pub fn image_block_match_window_sadqcom( &mut self, result_type: spirv::Word, result_id: Option, - texture: spirv::Word, - coordinates: spirv::Word, - box_size: spirv::Word, + target_sampled_image: spirv::Word, + target_coordinates: spirv::Word, + reference_sampled_image: spirv::Word, + reference_coordinates: spirv::Word, + block_size: spirv::Word, ) -> BuildResult { let _id = result_id.unwrap_or_else(|| self.id()); #[allow(unused_mut)] let mut inst = dr::Instruction::new( - spirv::Op::ImageBoxFilterQCOM, + spirv::Op::ImageBlockMatchWindowSADQCOM, Some(result_type), Some(_id), vec![ - dr::Operand::IdRef(texture), - dr::Operand::IdRef(coordinates), - dr::Operand::IdRef(box_size), + dr::Operand::IdRef(target_sampled_image), + dr::Operand::IdRef(target_coordinates), + dr::Operand::IdRef(reference_sampled_image), + dr::Operand::IdRef(reference_coordinates), + dr::Operand::IdRef(block_size), ], ); self.insert_into_block(InsertPoint::End, inst)?; Ok(_id) } - #[doc = "Appends an OpImageBoxFilterQCOM instruction to the current block."] - pub fn insert_image_box_filter_qcom( + #[doc = "Appends an OpImageBlockMatchWindowSADQCOM instruction to the current block."] + pub fn insert_image_block_match_window_sadqcom( &mut self, insert_point: InsertPoint, result_type: spirv::Word, result_id: Option, - texture: spirv::Word, - coordinates: spirv::Word, - box_size: spirv::Word, + target_sampled_image: spirv::Word, + target_coordinates: spirv::Word, + reference_sampled_image: spirv::Word, + reference_coordinates: spirv::Word, + block_size: spirv::Word, ) -> BuildResult { let _id = result_id.unwrap_or_else(|| self.id()); #[allow(unused_mut)] let mut inst = dr::Instruction::new( - spirv::Op::ImageBoxFilterQCOM, + spirv::Op::ImageBlockMatchWindowSADQCOM, Some(result_type), Some(_id), vec![ - dr::Operand::IdRef(texture), - dr::Operand::IdRef(coordinates), - dr::Operand::IdRef(box_size), + dr::Operand::IdRef(target_sampled_image), + dr::Operand::IdRef(target_coordinates), + dr::Operand::IdRef(reference_sampled_image), + dr::Operand::IdRef(reference_coordinates), + dr::Operand::IdRef(block_size), ], ); self.insert_into_block(insert_point, inst)?; Ok(_id) } - #[doc = "Appends an OpImageBlockMatchSSDQCOM instruction to the current block."] - pub fn image_block_match_ssdqcom( + #[doc = "Appends an OpImageBlockMatchGatherSSDQCOM instruction to the current block."] + pub fn image_block_match_gather_ssdqcom( &mut self, result_type: spirv::Word, result_id: Option, - target: spirv::Word, + target_sampled_image: spirv::Word, target_coordinates: spirv::Word, - reference: spirv::Word, + reference_sampled_image: spirv::Word, reference_coordinates: spirv::Word, block_size: spirv::Word, ) -> BuildResult { let _id = result_id.unwrap_or_else(|| self.id()); #[allow(unused_mut)] let mut inst = dr::Instruction::new( - spirv::Op::ImageBlockMatchSSDQCOM, + spirv::Op::ImageBlockMatchGatherSSDQCOM, Some(result_type), Some(_id), vec![ - dr::Operand::IdRef(target), + dr::Operand::IdRef(target_sampled_image), dr::Operand::IdRef(target_coordinates), - dr::Operand::IdRef(reference), + dr::Operand::IdRef(reference_sampled_image), dr::Operand::IdRef(reference_coordinates), dr::Operand::IdRef(block_size), ], @@ -13921,28 +14551,28 @@ impl Builder { self.insert_into_block(InsertPoint::End, inst)?; Ok(_id) } - #[doc = "Appends an OpImageBlockMatchSSDQCOM instruction to the current block."] - pub fn insert_image_block_match_ssdqcom( + #[doc = "Appends an OpImageBlockMatchGatherSSDQCOM instruction to the current block."] + pub fn insert_image_block_match_gather_ssdqcom( &mut self, insert_point: InsertPoint, result_type: spirv::Word, result_id: Option, - target: spirv::Word, + target_sampled_image: spirv::Word, target_coordinates: spirv::Word, - reference: spirv::Word, + reference_sampled_image: spirv::Word, reference_coordinates: spirv::Word, block_size: spirv::Word, ) -> BuildResult { let _id = result_id.unwrap_or_else(|| self.id()); #[allow(unused_mut)] let mut inst = dr::Instruction::new( - spirv::Op::ImageBlockMatchSSDQCOM, + spirv::Op::ImageBlockMatchGatherSSDQCOM, Some(result_type), Some(_id), vec![ - dr::Operand::IdRef(target), + dr::Operand::IdRef(target_sampled_image), dr::Operand::IdRef(target_coordinates), - dr::Operand::IdRef(reference), + dr::Operand::IdRef(reference_sampled_image), dr::Operand::IdRef(reference_coordinates), dr::Operand::IdRef(block_size), ], @@ -13950,27 +14580,27 @@ impl Builder { self.insert_into_block(insert_point, inst)?; Ok(_id) } - #[doc = "Appends an OpImageBlockMatchSADQCOM instruction to the current block."] - pub fn image_block_match_sadqcom( + #[doc = "Appends an OpImageBlockMatchGatherSADQCOM instruction to the current block."] + pub fn image_block_match_gather_sadqcom( &mut self, result_type: spirv::Word, result_id: Option, - target: spirv::Word, + target_sampled_image: spirv::Word, target_coordinates: spirv::Word, - reference: spirv::Word, + reference_sampled_image: spirv::Word, reference_coordinates: spirv::Word, block_size: spirv::Word, ) -> BuildResult { let _id = result_id.unwrap_or_else(|| self.id()); #[allow(unused_mut)] let mut inst = dr::Instruction::new( - spirv::Op::ImageBlockMatchSADQCOM, + spirv::Op::ImageBlockMatchGatherSADQCOM, Some(result_type), Some(_id), vec![ - dr::Operand::IdRef(target), + dr::Operand::IdRef(target_sampled_image), dr::Operand::IdRef(target_coordinates), - dr::Operand::IdRef(reference), + dr::Operand::IdRef(reference_sampled_image), dr::Operand::IdRef(reference_coordinates), dr::Operand::IdRef(block_size), ], @@ -13978,28 +14608,28 @@ impl Builder { self.insert_into_block(InsertPoint::End, inst)?; Ok(_id) } - #[doc = "Appends an OpImageBlockMatchSADQCOM instruction to the current block."] - pub fn insert_image_block_match_sadqcom( + #[doc = "Appends an OpImageBlockMatchGatherSADQCOM instruction to the current block."] + pub fn insert_image_block_match_gather_sadqcom( &mut self, insert_point: InsertPoint, result_type: spirv::Word, result_id: Option, - target: spirv::Word, + target_sampled_image: spirv::Word, target_coordinates: spirv::Word, - reference: spirv::Word, + reference_sampled_image: spirv::Word, reference_coordinates: spirv::Word, block_size: spirv::Word, ) -> BuildResult { let _id = result_id.unwrap_or_else(|| self.id()); #[allow(unused_mut)] let mut inst = dr::Instruction::new( - spirv::Op::ImageBlockMatchSADQCOM, + spirv::Op::ImageBlockMatchGatherSADQCOM, Some(result_type), Some(_id), vec![ - dr::Operand::IdRef(target), + dr::Operand::IdRef(target_sampled_image), dr::Operand::IdRef(target_coordinates), - dr::Operand::IdRef(reference), + dr::Operand::IdRef(reference_sampled_image), dr::Operand::IdRef(reference_coordinates), dr::Operand::IdRef(block_size), ], @@ -14636,6 +15266,80 @@ impl Builder { self.insert_into_block(insert_point, inst)?; Ok(()) } + #[doc = "Appends an OpGroupNonUniformQuadAllKHR instruction to the current block."] + pub fn group_non_uniform_quad_all_khr( + &mut self, + result_type: spirv::Word, + result_id: Option, + predicate: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::GroupNonUniformQuadAllKHR, + Some(result_type), + Some(_id), + vec![dr::Operand::IdRef(predicate)], + ); + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpGroupNonUniformQuadAllKHR instruction to the current block."] + pub fn insert_group_non_uniform_quad_all_khr( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + predicate: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::GroupNonUniformQuadAllKHR, + Some(result_type), + Some(_id), + vec![dr::Operand::IdRef(predicate)], + ); + self.insert_into_block(insert_point, inst)?; + Ok(_id) + } + #[doc = "Appends an OpGroupNonUniformQuadAnyKHR instruction to the current block."] + pub fn group_non_uniform_quad_any_khr( + &mut self, + result_type: spirv::Word, + result_id: Option, + predicate: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::GroupNonUniformQuadAnyKHR, + Some(result_type), + Some(_id), + vec![dr::Operand::IdRef(predicate)], + ); + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpGroupNonUniformQuadAnyKHR instruction to the current block."] + pub fn insert_group_non_uniform_quad_any_khr( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + predicate: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::GroupNonUniformQuadAnyKHR, + Some(result_type), + Some(_id), + vec![dr::Operand::IdRef(predicate)], + ); + self.insert_into_block(insert_point, inst)?; + Ok(_id) + } #[doc = "Appends an OpHitObjectRecordHitMotionNV instruction to the current block."] pub fn hit_object_record_hit_motion_nv( &mut self, @@ -17345,6 +18049,67 @@ impl Builder { self.insert_into_block(insert_point, inst)?; Ok(_id) } + #[doc = "Appends an OpRawAccessChainNV instruction to the current block."] + pub fn raw_access_chain_nv( + &mut self, + result_type: spirv::Word, + result_id: Option, + base: spirv::Word, + byte_stride: spirv::Word, + element_index: spirv::Word, + byte_offset: spirv::Word, + raw_access_chain_operands: Option, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::RawAccessChainNV, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(base), + dr::Operand::IdRef(byte_stride), + dr::Operand::IdRef(element_index), + dr::Operand::IdRef(byte_offset), + ], + ); + if let Some(v) = raw_access_chain_operands { + inst.operands.push(dr::Operand::RawAccessChainOperands(v)); + } + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpRawAccessChainNV instruction to the current block."] + pub fn insert_raw_access_chain_nv( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + base: spirv::Word, + byte_stride: spirv::Word, + element_index: spirv::Word, + byte_offset: spirv::Word, + raw_access_chain_operands: Option, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::RawAccessChainNV, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(base), + dr::Operand::IdRef(byte_stride), + dr::Operand::IdRef(element_index), + dr::Operand::IdRef(byte_offset), + ], + ); + if let Some(v) = raw_access_chain_operands { + inst.operands.push(dr::Operand::RawAccessChainOperands(v)); + } + self.insert_into_block(insert_point, inst)?; + Ok(_id) + } #[doc = "Appends an OpSubgroupShuffleINTEL instruction to the current block."] pub fn subgroup_shuffle_intel( &mut self, @@ -19637,6 +20402,51 @@ impl Builder { self.insert_into_block(insert_point, inst)?; Ok(()) } + #[doc = "Appends an OpSubgroupBlockPrefetchINTEL instruction to the current block."] + pub fn subgroup_block_prefetch_intel( + &mut self, + ptr: spirv::Word, + num_bytes: spirv::Word, + memory_access: Option, + additional_params: impl IntoIterator, + ) -> BuildResult<()> { + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::SubgroupBlockPrefetchINTEL, + None, + None, + vec![dr::Operand::IdRef(ptr), dr::Operand::IdRef(num_bytes)], + ); + if let Some(v) = memory_access { + inst.operands.push(dr::Operand::MemoryAccess(v)); + } + inst.operands.extend(additional_params); + self.insert_into_block(InsertPoint::End, inst)?; + Ok(()) + } + #[doc = "Appends an OpSubgroupBlockPrefetchINTEL instruction to the current block."] + pub fn insert_subgroup_block_prefetch_intel( + &mut self, + insert_point: InsertPoint, + ptr: spirv::Word, + num_bytes: spirv::Word, + memory_access: Option, + additional_params: impl IntoIterator, + ) -> BuildResult<()> { + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::SubgroupBlockPrefetchINTEL, + None, + None, + vec![dr::Operand::IdRef(ptr), dr::Operand::IdRef(num_bytes)], + ); + if let Some(v) = memory_access { + inst.operands.push(dr::Operand::MemoryAccess(v)); + } + inst.operands.extend(additional_params); + self.insert_into_block(insert_point, inst)?; + Ok(()) + } #[doc = "Appends an OpGroupIMulKHR instruction to the current block."] pub fn group_i_mul_khr( &mut self, @@ -20029,4 +20839,104 @@ impl Builder { self.insert_into_block(insert_point, inst)?; Ok(_id) } + #[doc = "Appends an OpMaskedGatherINTEL instruction to the current block."] + pub fn masked_gather_intel( + &mut self, + result_type: spirv::Word, + result_id: Option, + ptr_vector: spirv::Word, + alignment: u32, + mask: spirv::Word, + fill_empty: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::MaskedGatherINTEL, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(ptr_vector), + dr::Operand::LiteralBit32(alignment), + dr::Operand::IdRef(mask), + dr::Operand::IdRef(fill_empty), + ], + ); + self.insert_into_block(InsertPoint::End, inst)?; + Ok(_id) + } + #[doc = "Appends an OpMaskedGatherINTEL instruction to the current block."] + pub fn insert_masked_gather_intel( + &mut self, + insert_point: InsertPoint, + result_type: spirv::Word, + result_id: Option, + ptr_vector: spirv::Word, + alignment: u32, + mask: spirv::Word, + fill_empty: spirv::Word, + ) -> BuildResult { + let _id = result_id.unwrap_or_else(|| self.id()); + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::MaskedGatherINTEL, + Some(result_type), + Some(_id), + vec![ + dr::Operand::IdRef(ptr_vector), + dr::Operand::LiteralBit32(alignment), + dr::Operand::IdRef(mask), + dr::Operand::IdRef(fill_empty), + ], + ); + self.insert_into_block(insert_point, inst)?; + Ok(_id) + } + #[doc = "Appends an OpMaskedScatterINTEL instruction to the current block."] + pub fn masked_scatter_intel( + &mut self, + input_vector: spirv::Word, + ptr_vector: spirv::Word, + alignment: u32, + mask: spirv::Word, + ) -> BuildResult<()> { + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::MaskedScatterINTEL, + None, + None, + vec![ + dr::Operand::IdRef(input_vector), + dr::Operand::IdRef(ptr_vector), + dr::Operand::LiteralBit32(alignment), + dr::Operand::IdRef(mask), + ], + ); + self.insert_into_block(InsertPoint::End, inst)?; + Ok(()) + } + #[doc = "Appends an OpMaskedScatterINTEL instruction to the current block."] + pub fn insert_masked_scatter_intel( + &mut self, + insert_point: InsertPoint, + input_vector: spirv::Word, + ptr_vector: spirv::Word, + alignment: u32, + mask: spirv::Word, + ) -> BuildResult<()> { + #[allow(unused_mut)] + let mut inst = dr::Instruction::new( + spirv::Op::MaskedScatterINTEL, + None, + None, + vec![ + dr::Operand::IdRef(input_vector), + dr::Operand::IdRef(ptr_vector), + dr::Operand::LiteralBit32(alignment), + dr::Operand::IdRef(mask), + ], + ); + self.insert_into_block(insert_point, inst)?; + Ok(()) + } } diff --git a/rspirv/dr/build/autogen_type.rs b/rspirv/dr/build/autogen_type.rs index c60b1d93..f3e5ba6d 100644 --- a/rspirv/dr/build/autogen_type.rs +++ b/rspirv/dr/build/autogen_type.rs @@ -74,17 +74,29 @@ impl Builder { } } #[doc = "Appends an OpTypeFloat instruction and returns the result id, or return the existing id if the instruction was already present."] - pub fn type_float(&mut self, width: u32) -> spirv::Word { - self.type_float_id(None, width) + pub fn type_float( + &mut self, + width: u32, + floating_point_encoding: Option, + ) -> spirv::Word { + self.type_float_id(None, width, floating_point_encoding) } #[doc = "Appends an OpTypeFloat instruction and returns the result id, or return the existing id if the instruction was already present."] - pub fn type_float_id(&mut self, result_id: Option, width: u32) -> spirv::Word { + pub fn type_float_id( + &mut self, + result_id: Option, + width: u32, + floating_point_encoding: Option, + ) -> spirv::Word { let mut inst = dr::Instruction::new( spirv::Op::TypeFloat, None, result_id, vec![dr::Operand::LiteralBit32(width)], ); + if let Some(v) = floating_point_encoding { + inst.operands.push(dr::Operand::FPEncoding(v)); + } if let Some(result_id) = result_id { self.module.types_global_values.push(inst); result_id @@ -546,6 +558,34 @@ impl Builder { new_id } } + #[doc = "Appends an OpTypeUntypedPointerKHR instruction and returns the result id, or return the existing id if the instruction was already present."] + pub fn type_untyped_pointer_khr(&mut self, storage_class: spirv::StorageClass) -> spirv::Word { + self.type_untyped_pointer_khr_id(None, storage_class) + } + #[doc = "Appends an OpTypeUntypedPointerKHR instruction and returns the result id, or return the existing id if the instruction was already present."] + pub fn type_untyped_pointer_khr_id( + &mut self, + result_id: Option, + storage_class: spirv::StorageClass, + ) -> spirv::Word { + let mut inst = dr::Instruction::new( + spirv::Op::TypeUntypedPointerKHR, + None, + result_id, + vec![dr::Operand::StorageClass(storage_class)], + ); + 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 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, diff --git a/rspirv/grammar/autogen_table.rs b/rspirv/grammar/autogen_table.rs index 22288123..378d113a 100644 --- a/rspirv/grammar/autogen_table.rs +++ b/rspirv/grammar/autogen_table.rs @@ -16,6 +16,7 @@ pub enum OperandKind { KernelProfilingInfo, RayFlags, FragmentShadingRate, + RawAccessChainOperands, SourceLanguage, ExecutionModel, AddressingModel, @@ -53,6 +54,8 @@ pub enum OperandKind { InitializationModeQualifier, LoadCacheControl, StoreCacheControl, + NamedMaximumNumberOfRegisters, + FPEncoding, IdResultType, IdResult, IdMemorySemantics, @@ -148,7 +151,16 @@ static INSTRUCTION_TABLE: &[Instruction<'static>] = &[ (LiteralInteger, One) ] ), - inst!(TypeFloat, [], [], [(IdResult, One), (LiteralInteger, One)]), + inst!( + TypeFloat, + [], + [], + [ + (IdResult, One), + (LiteralInteger, One), + (FPEncoding, ZeroOrOne) + ] + ), inst!( TypeVector, [], @@ -382,7 +394,7 @@ static INSTRUCTION_TABLE: &[Instruction<'static>] = &[ ), inst!( CopyMemorySized, - [Addresses], + [Addresses, UntypedPointersKHR], [], [ (IdRef, One), @@ -3260,6 +3272,48 @@ static INSTRUCTION_TABLE: &[Instruction<'static>] = &[ ["SPV_KHR_terminate_invocation"], [] ), + inst!( + TypeUntypedPointerKHR, + [UntypedPointersKHR], + [], + [(IdResult, One), (StorageClass, One)] + ), + inst!( + UntypedVariableKHR, + [UntypedPointersKHR], + [], + [ + (IdResultType, One), + (IdResult, One), + (StorageClass, One), + (IdRef, ZeroOrOne), + (IdRef, ZeroOrOne) + ] + ), + inst!( + UntypedAccessChainKHR, + [UntypedPointersKHR], + [], + [ + (IdResultType, One), + (IdResult, One), + (IdRef, One), + (IdRef, One), + (IdRef, ZeroOrMore) + ] + ), + inst!( + UntypedInBoundsAccessChainKHR, + [UntypedPointersKHR], + [], + [ + (IdResultType, One), + (IdResult, One), + (IdRef, One), + (IdRef, One), + (IdRef, ZeroOrMore) + ] + ), inst!( SubgroupBallotKHR, [SubgroupBallotKHR], @@ -3272,6 +3326,56 @@ static INSTRUCTION_TABLE: &[Instruction<'static>] = &[ ["SPV_KHR_shader_ballot"], [(IdResultType, One), (IdResult, One), (IdRef, One)] ), + inst!( + UntypedPtrAccessChainKHR, + [UntypedPointersKHR], + [], + [ + (IdResultType, One), + (IdResult, One), + (IdRef, One), + (IdRef, One), + (IdRef, One), + (IdRef, ZeroOrMore) + ] + ), + inst!( + UntypedInBoundsPtrAccessChainKHR, + [UntypedPointersKHR], + [], + [ + (IdResultType, One), + (IdResult, One), + (IdRef, One), + (IdRef, One), + (IdRef, One), + (IdRef, ZeroOrMore) + ] + ), + inst!( + UntypedArrayLengthKHR, + [UntypedPointersKHR], + [], + [ + (IdResultType, One), + (IdResult, One), + (IdRef, One), + (IdRef, One), + (LiteralInteger, One) + ] + ), + inst!( + UntypedPrefetchKHR, + [UntypedPointersKHR], + [], + [ + (IdRef, One), + (IdRef, One), + (IdRef, ZeroOrOne), + (IdRef, ZeroOrOne), + (IdRef, ZeroOrOne) + ] + ), inst!( SubgroupAllKHR, [SubgroupVoteKHR], @@ -3314,6 +3418,18 @@ static INSTRUCTION_TABLE: &[Instruction<'static>] = &[ (IdRef, One) ] ), + inst!( + ExtInstWithForwardRefsKHR, + [], + ["SPV_KHR_relaxed_extended_instruction"], + [ + (IdResultType, One), + (IdResult, One), + (IdRef, One), + (LiteralExtInstInteger, One), + (IdRef, ZeroOrMore) + ] + ), inst!( TraceRayKHR, [RayTracingKHR], @@ -3563,6 +3679,24 @@ static INSTRUCTION_TABLE: &[Instruction<'static>] = &[ [], [(IdResultType, One), (IdResult, One), (IdRef, One)] ), + inst!( + ConstantCompositeReplicateEXT, + [ReplicatedCompositesEXT], + [], + [(IdResultType, One), (IdResult, One), (IdRef, One)] + ), + inst!( + SpecConstantCompositeReplicateEXT, + [ReplicatedCompositesEXT], + [], + [(IdResultType, One), (IdResult, One), (IdRef, One)] + ), + inst!( + CompositeConstructReplicateEXT, + [ReplicatedCompositesEXT], + [], + [(IdResultType, One), (IdResult, One), (IdRef, One)] + ), inst!( TypeRayQueryKHR, [RayQueryKHR], @@ -3671,6 +3805,62 @@ static INSTRUCTION_TABLE: &[Instruction<'static>] = &[ (IdRef, One) ] ), + inst!( + ImageBlockMatchWindowSSDQCOM, + [TextureBlockMatch2QCOM], + [], + [ + (IdResultType, One), + (IdResult, One), + (IdRef, One), + (IdRef, One), + (IdRef, One), + (IdRef, One), + (IdRef, One) + ] + ), + inst!( + ImageBlockMatchWindowSADQCOM, + [TextureBlockMatch2QCOM], + [], + [ + (IdResultType, One), + (IdResult, One), + (IdRef, One), + (IdRef, One), + (IdRef, One), + (IdRef, One), + (IdRef, One) + ] + ), + inst!( + ImageBlockMatchGatherSSDQCOM, + [TextureBlockMatch2QCOM], + [], + [ + (IdResultType, One), + (IdResult, One), + (IdRef, One), + (IdRef, One), + (IdRef, One), + (IdRef, One), + (IdRef, One) + ] + ), + inst!( + ImageBlockMatchGatherSADQCOM, + [TextureBlockMatch2QCOM], + [], + [ + (IdResultType, One), + (IdResult, One), + (IdRef, One), + (IdRef, One), + (IdRef, One), + (IdRef, One), + (IdRef, One) + ] + ), inst!( GroupIAddNonUniformAMD, [Groups], @@ -3814,6 +4004,18 @@ static INSTRUCTION_TABLE: &[Instruction<'static>] = &[ [], [(IdRef, One), (IdScope, One), (IdRef, One), (IdRef, One)] ), + inst!( + GroupNonUniformQuadAllKHR, + [QuadControlKHR], + [], + [(IdResultType, One), (IdResult, One), (IdRef, One)] + ), + inst!( + GroupNonUniformQuadAnyKHR, + [QuadControlKHR], + [], + [(IdResultType, One), (IdResult, One), (IdRef, One)] + ), inst!( HitObjectRecordHitMotionNV, [ShaderInvocationReorderNV, RayTracingMotionBlurNV], @@ -4428,6 +4630,20 @@ static INSTRUCTION_TABLE: &[Instruction<'static>] = &[ [], [(LiteralInteger, One)] ), + inst!( + RawAccessChainNV, + [RawAccessChainsNV], + [], + [ + (IdResultType, One), + (IdResult, One), + (IdRef, One), + (IdRef, One), + (IdRef, One), + (IdRef, One), + (RawAccessChainOperands, ZeroOrOne) + ] + ), inst!( SubgroupShuffleINTEL, [SubgroupShuffleINTEL], @@ -4719,7 +4935,8 @@ static INSTRUCTION_TABLE: &[Instruction<'static>] = &[ [ AtomicFloat16MinMaxEXT, AtomicFloat32MinMaxEXT, - AtomicFloat64MinMaxEXT + AtomicFloat64MinMaxEXT, + AtomicFloat16VectorNV ], [], [ @@ -4736,7 +4953,8 @@ static INSTRUCTION_TABLE: &[Instruction<'static>] = &[ [ AtomicFloat16MinMaxEXT, AtomicFloat32MinMaxEXT, - AtomicFloat64MinMaxEXT + AtomicFloat64MinMaxEXT, + AtomicFloat16VectorNV ], [], [ @@ -6969,7 +7187,8 @@ static INSTRUCTION_TABLE: &[Instruction<'static>] = &[ [ AtomicFloat16AddEXT, AtomicFloat32AddEXT, - AtomicFloat64AddEXT + AtomicFloat64AddEXT, + AtomicFloat16VectorNV ], ["SPV_EXT_shader_atomic_float_add"], [ @@ -7035,6 +7254,12 @@ static INSTRUCTION_TABLE: &[Instruction<'static>] = &[ [], [(IdScope, One), (IdScope, One), (IdMemorySemantics, One)] ), + inst!( + SubgroupBlockPrefetchINTEL, + [SubgroupBufferPrefetchINTEL], + [], + [(IdRef, One), (IdRef, One), (MemoryAccess, ZeroOrOne)] + ), inst!( GroupIMulKHR, [GroupUniformArithmeticKHR], @@ -7131,4 +7356,28 @@ static INSTRUCTION_TABLE: &[Instruction<'static>] = &[ (IdRef, One) ] ), + inst!( + MaskedGatherINTEL, + [MaskedGatherScatterINTEL], + [], + [ + (IdResultType, One), + (IdResult, One), + (IdRef, One), + (LiteralInteger, One), + (IdRef, One), + (IdRef, One) + ] + ), + inst!( + MaskedScatterINTEL, + [MaskedGatherScatterINTEL], + [], + [ + (IdRef, One), + (IdRef, One), + (LiteralInteger, One), + (IdRef, One) + ] + ), ]; diff --git a/rspirv/lift/autogen_context.rs b/rspirv/lift/autogen_context.rs index aedc22ff..48350ad8 100644 --- a/rspirv/lift/autogen_context.rs +++ b/rspirv/lift/autogen_context.rs @@ -5248,6 +5248,74 @@ impl LiftContext { None => None, }, }), + 4418u32 => Ok(ops::Op::UntypedVariableKHR { + storage_class: (match operands.next() { + Some(dr::Operand::StorageClass(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + data_type: match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(self.types.lookup_token(*value)), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }, + initializer: match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }, + }), + 4419u32 => Ok(ops::Op::UntypedAccessChainKHR { + base_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)?, + base: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + indexes: { + let mut vec = Vec::new(); + while let Some(item) = match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + } { + vec.push(item); + } + vec + }, + }), + 4420u32 => Ok(ops::Op::UntypedInBoundsAccessChainKHR { + base_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)?, + base: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + indexes: { + let mut vec = Vec::new(); + while let Some(item) = match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + } { + vec.push(item); + } + vec + }, + }), 4421u32 => Ok(ops::Op::SubgroupBallotKHR { predicate: (match operands.next() { Some(dr::Operand::IdRef(value)) => Some(*value), @@ -5264,6 +5332,117 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, }), + 4423u32 => Ok(ops::Op::UntypedPtrAccessChainKHR { + base_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)?, + base: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + element: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + indexes: { + let mut vec = Vec::new(); + while let Some(item) = match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + } { + vec.push(item); + } + vec + }, + }), + 4424u32 => Ok(ops::Op::UntypedInBoundsPtrAccessChainKHR { + base_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)?, + base: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + element: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + indexes: { + let mut vec = Vec::new(); + while let Some(item) = match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + } { + vec.push(item); + } + vec + }, + }), + 4425u32 => Ok(ops::Op::UntypedArrayLengthKHR { + structure: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + pointer: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + array_member: (match operands.next() { + Some(dr::Operand::LiteralBit32(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + }), + 4426u32 => Ok(ops::Op::UntypedPrefetchKHR { + pointer_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)?, + num_bytes: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + rw: match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }, + locality: match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }, + cache_type: match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(self.types.lookup_token(*value)), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }, + }), 4428u32 => Ok(ops::Op::SubgroupAllKHR { predicate: (match operands.next() { Some(dr::Operand::IdRef(value)) => Some(*value), @@ -5636,6 +5815,14 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, }), + 4463u32 => Ok(ops::Op::CompositeConstructReplicateEXT { + value: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*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), @@ -5842,6 +6029,134 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, }), + 4500u32 => Ok(ops::Op::ImageBlockMatchWindowSSDQCOM { + target_sampled_image: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + target_coordinates: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + reference_sampled_image: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + reference_coordinates: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + block_size: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + }), + 4501u32 => Ok(ops::Op::ImageBlockMatchWindowSADQCOM { + target_sampled_image: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + target_coordinates: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + reference_sampled_image: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + reference_coordinates: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + block_size: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + }), + 4502u32 => Ok(ops::Op::ImageBlockMatchGatherSSDQCOM { + target_sampled_image: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + target_coordinates: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + reference_sampled_image: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + reference_coordinates: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + block_size: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + }), + 4503u32 => Ok(ops::Op::ImageBlockMatchGatherSADQCOM { + target_sampled_image: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + target_coordinates: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + reference_sampled_image: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + reference_coordinates: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + block_size: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + }), 5000u32 => Ok(ops::Op::GroupIAddNonUniformAMD { execution: (match operands.next() { Some(dr::Operand::IdScope(value)) => Some(*value), @@ -6086,6 +6401,22 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, }), + 5110u32 => Ok(ops::Op::GroupNonUniformQuadAllKHR { + predicate: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + }), + 5111u32 => Ok(ops::Op::GroupNonUniformQuadAnyKHR { + predicate: (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), @@ -7404,6 +7735,37 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, }), + 5398u32 => Ok(ops::Op::RawAccessChainNV { + base: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + byte_stride: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + element_index: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + byte_offset: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + raw_access_chain_operands: match operands.next() { + Some(dr::Operand::RawAccessChainOperands(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }, + }), 5571u32 => Ok(ops::Op::SubgroupShuffleINTEL { data: (match operands.next() { Some(dr::Operand::IdRef(value)) => Some(*value), @@ -12127,6 +12489,25 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, }), + 6221u32 => Ok(ops::Op::SubgroupBlockPrefetchINTEL { + ptr: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + num_bytes: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + memory_access: match operands.next() { + Some(dr::Operand::MemoryAccess(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }, + }), 6401u32 => Ok(ops::Op::GroupIMulKHR { execution: (match operands.next() { Some(dr::Operand::IdScope(value)) => Some(*value), @@ -12287,6 +12668,58 @@ impl LiftContext { }) .ok_or(OperandError::Missing)?, }), + 6428u32 => Ok(ops::Op::MaskedGatherINTEL { + ptr_vector: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + alignment: (match operands.next() { + Some(dr::Operand::LiteralBit32(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + mask: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + fill_empty: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + }), + 6429u32 => Ok(ops::Op::MaskedScatterINTEL { + input_vector: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + ptr_vector: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + alignment: (match operands.next() { + Some(dr::Operand::LiteralBit32(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + mask: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + }), _ => Err(InstructionError::WrongOpcode), } } @@ -12316,6 +12749,11 @@ impl LiftContext { None => None, }) .ok_or(OperandError::Missing)?, + floating_point_encoding: match operands.next() { + Some(dr::Operand::FPEncoding(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }, }), 23u32 => Ok(Type::Vector { component_type: (match operands.next() { @@ -12509,6 +12947,14 @@ impl LiftContext { }), 322u32 => Ok(Type::PipeStorage), 327u32 => Ok(Type::NamedBarrier), + 4417u32 => Ok(Type::UntypedPointerKHR { + storage_class: (match operands.next() { + Some(dr::Operand::StorageClass(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + }), 4456u32 => Ok(Type::CooperativeMatrixKHR { component_type: (match operands.next() { Some(dr::Operand::IdRef(value)) => Some(self.types.lookup_token(*value)), @@ -12869,4 +13315,39 @@ impl LiftContext { .ok_or(OperandError::Missing)?, }) } + #[allow(unused)] + pub fn lift_ext_inst_with_forward_refs_khr( + &mut self, + raw: &dr::Instruction, + ) -> Result { + if raw.class.opcode as u32 != 4433u32 { + return Err(InstructionError::WrongOpcode); + } + let mut operands = raw.operands.iter(); + Ok(instructions::ExtInstWithForwardRefsKHR { + set: (match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + instruction: (match operands.next() { + Some(dr::Operand::LiteralExtInstInteger(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + }) + .ok_or(OperandError::Missing)?, + operand_1_operand_2: { + let mut vec = Vec::new(); + while let Some(item) = match operands.next() { + Some(dr::Operand::IdRef(value)) => Some(*value), + Some(_) => return Err(OperandError::WrongType.into()), + None => None, + } { + vec.push(item); + } + vec + }, + }) + } } diff --git a/rspirv/sr/autogen_decoration.rs b/rspirv/sr/autogen_decoration.rs index 273e7164..d05bad9a 100644 --- a/rspirv/sr/autogen_decoration.rs +++ b/rspirv/sr/autogen_decoration.rs @@ -57,6 +57,7 @@ pub enum Decoration { NoUnsignedWrap, WeightTextureQCOM, BlockMatchTextureQCOM, + BlockMatchSamplerQCOM, ExplicitInterpAMD, NodeSharesPayloadLimitsWithAMDX(spirv::Word), NodeMaxPayloadsAMDX(spirv::Word), @@ -66,8 +67,8 @@ pub enum Decoration { PassthroughNV, ViewportRelativeNV, SecondaryViewportRelativeNV(u32), - PerPrimitiveNV, PerPrimitiveEXT, + PerPrimitiveNV, PerViewNV, PerTaskNV, PerVertexKHR, diff --git a/rspirv/sr/autogen_instructions.rs b/rspirv/sr/autogen_instructions.rs index e51591bf..9c627073 100644 --- a/rspirv/sr/autogen_instructions.rs +++ b/rspirv/sr/autogen_instructions.rs @@ -56,3 +56,9 @@ pub struct ExecutionModeId { pub entry_point: spirv::Word, pub mode: spirv::ExecutionMode, } +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct ExtInstWithForwardRefsKHR { + pub set: spirv::Word, + pub instruction: u32, + pub operand_1_operand_2: Vec, +} diff --git a/rspirv/sr/autogen_ops.rs b/rspirv/sr/autogen_ops.rs index 642bd39b..e1c2215b 100644 --- a/rspirv/sr/autogen_ops.rs +++ b/rspirv/sr/autogen_ops.rs @@ -1343,12 +1343,51 @@ pub enum Op { StencilAttachmentReadEXT { sample: Option, }, + UntypedVariableKHR { + storage_class: spirv::StorageClass, + data_type: Option>, + initializer: Option, + }, + UntypedAccessChainKHR { + base_type: Token, + base: spirv::Word, + indexes: Vec, + }, + UntypedInBoundsAccessChainKHR { + base_type: Token, + base: spirv::Word, + indexes: Vec, + }, SubgroupBallotKHR { predicate: spirv::Word, }, SubgroupFirstInvocationKHR { value: spirv::Word, }, + UntypedPtrAccessChainKHR { + base_type: Token, + base: spirv::Word, + element: spirv::Word, + indexes: Vec, + }, + UntypedInBoundsPtrAccessChainKHR { + base_type: Token, + base: spirv::Word, + element: spirv::Word, + indexes: Vec, + }, + UntypedArrayLengthKHR { + structure: spirv::Word, + pointer: spirv::Word, + array_member: u32, + }, + UntypedPrefetchKHR { + pointer_type: Token, + num_bytes: spirv::Word, + rw: Option, + locality: Option, + cache_type: Option>, + }, SubgroupAllKHR { predicate: spirv::Word, }, @@ -1443,6 +1482,9 @@ pub enum Op { CooperativeMatrixLengthKHR { ty: Token, }, + CompositeConstructReplicateEXT { + value: spirv::Word, + }, RayQueryInitializeKHR { ray_query: spirv::Word, accel: spirv::Word, @@ -1494,6 +1536,34 @@ pub enum Op { reference_coordinates: spirv::Word, block_size: spirv::Word, }, + ImageBlockMatchWindowSSDQCOM { + target_sampled_image: spirv::Word, + target_coordinates: spirv::Word, + reference_sampled_image: spirv::Word, + reference_coordinates: spirv::Word, + block_size: spirv::Word, + }, + ImageBlockMatchWindowSADQCOM { + target_sampled_image: spirv::Word, + target_coordinates: spirv::Word, + reference_sampled_image: spirv::Word, + reference_coordinates: spirv::Word, + block_size: spirv::Word, + }, + ImageBlockMatchGatherSSDQCOM { + target_sampled_image: spirv::Word, + target_coordinates: spirv::Word, + reference_sampled_image: spirv::Word, + reference_coordinates: spirv::Word, + block_size: spirv::Word, + }, + ImageBlockMatchGatherSADQCOM { + target_sampled_image: spirv::Word, + target_coordinates: spirv::Word, + reference_sampled_image: spirv::Word, + reference_coordinates: spirv::Word, + block_size: spirv::Word, + }, GroupIAddNonUniformAMD { execution: spirv::Word, operation: spirv::GroupOperation, @@ -1558,6 +1628,12 @@ pub enum Op { payload_count: spirv::Word, node_index: spirv::Word, }, + GroupNonUniformQuadAllKHR { + predicate: spirv::Word, + }, + GroupNonUniformQuadAnyKHR { + predicate: spirv::Word, + }, HitObjectRecordHitMotionNV { hit_object: spirv::Word, acceleration_structure: spirv::Word, @@ -1873,6 +1949,13 @@ pub enum Op { SamplerImageAddressingModeNV { bit_width: u32, }, + RawAccessChainNV { + base: spirv::Word, + byte_stride: spirv::Word, + element_index: spirv::Word, + byte_offset: spirv::Word, + raw_access_chain_operands: Option, + }, SubgroupShuffleINTEL { data: spirv::Word, invocation_id: spirv::Word, @@ -3032,6 +3115,11 @@ pub enum Op { memory: spirv::Word, semantics: spirv::Word, }, + SubgroupBlockPrefetchINTEL { + ptr: spirv::Word, + num_bytes: spirv::Word, + memory_access: Option, + }, GroupIMulKHR { execution: spirv::Word, operation: spirv::GroupOperation, @@ -3072,4 +3160,16 @@ pub enum Op { operation: spirv::GroupOperation, x: spirv::Word, }, + MaskedGatherINTEL { + ptr_vector: spirv::Word, + alignment: u32, + mask: spirv::Word, + fill_empty: spirv::Word, + }, + MaskedScatterINTEL { + input_vector: spirv::Word, + ptr_vector: spirv::Word, + alignment: u32, + mask: spirv::Word, + }, } diff --git a/rspirv/sr/autogen_types.rs b/rspirv/sr/autogen_types.rs index 5ebf7c17..fa20c32b 100644 --- a/rspirv/sr/autogen_types.rs +++ b/rspirv/sr/autogen_types.rs @@ -13,6 +13,7 @@ pub enum Type { }, Float { width: u32, + floating_point_encoding: Option, }, Vector { component_type: Token, @@ -70,6 +71,9 @@ pub enum Type { }, PipeStorage, NamedBarrier, + UntypedPointerKHR { + storage_class: spirv::StorageClass, + }, CooperativeMatrixKHR { component_type: Token, scope: spirv::Word, diff --git a/spirv/Cargo.toml b/spirv/Cargo.toml index 6731db5f..e386bfa1 100644 --- a/spirv/Cargo.toml +++ b/spirv/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "spirv" -version = "0.3.0+sdk-1.3.275.0" +version = "0.3.0+sdk-1.3.296.0" authors = ["Lei Zhang "] edition = "2018" diff --git a/spirv/autogen_spirv.rs b/spirv/autogen_spirv.rs index 6debf705..99efeb51 100644 --- a/spirv/autogen_spirv.rs +++ b/spirv/autogen_spirv.rs @@ -6,9 +6,9 @@ pub type Word = u32; pub const MAGIC_NUMBER: u32 = 0x07230203; pub const MAJOR_VERSION: u8 = 1u8; pub const MINOR_VERSION: u8 = 6u8; -pub const REVISION: u8 = 1u8; +pub const REVISION: u8 = 4u8; bitflags! { # [doc = "SPIR-V operand kind: [ImageOperands](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_image_operands_a_image_operands)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct ImageOperands : u32 { const NONE = 0u32 ; const BIAS = 1u32 ; const LOD = 2u32 ; const GRAD = 4u32 ; const CONST_OFFSET = 8u32 ; const OFFSET = 16u32 ; const CONST_OFFSETS = 32u32 ; const SAMPLE = 64u32 ; const MIN_LOD = 128u32 ; const MAKE_TEXEL_AVAILABLE = 256u32 ; const MAKE_TEXEL_AVAILABLE_KHR = 256u32 ; const MAKE_TEXEL_VISIBLE = 512u32 ; const MAKE_TEXEL_VISIBLE_KHR = 512u32 ; const NON_PRIVATE_TEXEL = 1024u32 ; const NON_PRIVATE_TEXEL_KHR = 1024u32 ; const VOLATILE_TEXEL = 2048u32 ; const VOLATILE_TEXEL_KHR = 2048u32 ; const SIGN_EXTEND = 4096u32 ; const ZERO_EXTEND = 8192u32 ; const NONTEMPORAL = 16384u32 ; const OFFSETS = 65536u32 ; } } -bitflags! { # [doc = "SPIR-V operand kind: [FPFastMathMode](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_fp_fast_math_mode_a_fp_fast_math_mode)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct FPFastMathMode : u32 { const NONE = 0u32 ; const NOT_NAN = 1u32 ; const NOT_INF = 2u32 ; const NSZ = 4u32 ; const ALLOW_RECIP = 8u32 ; const FAST = 16u32 ; const ALLOW_CONTRACT_FAST_INTEL = 65536u32 ; const ALLOW_REASSOC_INTEL = 131072u32 ; } } +bitflags! { # [doc = "SPIR-V operand kind: [FPFastMathMode](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_fp_fast_math_mode_a_fp_fast_math_mode)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct FPFastMathMode : u32 { const NONE = 0u32 ; const NOT_NAN = 1u32 ; const NOT_INF = 2u32 ; const NSZ = 4u32 ; const ALLOW_RECIP = 8u32 ; const FAST = 16u32 ; const ALLOW_CONTRACT = 65536u32 ; const ALLOW_CONTRACT_FAST_INTEL = 65536u32 ; const ALLOW_REASSOC = 131072u32 ; const ALLOW_REASSOC_INTEL = 131072u32 ; const ALLOW_TRANSFORM = 262144u32 ; } } bitflags! { # [doc = "SPIR-V operand kind: [SelectionControl](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_selection_control_a_selection_control)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct SelectionControl : u32 { const NONE = 0u32 ; const FLATTEN = 1u32 ; const DONT_FLATTEN = 2u32 ; } } bitflags! { # [doc = "SPIR-V operand kind: [LoopControl](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_loop_control_a_loop_control)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct LoopControl : u32 { const NONE = 0u32 ; const UNROLL = 1u32 ; const DONT_UNROLL = 2u32 ; const DEPENDENCY_INFINITE = 4u32 ; const DEPENDENCY_LENGTH = 8u32 ; const MIN_ITERATIONS = 16u32 ; const MAX_ITERATIONS = 32u32 ; const ITERATION_MULTIPLE = 64u32 ; const PEEL_COUNT = 128u32 ; const PARTIAL_COUNT = 256u32 ; const INITIATION_INTERVAL_INTEL = 65536u32 ; const MAX_CONCURRENCY_INTEL = 131072u32 ; const DEPENDENCY_ARRAY_INTEL = 262144u32 ; const PIPELINE_ENABLE_INTEL = 524288u32 ; const LOOP_COALESCE_INTEL = 1048576u32 ; const MAX_INTERLEAVING_INTEL = 2097152u32 ; const SPECULATED_ITERATIONS_INTEL = 4194304u32 ; const NO_FUSION_INTEL = 8388608u32 ; const LOOP_COUNT_INTEL = 16777216u32 ; const MAX_REINVOCATION_DELAY_INTEL = 33554432u32 ; } } bitflags! { # [doc = "SPIR-V operand kind: [FunctionControl](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_function_control_a_function_control)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct FunctionControl : u32 { const NONE = 0u32 ; const INLINE = 1u32 ; const DONT_INLINE = 2u32 ; const PURE = 4u32 ; const CONST = 8u32 ; const OPT_NONE_INTEL = 65536u32 ; } } @@ -17,6 +17,7 @@ bitflags! { # [doc = "SPIR-V operand kind: [MemoryAccess](https://www.khronos.or bitflags! { # [doc = "SPIR-V operand kind: [KernelProfilingInfo](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_kernel_profiling_info_a_kernel_profiling_info)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct KernelProfilingInfo : u32 { const NONE = 0u32 ; const CMD_EXEC_TIME = 1u32 ; } } bitflags! { # [doc = "SPIR-V operand kind: [RayFlags](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_ray_flags_a_ray_flags)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct RayFlags : u32 { const NONE_KHR = 0u32 ; const OPAQUE_KHR = 1u32 ; const NO_OPAQUE_KHR = 2u32 ; const TERMINATE_ON_FIRST_HIT_KHR = 4u32 ; const SKIP_CLOSEST_HIT_SHADER_KHR = 8u32 ; const CULL_BACK_FACING_TRIANGLES_KHR = 16u32 ; const CULL_FRONT_FACING_TRIANGLES_KHR = 32u32 ; const CULL_OPAQUE_KHR = 64u32 ; const CULL_NO_OPAQUE_KHR = 128u32 ; const SKIP_TRIANGLES_KHR = 256u32 ; const SKIP_AAB_BS_KHR = 512u32 ; const FORCE_OPACITY_MICROMAP2_STATE_EXT = 1024u32 ; } } bitflags! { # [doc = "SPIR-V operand kind: [FragmentShadingRate](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_fragment_shading_rate_a_fragment_shading_rate)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct FragmentShadingRate : u32 { const VERTICAL2_PIXELS = 1u32 ; const VERTICAL4_PIXELS = 2u32 ; const HORIZONTAL2_PIXELS = 4u32 ; const HORIZONTAL4_PIXELS = 8u32 ; } } +bitflags! { # [doc = "SPIR-V operand kind: [RawAccessChainOperands](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_raw_access_chain_operands_a_raw_access_chain_operands)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct RawAccessChainOperands : u32 { const NONE = 0u32 ; const ROBUSTNESS_PER_COMPONENT_NV = 1u32 ; const ROBUSTNESS_PER_ELEMENT_NV = 2u32 ; } } #[doc = "SPIR-V operand kind: [SourceLanguage](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_source_language_a_source_language)"] #[repr(u32)] #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] @@ -36,11 +37,12 @@ pub enum SourceLanguage { NZSL = 9u32, WGSL = 10u32, Slang = 11u32, + Zig = 12u32, } impl SourceLanguage { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=11u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=12u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } @@ -63,6 +65,7 @@ impl core::str::FromStr for SourceLanguage { "NZSL" => Ok(Self::NZSL), "WGSL" => Ok(Self::WGSL), "Slang" => Ok(Self::Slang), + "Zig" => Ok(Self::Zig), _ => Err(()), } } @@ -83,19 +86,19 @@ pub enum ExecutionModel { Kernel = 6u32, TaskNV = 5267u32, MeshNV = 5268u32, - RayGenerationNV = 5313u32, - IntersectionNV = 5314u32, - AnyHitNV = 5315u32, - ClosestHitNV = 5316u32, - MissNV = 5317u32, - CallableNV = 5318u32, + RayGenerationKHR = 5313u32, + IntersectionKHR = 5314u32, + AnyHitKHR = 5315u32, + ClosestHitKHR = 5316u32, + MissKHR = 5317u32, + CallableKHR = 5318u32, TaskEXT = 5364u32, MeshEXT = 5365u32, } impl ExecutionModel { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=6u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=6u32 => unsafe { core::mem::transmute::(n) }, 5267u32..=5268u32 => unsafe { core::mem::transmute::(n) }, 5313u32..=5318u32 => unsafe { core::mem::transmute::(n) }, 5364u32..=5365u32 => unsafe { core::mem::transmute::(n) }, @@ -105,12 +108,12 @@ impl ExecutionModel { } #[allow(non_upper_case_globals)] impl ExecutionModel { - pub const RayGenerationKHR: Self = Self::RayGenerationNV; - pub const IntersectionKHR: Self = Self::IntersectionNV; - pub const AnyHitKHR: Self = Self::AnyHitNV; - pub const ClosestHitKHR: Self = Self::ClosestHitNV; - pub const MissKHR: Self = Self::MissNV; - pub const CallableKHR: Self = Self::CallableNV; + pub const RayGenerationNV: Self = Self::RayGenerationKHR; + pub const IntersectionNV: Self = Self::IntersectionKHR; + pub const AnyHitNV: Self = Self::AnyHitKHR; + pub const ClosestHitNV: Self = Self::ClosestHitKHR; + pub const MissNV: Self = Self::MissKHR; + pub const CallableNV: Self = Self::CallableKHR; } impl core::str::FromStr for ExecutionModel { type Err = (); @@ -125,18 +128,18 @@ impl core::str::FromStr for ExecutionModel { "Kernel" => Ok(Self::Kernel), "TaskNV" => Ok(Self::TaskNV), "MeshNV" => Ok(Self::MeshNV), - "RayGenerationNV" => Ok(Self::RayGenerationNV), - "RayGenerationKHR" => Ok(Self::RayGenerationNV), - "IntersectionNV" => Ok(Self::IntersectionNV), - "IntersectionKHR" => Ok(Self::IntersectionNV), - "AnyHitNV" => Ok(Self::AnyHitNV), - "AnyHitKHR" => Ok(Self::AnyHitNV), - "ClosestHitNV" => Ok(Self::ClosestHitNV), - "ClosestHitKHR" => Ok(Self::ClosestHitNV), - "MissNV" => Ok(Self::MissNV), - "MissKHR" => Ok(Self::MissNV), - "CallableNV" => Ok(Self::CallableNV), - "CallableKHR" => Ok(Self::CallableNV), + "RayGenerationKHR" => Ok(Self::RayGenerationKHR), + "RayGenerationNV" => Ok(Self::RayGenerationKHR), + "IntersectionKHR" => Ok(Self::IntersectionKHR), + "IntersectionNV" => Ok(Self::IntersectionKHR), + "AnyHitKHR" => Ok(Self::AnyHitKHR), + "AnyHitNV" => Ok(Self::AnyHitKHR), + "ClosestHitKHR" => Ok(Self::ClosestHitKHR), + "ClosestHitNV" => Ok(Self::ClosestHitKHR), + "MissKHR" => Ok(Self::MissKHR), + "MissNV" => Ok(Self::MissKHR), + "CallableKHR" => Ok(Self::CallableKHR), + "CallableNV" => Ok(Self::CallableKHR), "TaskEXT" => Ok(Self::TaskEXT), "MeshEXT" => Ok(Self::MeshEXT), _ => Err(()), @@ -158,7 +161,7 @@ pub enum AddressingModel { impl AddressingModel { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=2u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=2u32 => unsafe { core::mem::transmute::(n) }, 5348u32 => unsafe { core::mem::transmute::(5348u32) }, _ => return None, }) @@ -196,7 +199,7 @@ pub enum MemoryModel { impl MemoryModel { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=3u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=3u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } @@ -286,11 +289,13 @@ pub enum ExecutionMode { StencilRefUnchangedBackAMD = 5082u32, StencilRefGreaterBackAMD = 5083u32, StencilRefLessBackAMD = 5084u32, - OutputLinesNV = 5269u32, - OutputPrimitivesNV = 5270u32, - DerivativeGroupQuadsNV = 5289u32, - DerivativeGroupLinearNV = 5290u32, - OutputTrianglesNV = 5298u32, + QuadDerivativesKHR = 5088u32, + RequireFullQuadsKHR = 5089u32, + OutputLinesEXT = 5269u32, + OutputPrimitivesEXT = 5270u32, + DerivativeGroupQuadsKHR = 5289u32, + DerivativeGroupLinearKHR = 5290u32, + OutputTrianglesEXT = 5298u32, PixelInterlockOrderedEXT = 5366u32, PixelInterlockUnorderedEXT = 5367u32, SampleInterlockOrderedEXT = 5368u32, @@ -307,14 +312,19 @@ pub enum ExecutionMode { NoGlobalOffsetINTEL = 5895u32, NumSIMDWorkitemsINTEL = 5896u32, SchedulerTargetFmaxMhzINTEL = 5903u32, + MaximallyReconvergesKHR = 6023u32, + FPFastMathDefault = 6028u32, StreamingInterfaceINTEL = 6154u32, RegisterMapInterfaceINTEL = 6160u32, NamedBarrierCountINTEL = 6417u32, + MaximumRegistersINTEL = 6461u32, + MaximumRegistersIdINTEL = 6462u32, + NamedMaximumRegistersINTEL = 6463u32, } impl ExecutionMode { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=12u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=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) }, @@ -327,6 +337,7 @@ impl ExecutionMode { 5071u32..=5073u32 => unsafe { core::mem::transmute::(n) }, 5077u32 => unsafe { core::mem::transmute::(5077u32) }, 5079u32..=5084u32 => unsafe { core::mem::transmute::(n) }, + 5088u32..=5089u32 => unsafe { core::mem::transmute::(n) }, 5269u32..=5270u32 => unsafe { core::mem::transmute::(n) }, 5289u32..=5290u32 => unsafe { core::mem::transmute::(n) }, 5298u32 => unsafe { core::mem::transmute::(5298u32) }, @@ -335,18 +346,23 @@ impl ExecutionMode { 5620u32..=5623u32 => unsafe { core::mem::transmute::(n) }, 5893u32..=5896u32 => unsafe { core::mem::transmute::(n) }, 5903u32 => unsafe { core::mem::transmute::(5903u32) }, + 6023u32 => unsafe { core::mem::transmute::(6023u32) }, + 6028u32 => unsafe { core::mem::transmute::(6028u32) }, 6154u32 => unsafe { core::mem::transmute::(6154u32) }, 6160u32 => unsafe { core::mem::transmute::(6160u32) }, 6417u32 => unsafe { core::mem::transmute::(6417u32) }, + 6461u32..=6463u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } } #[allow(non_upper_case_globals)] impl ExecutionMode { - pub const OutputLinesEXT: Self = Self::OutputLinesNV; - pub const OutputPrimitivesEXT: Self = Self::OutputPrimitivesNV; - pub const OutputTrianglesEXT: Self = Self::OutputTrianglesNV; + pub const OutputLinesNV: Self = Self::OutputLinesEXT; + pub const OutputPrimitivesNV: Self = Self::OutputPrimitivesEXT; + pub const DerivativeGroupQuadsNV: Self = Self::DerivativeGroupQuadsKHR; + pub const DerivativeGroupLinearNV: Self = Self::DerivativeGroupLinearKHR; + pub const OutputTrianglesNV: Self = Self::OutputTrianglesEXT; } impl core::str::FromStr for ExecutionMode { type Err = (); @@ -413,14 +429,18 @@ impl core::str::FromStr for ExecutionMode { "StencilRefUnchangedBackAMD" => Ok(Self::StencilRefUnchangedBackAMD), "StencilRefGreaterBackAMD" => Ok(Self::StencilRefGreaterBackAMD), "StencilRefLessBackAMD" => Ok(Self::StencilRefLessBackAMD), - "OutputLinesNV" => Ok(Self::OutputLinesNV), - "OutputLinesEXT" => Ok(Self::OutputLinesNV), - "OutputPrimitivesNV" => Ok(Self::OutputPrimitivesNV), - "OutputPrimitivesEXT" => Ok(Self::OutputPrimitivesNV), - "DerivativeGroupQuadsNV" => Ok(Self::DerivativeGroupQuadsNV), - "DerivativeGroupLinearNV" => Ok(Self::DerivativeGroupLinearNV), - "OutputTrianglesNV" => Ok(Self::OutputTrianglesNV), - "OutputTrianglesEXT" => Ok(Self::OutputTrianglesNV), + "QuadDerivativesKHR" => Ok(Self::QuadDerivativesKHR), + "RequireFullQuadsKHR" => Ok(Self::RequireFullQuadsKHR), + "OutputLinesEXT" => Ok(Self::OutputLinesEXT), + "OutputLinesNV" => Ok(Self::OutputLinesEXT), + "OutputPrimitivesEXT" => Ok(Self::OutputPrimitivesEXT), + "OutputPrimitivesNV" => Ok(Self::OutputPrimitivesEXT), + "DerivativeGroupQuadsKHR" => Ok(Self::DerivativeGroupQuadsKHR), + "DerivativeGroupQuadsNV" => Ok(Self::DerivativeGroupQuadsKHR), + "DerivativeGroupLinearKHR" => Ok(Self::DerivativeGroupLinearKHR), + "DerivativeGroupLinearNV" => Ok(Self::DerivativeGroupLinearKHR), + "OutputTrianglesEXT" => Ok(Self::OutputTrianglesEXT), + "OutputTrianglesNV" => Ok(Self::OutputTrianglesEXT), "PixelInterlockOrderedEXT" => Ok(Self::PixelInterlockOrderedEXT), "PixelInterlockUnorderedEXT" => Ok(Self::PixelInterlockUnorderedEXT), "SampleInterlockOrderedEXT" => Ok(Self::SampleInterlockOrderedEXT), @@ -437,9 +457,14 @@ impl core::str::FromStr for ExecutionMode { "NoGlobalOffsetINTEL" => Ok(Self::NoGlobalOffsetINTEL), "NumSIMDWorkitemsINTEL" => Ok(Self::NumSIMDWorkitemsINTEL), "SchedulerTargetFmaxMhzINTEL" => Ok(Self::SchedulerTargetFmaxMhzINTEL), + "MaximallyReconvergesKHR" => Ok(Self::MaximallyReconvergesKHR), + "FPFastMathDefault" => Ok(Self::FPFastMathDefault), "StreamingInterfaceINTEL" => Ok(Self::StreamingInterfaceINTEL), "RegisterMapInterfaceINTEL" => Ok(Self::RegisterMapInterfaceINTEL), "NamedBarrierCountINTEL" => Ok(Self::NamedBarrierCountINTEL), + "MaximumRegistersINTEL" => Ok(Self::MaximumRegistersINTEL), + "MaximumRegistersIdINTEL" => Ok(Self::MaximumRegistersIdINTEL), + "NamedMaximumRegistersINTEL" => Ok(Self::NamedMaximumRegistersINTEL), _ => Err(()), } } @@ -467,12 +492,12 @@ pub enum StorageClass { TileImageEXT = 4172u32, NodePayloadAMDX = 5068u32, NodeOutputPayloadAMDX = 5076u32, - CallableDataNV = 5328u32, - IncomingCallableDataNV = 5329u32, - RayPayloadNV = 5338u32, - HitAttributeNV = 5339u32, - IncomingRayPayloadNV = 5342u32, - ShaderRecordBufferNV = 5343u32, + CallableDataKHR = 5328u32, + IncomingCallableDataKHR = 5329u32, + RayPayloadKHR = 5338u32, + HitAttributeKHR = 5339u32, + IncomingRayPayloadKHR = 5342u32, + ShaderRecordBufferKHR = 5343u32, PhysicalStorageBuffer = 5349u32, HitObjectAttributeNV = 5385u32, TaskPayloadWorkgroupEXT = 5402u32, @@ -483,7 +508,7 @@ pub enum StorageClass { impl StorageClass { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=12u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=12u32 => unsafe { core::mem::transmute::(n) }, 4172u32 => unsafe { core::mem::transmute::(4172u32) }, 5068u32 => unsafe { core::mem::transmute::(5068u32) }, 5076u32 => unsafe { core::mem::transmute::(5076u32) }, @@ -501,12 +526,12 @@ impl StorageClass { } #[allow(non_upper_case_globals)] impl StorageClass { - pub const CallableDataKHR: Self = Self::CallableDataNV; - pub const IncomingCallableDataKHR: Self = Self::IncomingCallableDataNV; - pub const RayPayloadKHR: Self = Self::RayPayloadNV; - pub const HitAttributeKHR: Self = Self::HitAttributeNV; - pub const IncomingRayPayloadKHR: Self = Self::IncomingRayPayloadNV; - pub const ShaderRecordBufferKHR: Self = Self::ShaderRecordBufferNV; + pub const CallableDataNV: Self = Self::CallableDataKHR; + pub const IncomingCallableDataNV: Self = Self::IncomingCallableDataKHR; + pub const RayPayloadNV: Self = Self::RayPayloadKHR; + pub const HitAttributeNV: Self = Self::HitAttributeKHR; + pub const IncomingRayPayloadNV: Self = Self::IncomingRayPayloadKHR; + pub const ShaderRecordBufferNV: Self = Self::ShaderRecordBufferKHR; pub const PhysicalStorageBufferEXT: Self = Self::PhysicalStorageBuffer; } impl core::str::FromStr for StorageClass { @@ -529,18 +554,18 @@ impl core::str::FromStr for StorageClass { "TileImageEXT" => Ok(Self::TileImageEXT), "NodePayloadAMDX" => Ok(Self::NodePayloadAMDX), "NodeOutputPayloadAMDX" => Ok(Self::NodeOutputPayloadAMDX), - "CallableDataNV" => Ok(Self::CallableDataNV), - "CallableDataKHR" => Ok(Self::CallableDataNV), - "IncomingCallableDataNV" => Ok(Self::IncomingCallableDataNV), - "IncomingCallableDataKHR" => Ok(Self::IncomingCallableDataNV), - "RayPayloadNV" => Ok(Self::RayPayloadNV), - "RayPayloadKHR" => Ok(Self::RayPayloadNV), - "HitAttributeNV" => Ok(Self::HitAttributeNV), - "HitAttributeKHR" => Ok(Self::HitAttributeNV), - "IncomingRayPayloadNV" => Ok(Self::IncomingRayPayloadNV), - "IncomingRayPayloadKHR" => Ok(Self::IncomingRayPayloadNV), - "ShaderRecordBufferNV" => Ok(Self::ShaderRecordBufferNV), - "ShaderRecordBufferKHR" => Ok(Self::ShaderRecordBufferNV), + "CallableDataKHR" => Ok(Self::CallableDataKHR), + "CallableDataNV" => Ok(Self::CallableDataKHR), + "IncomingCallableDataKHR" => Ok(Self::IncomingCallableDataKHR), + "IncomingCallableDataNV" => Ok(Self::IncomingCallableDataKHR), + "RayPayloadKHR" => Ok(Self::RayPayloadKHR), + "RayPayloadNV" => Ok(Self::RayPayloadKHR), + "HitAttributeKHR" => Ok(Self::HitAttributeKHR), + "HitAttributeNV" => Ok(Self::HitAttributeKHR), + "IncomingRayPayloadKHR" => Ok(Self::IncomingRayPayloadKHR), + "IncomingRayPayloadNV" => Ok(Self::IncomingRayPayloadKHR), + "ShaderRecordBufferKHR" => Ok(Self::ShaderRecordBufferKHR), + "ShaderRecordBufferNV" => Ok(Self::ShaderRecordBufferKHR), "PhysicalStorageBuffer" => Ok(Self::PhysicalStorageBuffer), "PhysicalStorageBufferEXT" => Ok(Self::PhysicalStorageBuffer), "HitObjectAttributeNV" => Ok(Self::HitObjectAttributeNV), @@ -571,7 +596,7 @@ pub enum Dim { impl Dim { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=6u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=6u32 => unsafe { core::mem::transmute::(n) }, 4173u32 => unsafe { core::mem::transmute::(4173u32) }, _ => return None, }) @@ -611,7 +636,7 @@ pub enum SamplerAddressingMode { impl SamplerAddressingMode { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=4u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=4u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } @@ -644,7 +669,7 @@ pub enum SamplerFilterMode { impl SamplerFilterMode { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=1u32 => unsafe { core::mem::transmute::(n) }, + 1u32 => unsafe { core::mem::transmute::(1u32) }, _ => return None, }) } @@ -714,7 +739,7 @@ pub enum ImageFormat { impl ImageFormat { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=41u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=41u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } @@ -802,7 +827,7 @@ pub enum ImageChannelOrder { impl ImageChannelOrder { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=19u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=19u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } @@ -863,12 +888,13 @@ pub enum ImageChannelDataType { UnormInt101010_2 = 16u32, UnsignedIntRaw10EXT = 19u32, UnsignedIntRaw12EXT = 20u32, + UnormInt2_101010EXT = 21u32, } 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) }, + 1u32..=16u32 => unsafe { core::mem::transmute::(n) }, + 19u32..=21u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } @@ -898,6 +924,7 @@ impl core::str::FromStr for ImageChannelDataType { "UnormInt101010_2" => Ok(Self::UnormInt101010_2), "UnsignedIntRaw10EXT" => Ok(Self::UnsignedIntRaw10EXT), "UnsignedIntRaw12EXT" => Ok(Self::UnsignedIntRaw12EXT), + "UnormInt2_101010EXT" => Ok(Self::UnormInt2_101010EXT), _ => Err(()), } } @@ -917,7 +944,7 @@ pub enum FPRoundingMode { impl FPRoundingMode { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=3u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=3u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } @@ -949,7 +976,7 @@ pub enum FPDenormMode { impl FPDenormMode { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=1u32 => unsafe { core::mem::transmute::(n) }, + 1u32 => unsafe { core::mem::transmute::(1u32) }, _ => return None, }) } @@ -985,7 +1012,7 @@ pub enum QuantizationModes { impl QuantizationModes { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=7u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=7u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } @@ -1021,7 +1048,7 @@ pub enum FPOperationMode { impl FPOperationMode { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=1u32 => unsafe { core::mem::transmute::(n) }, + 1u32 => unsafe { core::mem::transmute::(1u32) }, _ => return None, }) } @@ -1053,7 +1080,7 @@ pub enum OverflowModes { impl OverflowModes { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=3u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=3u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } @@ -1086,7 +1113,7 @@ pub enum LinkageType { impl LinkageType { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=2u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=2u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } @@ -1118,7 +1145,7 @@ pub enum AccessQualifier { impl AccessQualifier { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=2u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=2u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } @@ -1151,7 +1178,7 @@ pub enum HostAccessQualifier { impl HostAccessQualifier { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=3u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=3u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } @@ -1190,7 +1217,7 @@ pub enum FunctionParameterAttribute { impl FunctionParameterAttribute { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=7u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=7u32 => unsafe { core::mem::transmute::(n) }, 5940u32 => unsafe { core::mem::transmute::(5940u32) }, _ => return None, }) @@ -1273,6 +1300,7 @@ pub enum Decoration { NoUnsignedWrap = 4470u32, WeightTextureQCOM = 4487u32, BlockMatchTextureQCOM = 4488u32, + BlockMatchSamplerQCOM = 4499u32, ExplicitInterpAMD = 4999u32, NodeSharesPayloadLimitsWithAMDX = 5019u32, NodeMaxPayloadsAMDX = 5020u32, @@ -1282,7 +1310,7 @@ pub enum Decoration { PassthroughNV = 5250u32, ViewportRelativeNV = 5252u32, SecondaryViewportRelativeNV = 5256u32, - PerPrimitiveNV = 5271u32, + PerPrimitiveEXT = 5271u32, PerViewNV = 5272u32, PerTaskNV = 5273u32, PerVertexKHR = 5285u32, @@ -1363,10 +1391,11 @@ pub enum Decoration { impl Decoration { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=11u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=11u32 => unsafe { core::mem::transmute::(n) }, 13u32..=47u32 => unsafe { core::mem::transmute::(n) }, 4469u32..=4470u32 => unsafe { core::mem::transmute::(n) }, 4487u32..=4488u32 => unsafe { core::mem::transmute::(n) }, + 4499u32 => unsafe { core::mem::transmute::(4499u32) }, 4999u32 => unsafe { core::mem::transmute::(4999u32) }, 5019u32..=5020u32 => unsafe { core::mem::transmute::(n) }, 5078u32 => unsafe { core::mem::transmute::(5078u32) }, @@ -1414,7 +1443,7 @@ impl Decoration { } #[allow(non_upper_case_globals)] impl Decoration { - pub const PerPrimitiveEXT: Self = Self::PerPrimitiveNV; + pub const PerPrimitiveNV: Self = Self::PerPrimitiveEXT; pub const PerVertexNV: Self = Self::PerVertexKHR; pub const NonUniformEXT: Self = Self::NonUniform; pub const RestrictPointerEXT: Self = Self::RestrictPointer; @@ -1477,6 +1506,7 @@ impl core::str::FromStr for Decoration { "NoUnsignedWrap" => Ok(Self::NoUnsignedWrap), "WeightTextureQCOM" => Ok(Self::WeightTextureQCOM), "BlockMatchTextureQCOM" => Ok(Self::BlockMatchTextureQCOM), + "BlockMatchSamplerQCOM" => Ok(Self::BlockMatchSamplerQCOM), "ExplicitInterpAMD" => Ok(Self::ExplicitInterpAMD), "NodeSharesPayloadLimitsWithAMDX" => Ok(Self::NodeSharesPayloadLimitsWithAMDX), "NodeMaxPayloadsAMDX" => Ok(Self::NodeMaxPayloadsAMDX), @@ -1486,8 +1516,8 @@ impl core::str::FromStr for Decoration { "PassthroughNV" => Ok(Self::PassthroughNV), "ViewportRelativeNV" => Ok(Self::ViewportRelativeNV), "SecondaryViewportRelativeNV" => Ok(Self::SecondaryViewportRelativeNV), - "PerPrimitiveNV" => Ok(Self::PerPrimitiveNV), - "PerPrimitiveEXT" => Ok(Self::PerPrimitiveNV), + "PerPrimitiveEXT" => Ok(Self::PerPrimitiveEXT), + "PerPrimitiveNV" => Ok(Self::PerPrimitiveEXT), "PerViewNV" => Ok(Self::PerViewNV), "PerTaskNV" => Ok(Self::PerTaskNV), "PerVertexKHR" => Ok(Self::PerVertexKHR), @@ -1671,24 +1701,24 @@ pub enum BuiltIn { PrimitiveLineIndicesEXT = 5295u32, PrimitiveTriangleIndicesEXT = 5296u32, CullPrimitiveEXT = 5299u32, - LaunchIdNV = 5319u32, - LaunchSizeNV = 5320u32, - WorldRayOriginNV = 5321u32, - WorldRayDirectionNV = 5322u32, - ObjectRayOriginNV = 5323u32, - ObjectRayDirectionNV = 5324u32, - RayTminNV = 5325u32, - RayTmaxNV = 5326u32, - InstanceCustomIndexNV = 5327u32, - ObjectToWorldNV = 5330u32, - WorldToObjectNV = 5331u32, + LaunchIdKHR = 5319u32, + LaunchSizeKHR = 5320u32, + WorldRayOriginKHR = 5321u32, + WorldRayDirectionKHR = 5322u32, + ObjectRayOriginKHR = 5323u32, + ObjectRayDirectionKHR = 5324u32, + RayTminKHR = 5325u32, + RayTmaxKHR = 5326u32, + InstanceCustomIndexKHR = 5327u32, + ObjectToWorldKHR = 5330u32, + WorldToObjectKHR = 5331u32, HitTNV = 5332u32, - HitKindNV = 5333u32, + HitKindKHR = 5333u32, CurrentRayTimeNV = 5334u32, HitTriangleVertexPositionsKHR = 5335u32, HitMicroTriangleVertexPositionsNV = 5337u32, HitMicroTriangleVertexBarycentricsNV = 5344u32, - IncomingRayFlagsNV = 5351u32, + IncomingRayFlagsKHR = 5351u32, RayGeometryIndexKHR = 5352u32, WarpsPerSMNV = 5374u32, SMCountNV = 5375u32, @@ -1701,7 +1731,7 @@ pub enum BuiltIn { impl BuiltIn { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=1u32 => unsafe { core::mem::transmute::(n) }, + 1u32 => unsafe { core::mem::transmute::(1u32) }, 3u32..=20u32 => unsafe { core::mem::transmute::(n) }, 22u32..=34u32 => unsafe { core::mem::transmute::(n) }, 36u32..=43u32 => unsafe { core::mem::transmute::(n) }, @@ -1747,19 +1777,19 @@ impl BuiltIn { pub const BaryCoordNoPerspNV: Self = Self::BaryCoordNoPerspKHR; pub const FragmentSizeNV: Self = Self::FragSizeEXT; pub const InvocationsPerPixelNV: Self = Self::FragInvocationCountEXT; - pub const LaunchIdKHR: Self = Self::LaunchIdNV; - pub const LaunchSizeKHR: Self = Self::LaunchSizeNV; - pub const WorldRayOriginKHR: Self = Self::WorldRayOriginNV; - pub const WorldRayDirectionKHR: Self = Self::WorldRayDirectionNV; - pub const ObjectRayOriginKHR: Self = Self::ObjectRayOriginNV; - pub const ObjectRayDirectionKHR: Self = Self::ObjectRayDirectionNV; - pub const RayTminKHR: Self = Self::RayTminNV; - pub const RayTmaxKHR: Self = Self::RayTmaxNV; - pub const InstanceCustomIndexKHR: Self = Self::InstanceCustomIndexNV; - pub const ObjectToWorldKHR: Self = Self::ObjectToWorldNV; - pub const WorldToObjectKHR: Self = Self::WorldToObjectNV; - pub const HitKindKHR: Self = Self::HitKindNV; - pub const IncomingRayFlagsKHR: Self = Self::IncomingRayFlagsNV; + pub const LaunchIdNV: Self = Self::LaunchIdKHR; + pub const LaunchSizeNV: Self = Self::LaunchSizeKHR; + pub const WorldRayOriginNV: Self = Self::WorldRayOriginKHR; + pub const WorldRayDirectionNV: Self = Self::WorldRayDirectionKHR; + pub const ObjectRayOriginNV: Self = Self::ObjectRayOriginKHR; + pub const ObjectRayDirectionNV: Self = Self::ObjectRayDirectionKHR; + pub const RayTminNV: Self = Self::RayTminKHR; + pub const RayTmaxNV: Self = Self::RayTmaxKHR; + pub const InstanceCustomIndexNV: Self = Self::InstanceCustomIndexKHR; + pub const ObjectToWorldNV: Self = Self::ObjectToWorldKHR; + pub const WorldToObjectNV: Self = Self::WorldToObjectKHR; + pub const HitKindNV: Self = Self::HitKindKHR; + pub const IncomingRayFlagsNV: Self = Self::IncomingRayFlagsKHR; } impl core::str::FromStr for BuiltIn { type Err = (); @@ -1864,39 +1894,39 @@ impl core::str::FromStr for BuiltIn { "PrimitiveLineIndicesEXT" => Ok(Self::PrimitiveLineIndicesEXT), "PrimitiveTriangleIndicesEXT" => Ok(Self::PrimitiveTriangleIndicesEXT), "CullPrimitiveEXT" => Ok(Self::CullPrimitiveEXT), - "LaunchIdNV" => Ok(Self::LaunchIdNV), - "LaunchIdKHR" => Ok(Self::LaunchIdNV), - "LaunchSizeNV" => Ok(Self::LaunchSizeNV), - "LaunchSizeKHR" => Ok(Self::LaunchSizeNV), - "WorldRayOriginNV" => Ok(Self::WorldRayOriginNV), - "WorldRayOriginKHR" => Ok(Self::WorldRayOriginNV), - "WorldRayDirectionNV" => Ok(Self::WorldRayDirectionNV), - "WorldRayDirectionKHR" => Ok(Self::WorldRayDirectionNV), - "ObjectRayOriginNV" => Ok(Self::ObjectRayOriginNV), - "ObjectRayOriginKHR" => Ok(Self::ObjectRayOriginNV), - "ObjectRayDirectionNV" => Ok(Self::ObjectRayDirectionNV), - "ObjectRayDirectionKHR" => Ok(Self::ObjectRayDirectionNV), - "RayTminNV" => Ok(Self::RayTminNV), - "RayTminKHR" => Ok(Self::RayTminNV), - "RayTmaxNV" => Ok(Self::RayTmaxNV), - "RayTmaxKHR" => Ok(Self::RayTmaxNV), - "InstanceCustomIndexNV" => Ok(Self::InstanceCustomIndexNV), - "InstanceCustomIndexKHR" => Ok(Self::InstanceCustomIndexNV), - "ObjectToWorldNV" => Ok(Self::ObjectToWorldNV), - "ObjectToWorldKHR" => Ok(Self::ObjectToWorldNV), - "WorldToObjectNV" => Ok(Self::WorldToObjectNV), - "WorldToObjectKHR" => Ok(Self::WorldToObjectNV), + "LaunchIdKHR" => Ok(Self::LaunchIdKHR), + "LaunchIdNV" => Ok(Self::LaunchIdKHR), + "LaunchSizeKHR" => Ok(Self::LaunchSizeKHR), + "LaunchSizeNV" => Ok(Self::LaunchSizeKHR), + "WorldRayOriginKHR" => Ok(Self::WorldRayOriginKHR), + "WorldRayOriginNV" => Ok(Self::WorldRayOriginKHR), + "WorldRayDirectionKHR" => Ok(Self::WorldRayDirectionKHR), + "WorldRayDirectionNV" => Ok(Self::WorldRayDirectionKHR), + "ObjectRayOriginKHR" => Ok(Self::ObjectRayOriginKHR), + "ObjectRayOriginNV" => Ok(Self::ObjectRayOriginKHR), + "ObjectRayDirectionKHR" => Ok(Self::ObjectRayDirectionKHR), + "ObjectRayDirectionNV" => Ok(Self::ObjectRayDirectionKHR), + "RayTminKHR" => Ok(Self::RayTminKHR), + "RayTminNV" => Ok(Self::RayTminKHR), + "RayTmaxKHR" => Ok(Self::RayTmaxKHR), + "RayTmaxNV" => Ok(Self::RayTmaxKHR), + "InstanceCustomIndexKHR" => Ok(Self::InstanceCustomIndexKHR), + "InstanceCustomIndexNV" => Ok(Self::InstanceCustomIndexKHR), + "ObjectToWorldKHR" => Ok(Self::ObjectToWorldKHR), + "ObjectToWorldNV" => Ok(Self::ObjectToWorldKHR), + "WorldToObjectKHR" => Ok(Self::WorldToObjectKHR), + "WorldToObjectNV" => Ok(Self::WorldToObjectKHR), "HitTNV" => Ok(Self::HitTNV), - "HitKindNV" => Ok(Self::HitKindNV), - "HitKindKHR" => Ok(Self::HitKindNV), + "HitKindKHR" => Ok(Self::HitKindKHR), + "HitKindNV" => Ok(Self::HitKindKHR), "CurrentRayTimeNV" => Ok(Self::CurrentRayTimeNV), "HitTriangleVertexPositionsKHR" => Ok(Self::HitTriangleVertexPositionsKHR), "HitMicroTriangleVertexPositionsNV" => Ok(Self::HitMicroTriangleVertexPositionsNV), "HitMicroTriangleVertexBarycentricsNV" => { Ok(Self::HitMicroTriangleVertexBarycentricsNV) } - "IncomingRayFlagsNV" => Ok(Self::IncomingRayFlagsNV), - "IncomingRayFlagsKHR" => Ok(Self::IncomingRayFlagsNV), + "IncomingRayFlagsKHR" => Ok(Self::IncomingRayFlagsKHR), + "IncomingRayFlagsNV" => Ok(Self::IncomingRayFlagsKHR), "RayGeometryIndexKHR" => Ok(Self::RayGeometryIndexKHR), "WarpsPerSMNV" => Ok(Self::WarpsPerSMNV), "SMCountNV" => Ok(Self::SMCountNV), @@ -1927,7 +1957,7 @@ pub enum Scope { impl Scope { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=6u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=6u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } @@ -1970,7 +2000,7 @@ pub enum GroupOperation { impl GroupOperation { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=3u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=3u32 => unsafe { core::mem::transmute::(n) }, 6u32..=8u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) @@ -2007,7 +2037,7 @@ pub enum KernelEnqueueFlags { impl KernelEnqueueFlags { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=2u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=2u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } @@ -2106,6 +2136,7 @@ pub enum Capability { TileImageColorReadAccessEXT = 4166u32, TileImageDepthReadAccessEXT = 4167u32, TileImageStencilReadAccessEXT = 4168u32, + CooperativeMatrixLayoutsARM = 4201u32, FragmentShadingRateKHR = 4422u32, SubgroupBallotKHR = 4423u32, DrawParameters = 4427u32, @@ -2133,11 +2164,13 @@ pub enum Capability { RoundingModeRTZ = 4468u32, RayQueryProvisionalKHR = 4471u32, RayQueryKHR = 4472u32, + UntypedPointersKHR = 4473u32, RayTraversalPrimitiveCullingKHR = 4478u32, RayTracingKHR = 4479u32, TextureSampleWeightedQCOM = 4484u32, TextureBoxFilterQCOM = 4485u32, TextureBlockMatchQCOM = 4486u32, + TextureBlockMatch2QCOM = 4498u32, Float16ImageAMD = 5008u32, ImageGatherBiasLodAMD = 5009u32, FragmentMaskAMD = 5010u32, @@ -2146,6 +2179,7 @@ pub enum Capability { Int64ImageEXT = 5016u32, ShaderClockKHR = 5055u32, ShaderEnqueueAMDX = 5067u32, + QuadControlKHR = 5087u32, SampleMaskOverrideCoverageNV = 5249u32, GeometryShaderPassthroughNV = 5251u32, ShaderViewportIndexLayerEXT = 5254u32, @@ -2157,7 +2191,7 @@ pub enum Capability { ImageFootprintNV = 5282u32, MeshShadingEXT = 5283u32, FragmentBarycentricKHR = 5284u32, - ComputeDerivativeGroupQuadsNV = 5288u32, + ComputeDerivativeGroupQuadsKHR = 5288u32, FragmentDensityEXT = 5291u32, GroupNonUniformPartitionedNV = 5297u32, ShaderNonUniform = 5301u32, @@ -2178,7 +2212,7 @@ pub enum Capability { VulkanMemoryModel = 5345u32, VulkanMemoryModelDeviceScope = 5346u32, PhysicalStorageBufferAddresses = 5347u32, - ComputeDerivativeGroupLinearNV = 5350u32, + ComputeDerivativeGroupLinearKHR = 5350u32, RayTracingProvisionalKHR = 5353u32, CooperativeMatrixNV = 5357u32, FragmentShaderSampleInterlockEXT = 5363u32, @@ -2191,7 +2225,9 @@ pub enum Capability { ShaderInvocationReorderNV = 5383u32, BindlessTextureNV = 5390u32, RayQueryPositionFetchKHR = 5391u32, + AtomicFloat16VectorNV = 5404u32, RayTracingDisplacementMicromapNV = 5409u32, + RawAccessChainsNV = 5414u32, SubgroupShuffleINTEL = 5568u32, SubgroupBufferBlockIOINTEL = 5569u32, SubgroupImageBlockIOINTEL = 5570u32, @@ -2240,8 +2276,10 @@ pub enum Capability { DotProduct = 6019u32, RayCullMaskKHR = 6020u32, CooperativeMatrixKHR = 6022u32, + ReplicatedCompositesEXT = 6024u32, BitInstructions = 6025u32, GroupNonUniformRotateKHR = 6026u32, + FloatControls2 = 6029u32, AtomicFloat32AddEXT = 6033u32, AtomicFloat64AddEXT = 6034u32, LongCompositesINTEL = 6089u32, @@ -2257,16 +2295,20 @@ pub enum Capability { FPGAArgumentInterfacesINTEL = 6174u32, GlobalVariableHostAccessINTEL = 6187u32, GlobalVariableFPGADecorationsINTEL = 6189u32, + SubgroupBufferPrefetchINTEL = 6220u32, GroupUniformArithmeticKHR = 6400u32, + MaskedGatherScatterINTEL = 6427u32, CacheControlsINTEL = 6441u32, + RegisterLimitsINTEL = 6460u32, } impl Capability { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=15u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=15u32 => unsafe { core::mem::transmute::(n) }, 17u32..=25u32 => unsafe { core::mem::transmute::(n) }, 27u32..=71u32 => unsafe { core::mem::transmute::(n) }, 4165u32..=4168u32 => unsafe { core::mem::transmute::(n) }, + 4201u32 => unsafe { core::mem::transmute::(4201u32) }, 4422u32..=4423u32 => unsafe { core::mem::transmute::(n) }, 4427u32..=4431u32 => unsafe { core::mem::transmute::(n) }, 4433u32..=4437u32 => unsafe { core::mem::transmute::(n) }, @@ -2275,14 +2317,16 @@ impl Capability { 4445u32 => unsafe { core::mem::transmute::(4445u32) }, 4447u32..=4450u32 => unsafe { core::mem::transmute::(n) }, 4464u32..=4468u32 => unsafe { core::mem::transmute::(n) }, - 4471u32..=4472u32 => unsafe { core::mem::transmute::(n) }, + 4471u32..=4473u32 => unsafe { core::mem::transmute::(n) }, 4478u32..=4479u32 => unsafe { core::mem::transmute::(n) }, 4484u32..=4486u32 => unsafe { core::mem::transmute::(n) }, + 4498u32 => unsafe { core::mem::transmute::(4498u32) }, 5008u32..=5010u32 => unsafe { core::mem::transmute::(n) }, 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) }, + 5087u32 => unsafe { core::mem::transmute::(5087u32) }, 5249u32 => unsafe { core::mem::transmute::(5249u32) }, 5251u32 => unsafe { core::mem::transmute::(5251u32) }, 5254u32..=5255u32 => unsafe { core::mem::transmute::(n) }, @@ -2304,7 +2348,9 @@ impl Capability { 5378u32..=5381u32 => unsafe { core::mem::transmute::(n) }, 5383u32 => unsafe { core::mem::transmute::(5383u32) }, 5390u32..=5391u32 => unsafe { core::mem::transmute::(n) }, + 5404u32 => unsafe { core::mem::transmute::(5404u32) }, 5409u32 => unsafe { core::mem::transmute::(5409u32) }, + 5414u32 => unsafe { core::mem::transmute::(5414u32) }, 5568u32..=5570u32 => unsafe { core::mem::transmute::(n) }, 5579u32 => unsafe { core::mem::transmute::(5579u32) }, 5582u32..=5584u32 => unsafe { core::mem::transmute::(n) }, @@ -2338,7 +2384,8 @@ impl Capability { 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) }, + 6024u32..=6026u32 => unsafe { core::mem::transmute::(n) }, + 6029u32 => unsafe { core::mem::transmute::(6029u32) }, 6033u32..=6034u32 => unsafe { core::mem::transmute::(n) }, 6089u32 => unsafe { core::mem::transmute::(6089u32) }, 6094u32..=6095u32 => unsafe { core::mem::transmute::(n) }, @@ -2351,8 +2398,11 @@ impl Capability { 6174u32 => unsafe { core::mem::transmute::(6174u32) }, 6187u32 => unsafe { core::mem::transmute::(6187u32) }, 6189u32 => unsafe { core::mem::transmute::(6189u32) }, + 6220u32 => unsafe { core::mem::transmute::(6220u32) }, 6400u32 => unsafe { core::mem::transmute::(6400u32) }, + 6427u32 => unsafe { core::mem::transmute::(6427u32) }, 6441u32 => unsafe { core::mem::transmute::(6441u32) }, + 6460u32 => unsafe { core::mem::transmute::(6460u32) }, _ => return None, }) } @@ -2363,6 +2413,7 @@ impl Capability { pub const StorageUniform16: Self = Self::UniformAndStorageBuffer16BitAccess; pub const ShaderViewportIndexLayerNV: Self = Self::ShaderViewportIndexLayerEXT; pub const FragmentBarycentricNV: Self = Self::FragmentBarycentricKHR; + pub const ComputeDerivativeGroupQuadsNV: Self = Self::ComputeDerivativeGroupQuadsKHR; pub const ShadingRateNV: Self = Self::FragmentDensityEXT; pub const ShaderNonUniformEXT: Self = Self::ShaderNonUniform; pub const RuntimeDescriptorArrayEXT: Self = Self::RuntimeDescriptorArray; @@ -2389,6 +2440,7 @@ impl Capability { pub const VulkanMemoryModelKHR: Self = Self::VulkanMemoryModel; pub const VulkanMemoryModelDeviceScopeKHR: Self = Self::VulkanMemoryModelDeviceScope; pub const PhysicalStorageBufferAddressesEXT: Self = Self::PhysicalStorageBufferAddresses; + pub const ComputeDerivativeGroupLinearNV: Self = Self::ComputeDerivativeGroupLinearKHR; pub const DemoteToHelperInvocationEXT: Self = Self::DemoteToHelperInvocation; pub const DotProductInputAllKHR: Self = Self::DotProductInputAll; pub const DotProductInput4x8BitKHR: Self = Self::DotProductInput4x8Bit; @@ -2473,6 +2525,7 @@ impl core::str::FromStr for Capability { "TileImageColorReadAccessEXT" => Ok(Self::TileImageColorReadAccessEXT), "TileImageDepthReadAccessEXT" => Ok(Self::TileImageDepthReadAccessEXT), "TileImageStencilReadAccessEXT" => Ok(Self::TileImageStencilReadAccessEXT), + "CooperativeMatrixLayoutsARM" => Ok(Self::CooperativeMatrixLayoutsARM), "FragmentShadingRateKHR" => Ok(Self::FragmentShadingRateKHR), "SubgroupBallotKHR" => Ok(Self::SubgroupBallotKHR), "DrawParameters" => Ok(Self::DrawParameters), @@ -2506,11 +2559,13 @@ impl core::str::FromStr for Capability { "RoundingModeRTZ" => Ok(Self::RoundingModeRTZ), "RayQueryProvisionalKHR" => Ok(Self::RayQueryProvisionalKHR), "RayQueryKHR" => Ok(Self::RayQueryKHR), + "UntypedPointersKHR" => Ok(Self::UntypedPointersKHR), "RayTraversalPrimitiveCullingKHR" => Ok(Self::RayTraversalPrimitiveCullingKHR), "RayTracingKHR" => Ok(Self::RayTracingKHR), "TextureSampleWeightedQCOM" => Ok(Self::TextureSampleWeightedQCOM), "TextureBoxFilterQCOM" => Ok(Self::TextureBoxFilterQCOM), "TextureBlockMatchQCOM" => Ok(Self::TextureBlockMatchQCOM), + "TextureBlockMatch2QCOM" => Ok(Self::TextureBlockMatch2QCOM), "Float16ImageAMD" => Ok(Self::Float16ImageAMD), "ImageGatherBiasLodAMD" => Ok(Self::ImageGatherBiasLodAMD), "FragmentMaskAMD" => Ok(Self::FragmentMaskAMD), @@ -2519,6 +2574,7 @@ impl core::str::FromStr for Capability { "Int64ImageEXT" => Ok(Self::Int64ImageEXT), "ShaderClockKHR" => Ok(Self::ShaderClockKHR), "ShaderEnqueueAMDX" => Ok(Self::ShaderEnqueueAMDX), + "QuadControlKHR" => Ok(Self::QuadControlKHR), "SampleMaskOverrideCoverageNV" => Ok(Self::SampleMaskOverrideCoverageNV), "GeometryShaderPassthroughNV" => Ok(Self::GeometryShaderPassthroughNV), "ShaderViewportIndexLayerEXT" => Ok(Self::ShaderViewportIndexLayerEXT), @@ -2532,7 +2588,8 @@ impl core::str::FromStr for Capability { "MeshShadingEXT" => Ok(Self::MeshShadingEXT), "FragmentBarycentricKHR" => Ok(Self::FragmentBarycentricKHR), "FragmentBarycentricNV" => Ok(Self::FragmentBarycentricKHR), - "ComputeDerivativeGroupQuadsNV" => Ok(Self::ComputeDerivativeGroupQuadsNV), + "ComputeDerivativeGroupQuadsKHR" => Ok(Self::ComputeDerivativeGroupQuadsKHR), + "ComputeDerivativeGroupQuadsNV" => Ok(Self::ComputeDerivativeGroupQuadsKHR), "FragmentDensityEXT" => Ok(Self::FragmentDensityEXT), "ShadingRateNV" => Ok(Self::FragmentDensityEXT), "GroupNonUniformPartitionedNV" => Ok(Self::GroupNonUniformPartitionedNV), @@ -2603,7 +2660,8 @@ impl core::str::FromStr for Capability { "VulkanMemoryModelDeviceScopeKHR" => Ok(Self::VulkanMemoryModelDeviceScope), "PhysicalStorageBufferAddresses" => Ok(Self::PhysicalStorageBufferAddresses), "PhysicalStorageBufferAddressesEXT" => Ok(Self::PhysicalStorageBufferAddresses), - "ComputeDerivativeGroupLinearNV" => Ok(Self::ComputeDerivativeGroupLinearNV), + "ComputeDerivativeGroupLinearKHR" => Ok(Self::ComputeDerivativeGroupLinearKHR), + "ComputeDerivativeGroupLinearNV" => Ok(Self::ComputeDerivativeGroupLinearKHR), "RayTracingProvisionalKHR" => Ok(Self::RayTracingProvisionalKHR), "CooperativeMatrixNV" => Ok(Self::CooperativeMatrixNV), "FragmentShaderSampleInterlockEXT" => Ok(Self::FragmentShaderSampleInterlockEXT), @@ -2619,7 +2677,9 @@ impl core::str::FromStr for Capability { "ShaderInvocationReorderNV" => Ok(Self::ShaderInvocationReorderNV), "BindlessTextureNV" => Ok(Self::BindlessTextureNV), "RayQueryPositionFetchKHR" => Ok(Self::RayQueryPositionFetchKHR), + "AtomicFloat16VectorNV" => Ok(Self::AtomicFloat16VectorNV), "RayTracingDisplacementMicromapNV" => Ok(Self::RayTracingDisplacementMicromapNV), + "RawAccessChainsNV" => Ok(Self::RawAccessChainsNV), "SubgroupShuffleINTEL" => Ok(Self::SubgroupShuffleINTEL), "SubgroupBufferBlockIOINTEL" => Ok(Self::SubgroupBufferBlockIOINTEL), "SubgroupImageBlockIOINTEL" => Ok(Self::SubgroupImageBlockIOINTEL), @@ -2680,8 +2740,10 @@ impl core::str::FromStr for Capability { "DotProductKHR" => Ok(Self::DotProduct), "RayCullMaskKHR" => Ok(Self::RayCullMaskKHR), "CooperativeMatrixKHR" => Ok(Self::CooperativeMatrixKHR), + "ReplicatedCompositesEXT" => Ok(Self::ReplicatedCompositesEXT), "BitInstructions" => Ok(Self::BitInstructions), "GroupNonUniformRotateKHR" => Ok(Self::GroupNonUniformRotateKHR), + "FloatControls2" => Ok(Self::FloatControls2), "AtomicFloat32AddEXT" => Ok(Self::AtomicFloat32AddEXT), "AtomicFloat64AddEXT" => Ok(Self::AtomicFloat64AddEXT), "LongCompositesINTEL" => Ok(Self::LongCompositesINTEL), @@ -2697,8 +2759,11 @@ impl core::str::FromStr for Capability { "FPGAArgumentInterfacesINTEL" => Ok(Self::FPGAArgumentInterfacesINTEL), "GlobalVariableHostAccessINTEL" => Ok(Self::GlobalVariableHostAccessINTEL), "GlobalVariableFPGADecorationsINTEL" => Ok(Self::GlobalVariableFPGADecorationsINTEL), + "SubgroupBufferPrefetchINTEL" => Ok(Self::SubgroupBufferPrefetchINTEL), "GroupUniformArithmeticKHR" => Ok(Self::GroupUniformArithmeticKHR), + "MaskedGatherScatterINTEL" => Ok(Self::MaskedGatherScatterINTEL), "CacheControlsINTEL" => Ok(Self::CacheControlsINTEL), + "RegisterLimitsINTEL" => Ok(Self::RegisterLimitsINTEL), _ => Err(()), } } @@ -2716,7 +2781,7 @@ pub enum RayQueryIntersection { impl RayQueryIntersection { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=1u32 => unsafe { core::mem::transmute::(n) }, + 1u32 => unsafe { core::mem::transmute::(1u32) }, _ => return None, }) } @@ -2747,7 +2812,7 @@ pub enum RayQueryCommittedIntersectionType { impl RayQueryCommittedIntersectionType { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=2u32 => unsafe { + 1u32..=2u32 => unsafe { core::mem::transmute::(n) }, _ => return None, @@ -2786,9 +2851,7 @@ pub enum RayQueryCandidateIntersectionType { impl RayQueryCandidateIntersectionType { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=1u32 => unsafe { - core::mem::transmute::(n) - }, + 1u32 => unsafe { core::mem::transmute::(1u32) }, _ => return None, }) } @@ -2821,7 +2884,6 @@ pub enum PackedVectorFormat { impl PackedVectorFormat { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32 => unsafe { core::mem::transmute::(0u32) }, _ => return None, }) } @@ -2850,11 +2912,14 @@ bitflags! { # [doc = "SPIR-V operand kind: [CooperativeMatrixOperands](https://w pub enum CooperativeMatrixLayout { RowMajorKHR = 0u32, ColumnMajorKHR = 1u32, + RowBlockedInterleavedARM = 4202u32, + ColumnBlockedInterleavedARM = 4203u32, } impl CooperativeMatrixLayout { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=1u32 => unsafe { core::mem::transmute::(n) }, + 1u32 => unsafe { core::mem::transmute::(1u32) }, + 4202u32..=4203u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } @@ -2867,6 +2932,8 @@ impl core::str::FromStr for CooperativeMatrixLayout { match s { "RowMajorKHR" => Ok(Self::RowMajorKHR), "ColumnMajorKHR" => Ok(Self::ColumnMajorKHR), + "RowBlockedInterleavedARM" => Ok(Self::RowBlockedInterleavedARM), + "ColumnBlockedInterleavedARM" => Ok(Self::ColumnBlockedInterleavedARM), _ => Err(()), } } @@ -2885,7 +2952,7 @@ pub enum CooperativeMatrixUse { impl CooperativeMatrixUse { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=2u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=2u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } @@ -2916,7 +2983,7 @@ pub enum InitializationModeQualifier { impl InitializationModeQualifier { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=1u32 => unsafe { core::mem::transmute::(n) }, + 1u32 => unsafe { core::mem::transmute::(1u32) }, _ => return None, }) } @@ -2949,7 +3016,7 @@ pub enum LoadCacheControl { impl LoadCacheControl { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=4u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=4u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } @@ -2984,7 +3051,7 @@ pub enum StoreCacheControl { impl StoreCacheControl { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=3u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=3u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } @@ -3003,6 +3070,59 @@ impl core::str::FromStr for StoreCacheControl { } } } +#[doc = "SPIR-V operand kind: [NamedMaximumNumberOfRegisters](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_named_maximum_number_of_registers_a_named_maximum_number_of_registers)"] +#[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 NamedMaximumNumberOfRegisters { + AutoINTEL = 0u32, +} +impl NamedMaximumNumberOfRegisters { + pub fn from_u32(n: u32) -> Option { + Some(match n { + _ => return None, + }) + } +} +#[allow(non_upper_case_globals)] +impl NamedMaximumNumberOfRegisters {} +impl core::str::FromStr for NamedMaximumNumberOfRegisters { + type Err = (); + fn from_str(s: &str) -> Result { + match s { + "AutoINTEL" => Ok(Self::AutoINTEL), + _ => Err(()), + } + } +} +#[doc = "SPIR-V operand kind: [FPEncoding](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_fp_encoding_a_fp_encoding)"] +#[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 FPEncoding { + Max = 0x7fffffff, +} +impl FPEncoding { + pub fn from_u32(n: u32) -> Option { + Some(match n { + _ => return None, + }) + } +} +#[allow(non_upper_case_globals)] +impl FPEncoding {} +impl core::str::FromStr for FPEncoding { + type Err = (); + fn from_str(s: &str) -> Result { + match s { + _ => 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)] @@ -3358,13 +3478,22 @@ pub enum Op { DepthAttachmentReadEXT = 4161u32, StencilAttachmentReadEXT = 4162u32, TerminateInvocation = 4416u32, + TypeUntypedPointerKHR = 4417u32, + UntypedVariableKHR = 4418u32, + UntypedAccessChainKHR = 4419u32, + UntypedInBoundsAccessChainKHR = 4420u32, SubgroupBallotKHR = 4421u32, SubgroupFirstInvocationKHR = 4422u32, + UntypedPtrAccessChainKHR = 4423u32, + UntypedInBoundsPtrAccessChainKHR = 4424u32, + UntypedArrayLengthKHR = 4425u32, + UntypedPrefetchKHR = 4426u32, SubgroupAllKHR = 4428u32, SubgroupAnyKHR = 4429u32, SubgroupAllEqualKHR = 4430u32, GroupNonUniformRotateKHR = 4431u32, SubgroupReadInvocationKHR = 4432u32, + ExtInstWithForwardRefsKHR = 4433u32, TraceRayKHR = 4445u32, ExecuteCallableKHR = 4446u32, ConvertUToAccelerationStructureKHR = 4447u32, @@ -3381,6 +3510,9 @@ pub enum Op { CooperativeMatrixStoreKHR = 4458u32, CooperativeMatrixMulAddKHR = 4459u32, CooperativeMatrixLengthKHR = 4460u32, + ConstantCompositeReplicateEXT = 4461u32, + SpecConstantCompositeReplicateEXT = 4462u32, + CompositeConstructReplicateEXT = 4463u32, TypeRayQueryKHR = 4472u32, RayQueryInitializeKHR = 4473u32, RayQueryTerminateKHR = 4474u32, @@ -3392,6 +3524,10 @@ pub enum Op { ImageBoxFilterQCOM = 4481u32, ImageBlockMatchSSDQCOM = 4482u32, ImageBlockMatchSADQCOM = 4483u32, + ImageBlockMatchWindowSSDQCOM = 4500u32, + ImageBlockMatchWindowSADQCOM = 4501u32, + ImageBlockMatchGatherSSDQCOM = 4502u32, + ImageBlockMatchGatherSADQCOM = 4503u32, GroupIAddNonUniformAMD = 5000u32, GroupFAddNonUniformAMD = 5001u32, GroupFMinNonUniformAMD = 5002u32, @@ -3406,6 +3542,8 @@ pub enum Op { FinalizeNodePayloadsAMDX = 5075u32, FinishWritingNodePayloadAMDX = 5078u32, InitializeNodePayloadsAMDX = 5090u32, + GroupNonUniformQuadAllKHR = 5110u32, + GroupNonUniformQuadAnyKHR = 5111u32, HitObjectRecordHitMotionNV = 5249u32, HitObjectRecordHitWithIndexMotionNV = 5250u32, HitObjectRecordMissMotionNV = 5251u32, @@ -3471,6 +3609,7 @@ pub enum Op { ConvertUToSampledImageNV = 5395u32, ConvertSampledImageToUNV = 5396u32, SamplerImageAddressingModeNV = 5397u32, + RawAccessChainNV = 5398u32, SubgroupShuffleINTEL = 5571u32, SubgroupShuffleDownINTEL = 5572u32, SubgroupShuffleUpINTEL = 5573u32, @@ -3715,6 +3854,7 @@ pub enum Op { ConvertBF16ToFINTEL = 6117u32, ControlBarrierArriveINTEL = 6142u32, ControlBarrierWaitINTEL = 6143u32, + SubgroupBlockPrefetchINTEL = 6221u32, GroupIMulKHR = 6401u32, GroupFMulKHR = 6402u32, GroupBitwiseAndKHR = 6403u32, @@ -3723,11 +3863,13 @@ pub enum Op { GroupLogicalAndKHR = 6406u32, GroupLogicalOrKHR = 6407u32, GroupLogicalXorKHR = 6408u32, + MaskedGatherINTEL = 6428u32, + MaskedScatterINTEL = 6429u32, } impl Op { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=8u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=8u32 => unsafe { core::mem::transmute::(n) }, 10u32..=12u32 => unsafe { core::mem::transmute::(n) }, 14u32..=17u32 => unsafe { core::mem::transmute::(n) }, 19u32..=39u32 => unsafe { core::mem::transmute::(n) }, @@ -3751,18 +3893,19 @@ impl Op { 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..=4460u32 => unsafe { core::mem::transmute::(n) }, + 4416u32..=4426u32 => unsafe { core::mem::transmute::(n) }, + 4428u32..=4433u32 => unsafe { core::mem::transmute::(n) }, + 4445u32..=4463u32 => unsafe { core::mem::transmute::(n) }, 4472u32..=4477u32 => unsafe { core::mem::transmute::(n) }, 4479u32..=4483u32 => unsafe { core::mem::transmute::(n) }, + 4500u32..=4503u32 => 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) }, + 5110u32..=5111u32 => unsafe { core::mem::transmute::(n) }, 5249u32..=5281u32 => unsafe { core::mem::transmute::(n) }, 5283u32 => unsafe { core::mem::transmute::(5283u32) }, 5294u32..=5296u32 => unsafe { core::mem::transmute::(n) }, @@ -3772,7 +3915,7 @@ impl Op { 5358u32..=5362u32 => unsafe { core::mem::transmute::(n) }, 5364u32..=5365u32 => unsafe { core::mem::transmute::(n) }, 5380u32..=5381u32 => unsafe { core::mem::transmute::(n) }, - 5391u32..=5397u32 => unsafe { core::mem::transmute::(n) }, + 5391u32..=5398u32 => unsafe { core::mem::transmute::(n) }, 5571u32..=5578u32 => unsafe { core::mem::transmute::(n) }, 5580u32..=5581u32 => unsafe { core::mem::transmute::(n) }, 5585u32..=5598u32 => unsafe { core::mem::transmute::(n) }, @@ -3797,7 +3940,9 @@ impl Op { 6096u32 => unsafe { core::mem::transmute::(6096u32) }, 6116u32..=6117u32 => unsafe { core::mem::transmute::(n) }, 6142u32..=6143u32 => unsafe { core::mem::transmute::(n) }, + 6221u32 => unsafe { core::mem::transmute::(6221u32) }, 6401u32..=6408u32 => unsafe { core::mem::transmute::(n) }, + 6428u32..=6429u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } @@ -3909,7 +4054,7 @@ pub enum GLOp { impl GLOp { pub fn from_u32(n: u32) -> Option { Some(match n { - 1u32..=81u32 => unsafe { core::mem::transmute::(n) }, + 2u32..=81u32 => unsafe { core::mem::transmute::(n) }, _ => return None, }) } @@ -4087,7 +4232,7 @@ pub enum CLOp { impl CLOp { pub fn from_u32(n: u32) -> Option { Some(match n { - 0u32..=110u32 => unsafe { core::mem::transmute::(n) }, + 1u32..=110u32 => unsafe { core::mem::transmute::(n) }, 141u32..=187u32 => unsafe { core::mem::transmute::(n) }, 201u32..=204u32 => unsafe { core::mem::transmute::(n) }, _ => return None,