Skip to content

Commit

Permalink
Regenerate on sdk-1.3.296.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MarijnS95 committed Nov 1, 2024
1 parent 60e916b commit 25a54a6
Show file tree
Hide file tree
Showing 18 changed files with 2,556 additions and 331 deletions.
2 changes: 1 addition & 1 deletion autogen/external/SPIRV-Headers
Submodule SPIRV-Headers updated 46 files
+10 −0 .github/dependabot.yml
+7 −7 .github/workflows/presubmit.yml
+6 −0 BUILD.bazel
+2 −1 BUILD.gn
+8 −6 CMakeLists.txt
+79 −1 LICENSE
+1 −1 README.md
+17 −11 include/spirv/spir-v.xml
+1 −1 include/spirv/unified1/AMD_gcn_shader.h
+1 −1 include/spirv/unified1/AMD_shader_ballot.h
+1 −1 include/spirv/unified1/AMD_shader_explicit_vertex_parameter.h
+1 −1 include/spirv/unified1/AMD_shader_trinary_minmax.h
+1 −1 include/spirv/unified1/DebugInfo.h
+1 −1 include/spirv/unified1/GLSL.std.450.h
+1 −1 include/spirv/unified1/NonSemanticClspvReflection.h
+1 −1 include/spirv/unified1/NonSemanticDebugBreak.h
+1 −1 include/spirv/unified1/NonSemanticDebugPrintf.h
+1 −1 include/spirv/unified1/NonSemanticShaderDebugInfo100.h
+57 −0 include/spirv/unified1/NonSemanticVkspReflection.h
+1 −1 include/spirv/unified1/OpenCL.std.h
+1 −1 include/spirv/unified1/OpenCLDebugInfo100.h
+1 −1 include/spirv/unified1/extinst.debuginfo.grammar.json
+1 −1 include/spirv/unified1/extinst.glsl.std.450.grammar.json
+1 −1 include/spirv/unified1/extinst.nonsemantic.shader.debuginfo.100.grammar.json
+138 −0 include/spirv/unified1/extinst.nonsemantic.vkspreflection.grammar.json
+1 −1 include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json
+1 −1 include/spirv/unified1/extinst.opencl.std.100.grammar.json
+129 −1 include/spirv/unified1/spirv.bf
+627 −117 include/spirv/unified1/spirv.core.grammar.json
+129 −1 include/spirv/unified1/spirv.cs
+1,900 −3 include/spirv/unified1/spirv.h
+1,904 −3 include/spirv/unified1/spirv.hpp
+1,904 −3 include/spirv/unified1/spirv.hpp11
+84 −8 include/spirv/unified1/spirv.json
+125 −1 include/spirv/unified1/spirv.lua
+74 −1 include/spirv/unified1/spirv.py
+129 −1 include/spirv/unified1/spv.d
+4 −4 tests/CMakeLists.txt
+1 −1 tests/example.cpp
+2 −2 tools/buildHeaders/bin/generate_language_headers.py
+1 −0 tools/buildHeaders/bin/makeExtinstHeaders.py
+89 −51 tools/buildHeaders/header.cpp
+1 −1 tools/buildHeaders/header.h
+76 −4 tools/buildHeaders/jsonToSpirv.cpp
+5 −2 tools/buildHeaders/jsonToSpirv.h
+1 −1 tools/buildHeaders/main.cpp
25 changes: 16 additions & 9 deletions autogen/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -77,11 +79,16 @@ fn generate_enum(
})
.collect::<Vec<_>>();

// 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),*
}

Expand Down
31 changes: 31 additions & 0 deletions rspirv/binary/autogen_decode_operand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<spirv::RawAccessChainOperands> {
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<spirv::SourceLanguage> {
if let Ok(word) = self.word() {
Expand Down Expand Up @@ -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<spirv::NamedMaximumNumberOfRegisters> {
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<spirv::FPEncoding> {
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))
}
}
}
24 changes: 24 additions & 0 deletions rspirv/binary/autogen_disas_operand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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("|")
}
}
Expand Down Expand Up @@ -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() {
Expand Down
18 changes: 18 additions & 0 deletions rspirv/binary/autogen_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -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 {}",
Expand Down Expand Up @@ -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)
}
Expand Down
26 changes: 25 additions & 1 deletion rspirv/binary/autogen_parse_operand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()?)]
}
Expand Down Expand Up @@ -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()?)],
Expand Down Expand Up @@ -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 => {
Expand Down Expand Up @@ -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()?)]
}
Expand All @@ -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![],
})
}
Expand Down
Loading

0 comments on commit 25a54a6

Please sign in to comment.