Skip to content

Commit

Permalink
Regenerate with SPIRV-Headers sdk-1.2.198
Browse files Browse the repository at this point in the history
  • Loading branch information
MarijnS95 committed Nov 22, 2021
1 parent 33b3760 commit fe1180d
Show file tree
Hide file tree
Showing 22 changed files with 7,488 additions and 1,196 deletions.
9 changes: 7 additions & 2 deletions autogen/src/dr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -866,8 +866,13 @@ pub fn gen_dr_builder_constants(grammar: &structs::Grammar) -> TokenStream {
.iter()
.filter(|inst| {
inst.class == Some(structs::Class::Constant)
&& inst.opname != "OpConstant"
&& inst.opname != "OpSpecConstant"
&& !matches!(
inst.opname.as_str(),
"OpConstant"
| "OpSpecConstant"
| "OpConstantCompositeContinuedINTEL"
| "OpSpecConstantCompositeContinuedINTEL"
)
})
.map(|inst| {
let params = get_param_list(&inst.operands, false, kinds);
Expand Down
2 changes: 1 addition & 1 deletion rspirv/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rspirv"
version = "0.11.0+1.5.4"
version = "0.11.0+sdk-1.2.198"
authors = ["Lei Zhang <antiagainst@gmail.com>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion rspirv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ First add to your `Cargo.toml`:

```toml
[dependencies]
rspirv = "0.11.0+1.5.4"
rspirv = "0.11.0+sdk-1.2.198"
```

Examples
Expand Down
95 changes: 50 additions & 45 deletions rspirv/binary/assemble.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,53 +39,58 @@ fn assemble_str(s: &str, result: &mut Vec<u32>) {
impl Assemble for dr::Operand {
fn assemble_into(&self, result: &mut Vec<u32>) {
match *self {
dr::Operand::ImageOperands(v) => result.push(v.bits()),
dr::Operand::FPFastMathMode(v) => result.push(v.bits()),
dr::Operand::SelectionControl(v) => result.push(v.bits()),
dr::Operand::LoopControl(v) => result.push(v.bits()),
dr::Operand::FunctionControl(v) => result.push(v.bits()),
dr::Operand::MemorySemantics(v) => result.push(v.bits()),
dr::Operand::MemoryAccess(v) => result.push(v.bits()),
dr::Operand::KernelProfilingInfo(v) => result.push(v.bits()),
dr::Operand::SourceLanguage(v) => result.push(v as u32),
dr::Operand::ExecutionModel(v) => result.push(v as u32),
dr::Operand::AddressingModel(v) => result.push(v as u32),
dr::Operand::MemoryModel(v) => result.push(v as u32),
dr::Operand::ExecutionMode(v) => result.push(v as u32),
dr::Operand::StorageClass(v) => result.push(v as u32),
dr::Operand::Dim(v) => result.push(v as u32),
dr::Operand::SamplerAddressingMode(v) => result.push(v as u32),
dr::Operand::SamplerFilterMode(v) => result.push(v as u32),
dr::Operand::ImageFormat(v) => result.push(v as u32),
dr::Operand::ImageChannelOrder(v) => result.push(v as u32),
dr::Operand::ImageChannelDataType(v) => result.push(v as u32),
dr::Operand::FPRoundingMode(v) => result.push(v as u32),
dr::Operand::LinkageType(v) => result.push(v as u32),
dr::Operand::AccessQualifier(v) => result.push(v as u32),
dr::Operand::FunctionParameterAttribute(v) => result.push(v as u32),
dr::Operand::Decoration(v) => result.push(v as u32),
dr::Operand::BuiltIn(v) => result.push(v as u32),
dr::Operand::Scope(v) => result.push(v as u32),
dr::Operand::GroupOperation(v) => result.push(v as u32),
dr::Operand::KernelEnqueueFlags(v) => result.push(v as u32),
dr::Operand::Capability(v) => result.push(v as u32),
dr::Operand::IdMemorySemantics(v)
| dr::Operand::IdScope(v)
| dr::Operand::IdRef(v)
| dr::Operand::LiteralInt32(v)
| dr::Operand::LiteralExtInstInteger(v) => result.push(v),
dr::Operand::LiteralInt64(v) => result.extend(&[v as u32, (v >> 32) as u32]),
dr::Operand::LiteralFloat32(v) => result.push(v.to_bits()),
dr::Operand::LiteralFloat64(v) => {
Self::ImageOperands(v) => result.push(v.bits()),
Self::FPFastMathMode(v) => result.push(v.bits()),
Self::SelectionControl(v) => result.push(v.bits()),
Self::LoopControl(v) => result.push(v.bits()),
Self::FunctionControl(v) => result.push(v.bits()),
Self::MemorySemantics(v) => result.push(v.bits()),
Self::MemoryAccess(v) => result.push(v.bits()),
Self::KernelProfilingInfo(v) => result.push(v.bits()),
Self::SourceLanguage(v) => result.push(v as u32),
Self::ExecutionModel(v) => result.push(v as u32),
Self::AddressingModel(v) => result.push(v as u32),
Self::MemoryModel(v) => result.push(v as u32),
Self::ExecutionMode(v) => result.push(v as u32),
Self::StorageClass(v) => result.push(v as u32),
Self::Dim(v) => result.push(v as u32),
Self::SamplerAddressingMode(v) => result.push(v as u32),
Self::SamplerFilterMode(v) => result.push(v as u32),
Self::ImageFormat(v) => result.push(v as u32),
Self::ImageChannelOrder(v) => result.push(v as u32),
Self::ImageChannelDataType(v) => result.push(v as u32),
Self::FPRoundingMode(v) => result.push(v as u32),
Self::LinkageType(v) => result.push(v as u32),
Self::AccessQualifier(v) => result.push(v as u32),
Self::FunctionParameterAttribute(v) => result.push(v as u32),
Self::Decoration(v) => result.push(v as u32),
Self::BuiltIn(v) => result.push(v as u32),
Self::Scope(v) => result.push(v as u32),
Self::GroupOperation(v) => result.push(v as u32),
Self::KernelEnqueueFlags(v) => result.push(v as u32),
Self::Capability(v) => result.push(v as u32),
Self::IdMemorySemantics(v)
| Self::IdScope(v)
| Self::IdRef(v)
| Self::LiteralInt32(v)
| Self::LiteralExtInstInteger(v) => result.push(v),
Self::LiteralInt64(v) => result.extend(&[v as u32, (v >> 32) as u32]),
Self::LiteralFloat32(v) => result.push(v.to_bits()),
Self::LiteralFloat64(v) => {
result.extend(&[v.to_bits() as u32, (v.to_bits() >> 32) as u32])
}
dr::Operand::LiteralSpecConstantOpInteger(v) => result.push(v as u32),
dr::Operand::LiteralString(ref v) => assemble_str(v, result),
dr::Operand::RayFlags(ref v) => result.push(v.bits()),
dr::Operand::RayQueryIntersection(v) => result.push(v as u32),
dr::Operand::RayQueryCommittedIntersectionType(v) => result.push(v as u32),
dr::Operand::RayQueryCandidateIntersectionType(v) => result.push(v as u32),
dr::Operand::FragmentShadingRate(v) => result.push(v.bits()),
Self::LiteralSpecConstantOpInteger(v) => result.push(v as u32),
Self::LiteralString(ref v) => assemble_str(v, result),
Self::RayFlags(ref v) => result.push(v.bits()),
Self::RayQueryIntersection(v) => result.push(v as u32),
Self::RayQueryCommittedIntersectionType(v) => result.push(v as u32),
Self::RayQueryCandidateIntersectionType(v) => result.push(v as u32),
Self::FragmentShadingRate(v) => result.push(v.bits()),
Self::FPDenormMode(v) => result.push(v as u32),
Self::QuantizationModes(v) => result.push(v as u32),
Self::FPOperationMode(v) => result.push(v as u32),
Self::OverflowModes(v) => result.push(v as u32),
Self::PackedVectorFormat(v) => result.push(v as u32),
}
}
}
Expand Down
55 changes: 55 additions & 0 deletions rspirv/binary/autogen_decode_operand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,50 @@ impl<'a> Decoder<'a> {
Err(Error::StreamExpected(self.offset))
}
}
#[doc = "Decodes and returns the next SPIR-V word as\na SPIR-V FPDenormMode value."]
pub fn fp_denorm_mode(&mut self) -> Result<spirv::FPDenormMode> {
if let Ok(word) = self.word() {
spirv::FPDenormMode::from_u32(word).ok_or(Error::FPDenormModeUnknown(
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 QuantizationModes value."]
pub fn quantization_modes(&mut self) -> Result<spirv::QuantizationModes> {
if let Ok(word) = self.word() {
spirv::QuantizationModes::from_u32(word).ok_or(Error::QuantizationModesUnknown(
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 FPOperationMode value."]
pub fn fp_operation_mode(&mut self) -> Result<spirv::FPOperationMode> {
if let Ok(word) = self.word() {
spirv::FPOperationMode::from_u32(word).ok_or(Error::FPOperationModeUnknown(
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 OverflowModes value."]
pub fn overflow_modes(&mut self) -> Result<spirv::OverflowModes> {
if let Ok(word) = self.word() {
spirv::OverflowModes::from_u32(word).ok_or(Error::OverflowModesUnknown(
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 LinkageType value."]
pub fn linkage_type(&mut self) -> Result<spirv::LinkageType> {
if let Ok(word) = self.word() {
Expand Down Expand Up @@ -376,4 +420,15 @@ impl<'a> Decoder<'a> {
Err(Error::StreamExpected(self.offset))
}
}
#[doc = "Decodes and returns the next SPIR-V word as\na SPIR-V PackedVectorFormat value."]
pub fn packed_vector_format(&mut self) -> Result<spirv::PackedVectorFormat> {
if let Ok(word) = self.word() {
spirv::PackedVectorFormat::from_u32(word).ok_or(Error::PackedVectorFormatUnknown(
self.offset - WORD_NUM_BYTES,
word,
))
} else {
Err(Error::StreamExpected(self.offset))
}
}
}
15 changes: 15 additions & 0 deletions rspirv/binary/autogen_disas_operand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ impl Disassemble for spirv::ImageOperands {
if self.contains(spirv::ImageOperands::ZERO_EXTEND) {
bits.push("ZeroExtend")
}
if self.contains(spirv::ImageOperands::OFFSETS) {
bits.push("Offsets")
}
bits.join("|")
}
}
Expand All @@ -86,6 +89,12 @@ impl Disassemble for spirv::FPFastMathMode {
if self.contains(spirv::FPFastMathMode::FAST) {
bits.push("Fast")
}
if self.contains(spirv::FPFastMathMode::ALLOW_CONTRACT_FAST_INTEL) {
bits.push("AllowContractFastINTEL")
}
if self.contains(spirv::FPFastMathMode::ALLOW_REASSOC_INTEL) {
bits.push("AllowReassocINTEL")
}
bits.join("|")
}
}
Expand Down Expand Up @@ -158,6 +167,9 @@ impl Disassemble for spirv::LoopControl {
if self.contains(spirv::LoopControl::SPECULATED_ITERATIONS_INTEL) {
bits.push("SpeculatedIterationsINTEL")
}
if self.contains(spirv::LoopControl::NO_FUSION_INTEL) {
bits.push("NoFusionINTEL")
}
bits.join("|")
}
}
Expand All @@ -179,6 +191,9 @@ impl Disassemble for spirv::FunctionControl {
if self.contains(spirv::FunctionControl::CONST) {
bits.push("Const")
}
if self.contains(spirv::FunctionControl::OPT_NONE_INTEL) {
bits.push("OptNoneINTEL")
}
bits.join("|")
}
}
Expand Down
30 changes: 30 additions & 0 deletions rspirv/binary/autogen_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ pub enum Error {
ImageChannelOrderUnknown(usize, spirv::Word),
ImageChannelDataTypeUnknown(usize, spirv::Word),
FPRoundingModeUnknown(usize, spirv::Word),
FPDenormModeUnknown(usize, spirv::Word),
QuantizationModesUnknown(usize, spirv::Word),
FPOperationModeUnknown(usize, spirv::Word),
OverflowModesUnknown(usize, spirv::Word),
LinkageTypeUnknown(usize, spirv::Word),
AccessQualifierUnknown(usize, spirv::Word),
FunctionParameterAttributeUnknown(usize, spirv::Word),
Expand All @@ -44,6 +48,7 @@ pub enum Error {
RayQueryIntersectionUnknown(usize, spirv::Word),
RayQueryCommittedIntersectionTypeUnknown(usize, spirv::Word),
RayQueryCandidateIntersectionTypeUnknown(usize, spirv::Word),
PackedVectorFormatUnknown(usize, spirv::Word),
#[doc = r"Failed to decode a string."]
#[doc = r""]
#[doc = r"For structured error handling, the second element could be"]
Expand Down Expand Up @@ -173,6 +178,26 @@ impl fmt::Display for Error {
"unknown value {} for operand kind FPRoundingMode at index {}",
word, index
),
Error::FPDenormModeUnknown(index, word) => write!(
f,
"unknown value {} for operand kind FPDenormMode at index {}",
word, index
),
Error::QuantizationModesUnknown(index, word) => write!(
f,
"unknown value {} for operand kind QuantizationModes at index {}",
word, index
),
Error::FPOperationModeUnknown(index, word) => write!(
f,
"unknown value {} for operand kind FPOperationMode at index {}",
word, index
),
Error::OverflowModesUnknown(index, word) => write!(
f,
"unknown value {} for operand kind OverflowModes at index {}",
word, index
),
Error::LinkageTypeUnknown(index, word) => write!(
f,
"unknown value {} for operand kind LinkageType at index {}",
Expand Down Expand Up @@ -233,6 +258,11 @@ impl fmt::Display for Error {
"unknown value {} for operand kind RayQueryCandidateIntersectionType at index {}",
word, index
),
Error::PackedVectorFormatUnknown(index, word) => write!(
f,
"unknown value {} for operand kind PackedVectorFormat at index {}",
word, index
),
Error::DecodeStringFailed(index, ref e) => {
write!(f, "cannot decode string at index {}: {}", index, e)
}
Expand Down
Loading

0 comments on commit fe1180d

Please sign in to comment.