Source code

Revision control

Copy as Markdown

Other Tools

// AUTOMATICALLY GENERATED from the SPIR-V JSON grammar:
// external/spirv.core.grammar.json.
// DO NOT MODIFY!
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;
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: [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 ; } }
bitflags! { # [doc = "SPIR-V operand kind: [MemorySemantics](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_memory_semantics_a_memory_semantics)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct MemorySemantics : u32 { const RELAXED = 0u32 ; const NONE = 0u32 ; const ACQUIRE = 2u32 ; const RELEASE = 4u32 ; const ACQUIRE_RELEASE = 8u32 ; const SEQUENTIALLY_CONSISTENT = 16u32 ; const UNIFORM_MEMORY = 64u32 ; const SUBGROUP_MEMORY = 128u32 ; const WORKGROUP_MEMORY = 256u32 ; const CROSS_WORKGROUP_MEMORY = 512u32 ; const ATOMIC_COUNTER_MEMORY = 1024u32 ; const IMAGE_MEMORY = 2048u32 ; const OUTPUT_MEMORY = 4096u32 ; const OUTPUT_MEMORY_KHR = 4096u32 ; const MAKE_AVAILABLE = 8192u32 ; const MAKE_AVAILABLE_KHR = 8192u32 ; const MAKE_VISIBLE = 16384u32 ; const MAKE_VISIBLE_KHR = 16384u32 ; const VOLATILE = 32768u32 ; } }
bitflags! { # [doc = "SPIR-V operand kind: [MemoryAccess](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_memory_access_a_memory_access)"] # [derive (Clone , Copy , Debug , PartialEq , Eq , Hash)] # [cfg_attr (feature = "serialize" , derive (serde :: Serialize))] # [cfg_attr (feature = "deserialize" , derive (serde :: Deserialize))] pub struct MemoryAccess : u32 { const NONE = 0u32 ; const VOLATILE = 1u32 ; const ALIGNED = 2u32 ; const NONTEMPORAL = 4u32 ; const MAKE_POINTER_AVAILABLE = 8u32 ; const MAKE_POINTER_AVAILABLE_KHR = 8u32 ; const MAKE_POINTER_VISIBLE = 16u32 ; const MAKE_POINTER_VISIBLE_KHR = 16u32 ; const NON_PRIVATE_POINTER = 32u32 ; const NON_PRIVATE_POINTER_KHR = 32u32 ; const ALIAS_SCOPE_INTEL_MASK = 65536u32 ; const NO_ALIAS_INTEL_MASK = 131072u32 ; } }
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 ; } }
#[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 SourceLanguage {
Unknown = 0u32,
ESSL = 1u32,
GLSL = 2u32,
OpenCL_C = 3u32,
OpenCL_CPP = 4u32,
HLSL = 5u32,
CPP_for_OpenCL = 6u32,
SYCL = 7u32,
HERO_C = 8u32,
NZSL = 9u32,
WGSL = 10u32,
Slang = 11u32,
}
impl SourceLanguage {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=11u32 => unsafe { core::mem::transmute::<u32, SourceLanguage>(n) },
_ => return None,
})
}
}
#[allow(non_upper_case_globals)]
impl SourceLanguage {}
impl core::str::FromStr for SourceLanguage {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"Unknown" => Ok(Self::Unknown),
"ESSL" => Ok(Self::ESSL),
"GLSL" => Ok(Self::GLSL),
"OpenCL_C" => Ok(Self::OpenCL_C),
"OpenCL_CPP" => Ok(Self::OpenCL_CPP),
"HLSL" => Ok(Self::HLSL),
"CPP_for_OpenCL" => Ok(Self::CPP_for_OpenCL),
"SYCL" => Ok(Self::SYCL),
"HERO_C" => Ok(Self::HERO_C),
"NZSL" => Ok(Self::NZSL),
"WGSL" => Ok(Self::WGSL),
"Slang" => Ok(Self::Slang),
_ => Err(()),
}
}
}
#[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 ExecutionModel {
Vertex = 0u32,
TessellationControl = 1u32,
TessellationEvaluation = 2u32,
Geometry = 3u32,
Fragment = 4u32,
GLCompute = 5u32,
Kernel = 6u32,
TaskNV = 5267u32,
MeshNV = 5268u32,
RayGenerationNV = 5313u32,
IntersectionNV = 5314u32,
AnyHitNV = 5315u32,
ClosestHitNV = 5316u32,
MissNV = 5317u32,
CallableNV = 5318u32,
TaskEXT = 5364u32,
MeshEXT = 5365u32,
}
impl ExecutionModel {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=6u32 => unsafe { core::mem::transmute::<u32, ExecutionModel>(n) },
5267u32..=5268u32 => unsafe { core::mem::transmute::<u32, ExecutionModel>(n) },
5313u32..=5318u32 => unsafe { core::mem::transmute::<u32, ExecutionModel>(n) },
5364u32..=5365u32 => unsafe { core::mem::transmute::<u32, ExecutionModel>(n) },
_ => return None,
})
}
}
#[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;
}
impl core::str::FromStr for ExecutionModel {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"Vertex" => Ok(Self::Vertex),
"TessellationControl" => Ok(Self::TessellationControl),
"TessellationEvaluation" => Ok(Self::TessellationEvaluation),
"Geometry" => Ok(Self::Geometry),
"Fragment" => Ok(Self::Fragment),
"GLCompute" => Ok(Self::GLCompute),
"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),
"TaskEXT" => Ok(Self::TaskEXT),
"MeshEXT" => Ok(Self::MeshEXT),
_ => Err(()),
}
}
}
#[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 AddressingModel {
Logical = 0u32,
Physical32 = 1u32,
Physical64 = 2u32,
PhysicalStorageBuffer64 = 5348u32,
}
impl AddressingModel {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=2u32 => unsafe { core::mem::transmute::<u32, AddressingModel>(n) },
5348u32 => unsafe { core::mem::transmute::<u32, AddressingModel>(5348u32) },
_ => return None,
})
}
}
#[allow(non_upper_case_globals)]
impl AddressingModel {
pub const PhysicalStorageBuffer64EXT: Self = Self::PhysicalStorageBuffer64;
}
impl core::str::FromStr for AddressingModel {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"Logical" => Ok(Self::Logical),
"Physical32" => Ok(Self::Physical32),
"Physical64" => Ok(Self::Physical64),
"PhysicalStorageBuffer64" => Ok(Self::PhysicalStorageBuffer64),
"PhysicalStorageBuffer64EXT" => Ok(Self::PhysicalStorageBuffer64),
_ => Err(()),
}
}
}
#[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 MemoryModel {
Simple = 0u32,
GLSL450 = 1u32,
OpenCL = 2u32,
Vulkan = 3u32,
}
impl MemoryModel {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=3u32 => unsafe { core::mem::transmute::<u32, MemoryModel>(n) },
_ => return None,
})
}
}
#[allow(non_upper_case_globals)]
impl MemoryModel {
pub const VulkanKHR: Self = Self::Vulkan;
}
impl core::str::FromStr for MemoryModel {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"Simple" => Ok(Self::Simple),
"GLSL450" => Ok(Self::GLSL450),
"OpenCL" => Ok(Self::OpenCL),
"Vulkan" => Ok(Self::Vulkan),
"VulkanKHR" => Ok(Self::Vulkan),
_ => Err(()),
}
}
}
#[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 ExecutionMode {
Invocations = 0u32,
SpacingEqual = 1u32,
SpacingFractionalEven = 2u32,
SpacingFractionalOdd = 3u32,
VertexOrderCw = 4u32,
VertexOrderCcw = 5u32,
PixelCenterInteger = 6u32,
OriginUpperLeft = 7u32,
OriginLowerLeft = 8u32,
EarlyFragmentTests = 9u32,
PointMode = 10u32,
Xfb = 11u32,
DepthReplacing = 12u32,
DepthGreater = 14u32,
DepthLess = 15u32,
DepthUnchanged = 16u32,
LocalSize = 17u32,
LocalSizeHint = 18u32,
InputPoints = 19u32,
InputLines = 20u32,
InputLinesAdjacency = 21u32,
Triangles = 22u32,
InputTrianglesAdjacency = 23u32,
Quads = 24u32,
Isolines = 25u32,
OutputVertices = 26u32,
OutputPoints = 27u32,
OutputLineStrip = 28u32,
OutputTriangleStrip = 29u32,
VecTypeHint = 30u32,
ContractionOff = 31u32,
Initializer = 33u32,
Finalizer = 34u32,
SubgroupSize = 35u32,
SubgroupsPerWorkgroup = 36u32,
SubgroupsPerWorkgroupId = 37u32,
LocalSizeId = 38u32,
LocalSizeHintId = 39u32,
NonCoherentColorAttachmentReadEXT = 4169u32,
NonCoherentDepthAttachmentReadEXT = 4170u32,
NonCoherentStencilAttachmentReadEXT = 4171u32,
SubgroupUniformControlFlowKHR = 4421u32,
PostDepthCoverage = 4446u32,
DenormPreserve = 4459u32,
DenormFlushToZero = 4460u32,
SignedZeroInfNanPreserve = 4461u32,
RoundingModeRTE = 4462u32,
RoundingModeRTZ = 4463u32,
EarlyAndLateFragmentTestsAMD = 5017u32,
StencilRefReplacingEXT = 5027u32,
CoalescingAMDX = 5069u32,
MaxNodeRecursionAMDX = 5071u32,
StaticNumWorkgroupsAMDX = 5072u32,
ShaderIndexAMDX = 5073u32,
MaxNumWorkgroupsAMDX = 5077u32,
StencilRefUnchangedFrontAMD = 5079u32,
StencilRefGreaterFrontAMD = 5080u32,
StencilRefLessFrontAMD = 5081u32,
StencilRefUnchangedBackAMD = 5082u32,
StencilRefGreaterBackAMD = 5083u32,
StencilRefLessBackAMD = 5084u32,
OutputLinesNV = 5269u32,
OutputPrimitivesNV = 5270u32,
DerivativeGroupQuadsNV = 5289u32,
DerivativeGroupLinearNV = 5290u32,
OutputTrianglesNV = 5298u32,
PixelInterlockOrderedEXT = 5366u32,
PixelInterlockUnorderedEXT = 5367u32,
SampleInterlockOrderedEXT = 5368u32,
SampleInterlockUnorderedEXT = 5369u32,
ShadingRateInterlockOrderedEXT = 5370u32,
ShadingRateInterlockUnorderedEXT = 5371u32,
SharedLocalMemorySizeINTEL = 5618u32,
RoundingModeRTPINTEL = 5620u32,
RoundingModeRTNINTEL = 5621u32,
FloatingPointModeALTINTEL = 5622u32,
FloatingPointModeIEEEINTEL = 5623u32,
MaxWorkgroupSizeINTEL = 5893u32,
MaxWorkDimINTEL = 5894u32,
NoGlobalOffsetINTEL = 5895u32,
NumSIMDWorkitemsINTEL = 5896u32,
SchedulerTargetFmaxMhzINTEL = 5903u32,
StreamingInterfaceINTEL = 6154u32,
RegisterMapInterfaceINTEL = 6160u32,
NamedBarrierCountINTEL = 6417u32,
}
impl ExecutionMode {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=12u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(n) },
14u32..=31u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(n) },
33u32..=39u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(n) },
4169u32..=4171u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(n) },
4421u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(4421u32) },
4446u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(4446u32) },
4459u32..=4463u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(n) },
5017u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(5017u32) },
5027u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(5027u32) },
5069u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(5069u32) },
5071u32..=5073u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(n) },
5077u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(5077u32) },
5079u32..=5084u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(n) },
5269u32..=5270u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(n) },
5289u32..=5290u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(n) },
5298u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(5298u32) },
5366u32..=5371u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(n) },
5618u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(5618u32) },
5620u32..=5623u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(n) },
5893u32..=5896u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(n) },
5903u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(5903u32) },
6154u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(6154u32) },
6160u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(6160u32) },
6417u32 => unsafe { core::mem::transmute::<u32, ExecutionMode>(6417u32) },
_ => 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;
}
impl core::str::FromStr for ExecutionMode {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"Invocations" => Ok(Self::Invocations),
"SpacingEqual" => Ok(Self::SpacingEqual),
"SpacingFractionalEven" => Ok(Self::SpacingFractionalEven),
"SpacingFractionalOdd" => Ok(Self::SpacingFractionalOdd),
"VertexOrderCw" => Ok(Self::VertexOrderCw),
"VertexOrderCcw" => Ok(Self::VertexOrderCcw),
"PixelCenterInteger" => Ok(Self::PixelCenterInteger),
"OriginUpperLeft" => Ok(Self::OriginUpperLeft),
"OriginLowerLeft" => Ok(Self::OriginLowerLeft),
"EarlyFragmentTests" => Ok(Self::EarlyFragmentTests),
"PointMode" => Ok(Self::PointMode),
"Xfb" => Ok(Self::Xfb),
"DepthReplacing" => Ok(Self::DepthReplacing),
"DepthGreater" => Ok(Self::DepthGreater),
"DepthLess" => Ok(Self::DepthLess),
"DepthUnchanged" => Ok(Self::DepthUnchanged),
"LocalSize" => Ok(Self::LocalSize),
"LocalSizeHint" => Ok(Self::LocalSizeHint),
"InputPoints" => Ok(Self::InputPoints),
"InputLines" => Ok(Self::InputLines),
"InputLinesAdjacency" => Ok(Self::InputLinesAdjacency),
"Triangles" => Ok(Self::Triangles),
"InputTrianglesAdjacency" => Ok(Self::InputTrianglesAdjacency),
"Quads" => Ok(Self::Quads),
"Isolines" => Ok(Self::Isolines),
"OutputVertices" => Ok(Self::OutputVertices),
"OutputPoints" => Ok(Self::OutputPoints),
"OutputLineStrip" => Ok(Self::OutputLineStrip),
"OutputTriangleStrip" => Ok(Self::OutputTriangleStrip),
"VecTypeHint" => Ok(Self::VecTypeHint),
"ContractionOff" => Ok(Self::ContractionOff),
"Initializer" => Ok(Self::Initializer),
"Finalizer" => Ok(Self::Finalizer),
"SubgroupSize" => Ok(Self::SubgroupSize),
"SubgroupsPerWorkgroup" => Ok(Self::SubgroupsPerWorkgroup),
"SubgroupsPerWorkgroupId" => Ok(Self::SubgroupsPerWorkgroupId),
"LocalSizeId" => Ok(Self::LocalSizeId),
"LocalSizeHintId" => Ok(Self::LocalSizeHintId),
"NonCoherentColorAttachmentReadEXT" => Ok(Self::NonCoherentColorAttachmentReadEXT),
"NonCoherentDepthAttachmentReadEXT" => Ok(Self::NonCoherentDepthAttachmentReadEXT),
"NonCoherentStencilAttachmentReadEXT" => Ok(Self::NonCoherentStencilAttachmentReadEXT),
"SubgroupUniformControlFlowKHR" => Ok(Self::SubgroupUniformControlFlowKHR),
"PostDepthCoverage" => Ok(Self::PostDepthCoverage),
"DenormPreserve" => Ok(Self::DenormPreserve),
"DenormFlushToZero" => Ok(Self::DenormFlushToZero),
"SignedZeroInfNanPreserve" => Ok(Self::SignedZeroInfNanPreserve),
"RoundingModeRTE" => Ok(Self::RoundingModeRTE),
"RoundingModeRTZ" => Ok(Self::RoundingModeRTZ),
"EarlyAndLateFragmentTestsAMD" => Ok(Self::EarlyAndLateFragmentTestsAMD),
"StencilRefReplacingEXT" => Ok(Self::StencilRefReplacingEXT),
"CoalescingAMDX" => Ok(Self::CoalescingAMDX),
"MaxNodeRecursionAMDX" => Ok(Self::MaxNodeRecursionAMDX),
"StaticNumWorkgroupsAMDX" => Ok(Self::StaticNumWorkgroupsAMDX),
"ShaderIndexAMDX" => Ok(Self::ShaderIndexAMDX),
"MaxNumWorkgroupsAMDX" => Ok(Self::MaxNumWorkgroupsAMDX),
"StencilRefUnchangedFrontAMD" => Ok(Self::StencilRefUnchangedFrontAMD),
"StencilRefGreaterFrontAMD" => Ok(Self::StencilRefGreaterFrontAMD),
"StencilRefLessFrontAMD" => Ok(Self::StencilRefLessFrontAMD),
"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),
"PixelInterlockOrderedEXT" => Ok(Self::PixelInterlockOrderedEXT),
"PixelInterlockUnorderedEXT" => Ok(Self::PixelInterlockUnorderedEXT),
"SampleInterlockOrderedEXT" => Ok(Self::SampleInterlockOrderedEXT),
"SampleInterlockUnorderedEXT" => Ok(Self::SampleInterlockUnorderedEXT),
"ShadingRateInterlockOrderedEXT" => Ok(Self::ShadingRateInterlockOrderedEXT),
"ShadingRateInterlockUnorderedEXT" => Ok(Self::ShadingRateInterlockUnorderedEXT),
"SharedLocalMemorySizeINTEL" => Ok(Self::SharedLocalMemorySizeINTEL),
"RoundingModeRTPINTEL" => Ok(Self::RoundingModeRTPINTEL),
"RoundingModeRTNINTEL" => Ok(Self::RoundingModeRTNINTEL),
"FloatingPointModeALTINTEL" => Ok(Self::FloatingPointModeALTINTEL),
"FloatingPointModeIEEEINTEL" => Ok(Self::FloatingPointModeIEEEINTEL),
"MaxWorkgroupSizeINTEL" => Ok(Self::MaxWorkgroupSizeINTEL),
"MaxWorkDimINTEL" => Ok(Self::MaxWorkDimINTEL),
"NoGlobalOffsetINTEL" => Ok(Self::NoGlobalOffsetINTEL),
"NumSIMDWorkitemsINTEL" => Ok(Self::NumSIMDWorkitemsINTEL),
"SchedulerTargetFmaxMhzINTEL" => Ok(Self::SchedulerTargetFmaxMhzINTEL),
"StreamingInterfaceINTEL" => Ok(Self::StreamingInterfaceINTEL),
"RegisterMapInterfaceINTEL" => Ok(Self::RegisterMapInterfaceINTEL),
"NamedBarrierCountINTEL" => Ok(Self::NamedBarrierCountINTEL),
_ => Err(()),
}
}
}
#[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 StorageClass {
UniformConstant = 0u32,
Input = 1u32,
Uniform = 2u32,
Output = 3u32,
Workgroup = 4u32,
CrossWorkgroup = 5u32,
Private = 6u32,
Function = 7u32,
Generic = 8u32,
PushConstant = 9u32,
AtomicCounter = 10u32,
Image = 11u32,
StorageBuffer = 12u32,
TileImageEXT = 4172u32,
NodePayloadAMDX = 5068u32,
NodeOutputPayloadAMDX = 5076u32,
CallableDataNV = 5328u32,
IncomingCallableDataNV = 5329u32,
RayPayloadNV = 5338u32,
HitAttributeNV = 5339u32,
IncomingRayPayloadNV = 5342u32,
ShaderRecordBufferNV = 5343u32,
PhysicalStorageBuffer = 5349u32,
HitObjectAttributeNV = 5385u32,
TaskPayloadWorkgroupEXT = 5402u32,
CodeSectionINTEL = 5605u32,
DeviceOnlyINTEL = 5936u32,
HostOnlyINTEL = 5937u32,
}
impl StorageClass {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=12u32 => unsafe { core::mem::transmute::<u32, StorageClass>(n) },
4172u32 => unsafe { core::mem::transmute::<u32, StorageClass>(4172u32) },
5068u32 => unsafe { core::mem::transmute::<u32, StorageClass>(5068u32) },
5076u32 => unsafe { core::mem::transmute::<u32, StorageClass>(5076u32) },
5328u32..=5329u32 => unsafe { core::mem::transmute::<u32, StorageClass>(n) },
5338u32..=5339u32 => unsafe { core::mem::transmute::<u32, StorageClass>(n) },
5342u32..=5343u32 => unsafe { core::mem::transmute::<u32, StorageClass>(n) },
5349u32 => unsafe { core::mem::transmute::<u32, StorageClass>(5349u32) },
5385u32 => unsafe { core::mem::transmute::<u32, StorageClass>(5385u32) },
5402u32 => unsafe { core::mem::transmute::<u32, StorageClass>(5402u32) },
5605u32 => unsafe { core::mem::transmute::<u32, StorageClass>(5605u32) },
5936u32..=5937u32 => unsafe { core::mem::transmute::<u32, StorageClass>(n) },
_ => return None,
})
}
}
#[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 PhysicalStorageBufferEXT: Self = Self::PhysicalStorageBuffer;
}
impl core::str::FromStr for StorageClass {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"UniformConstant" => Ok(Self::UniformConstant),
"Input" => Ok(Self::Input),
"Uniform" => Ok(Self::Uniform),
"Output" => Ok(Self::Output),
"Workgroup" => Ok(Self::Workgroup),
"CrossWorkgroup" => Ok(Self::CrossWorkgroup),
"Private" => Ok(Self::Private),
"Function" => Ok(Self::Function),
"Generic" => Ok(Self::Generic),
"PushConstant" => Ok(Self::PushConstant),
"AtomicCounter" => Ok(Self::AtomicCounter),
"Image" => Ok(Self::Image),
"StorageBuffer" => Ok(Self::StorageBuffer),
"TileImageEXT" => Ok(Self::TileImageEXT),
"NodePayloadAMDX" => Ok(Self::NodePayloadAMDX),
"NodeOutputPayloadAMDX" => Ok(Self::NodeOutputPayloadAMDX),
"CallableDataNV" => Ok(Self::CallableDataNV),
"CallableDataKHR" => Ok(Self::CallableDataNV),
"IncomingCallableDataNV" => Ok(Self::IncomingCallableDataNV),
"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),
"PhysicalStorageBuffer" => Ok(Self::PhysicalStorageBuffer),
"PhysicalStorageBufferEXT" => Ok(Self::PhysicalStorageBuffer),
"HitObjectAttributeNV" => Ok(Self::HitObjectAttributeNV),
"TaskPayloadWorkgroupEXT" => Ok(Self::TaskPayloadWorkgroupEXT),
"CodeSectionINTEL" => Ok(Self::CodeSectionINTEL),
"DeviceOnlyINTEL" => Ok(Self::DeviceOnlyINTEL),
"HostOnlyINTEL" => Ok(Self::HostOnlyINTEL),
_ => Err(()),
}
}
}
#[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 Dim {
Dim1D = 0u32,
Dim2D = 1u32,
Dim3D = 2u32,
DimCube = 3u32,
DimRect = 4u32,
DimBuffer = 5u32,
DimSubpassData = 6u32,
DimTileImageDataEXT = 4173u32,
}
impl Dim {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=6u32 => unsafe { core::mem::transmute::<u32, Dim>(n) },
4173u32 => unsafe { core::mem::transmute::<u32, Dim>(4173u32) },
_ => return None,
})
}
}
#[allow(non_upper_case_globals)]
impl Dim {}
impl core::str::FromStr for Dim {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"Dim1D" => Ok(Self::Dim1D),
"Dim2D" => Ok(Self::Dim2D),
"Dim3D" => Ok(Self::Dim3D),
"DimCube" => Ok(Self::DimCube),
"DimRect" => Ok(Self::DimRect),
"DimBuffer" => Ok(Self::DimBuffer),
"DimSubpassData" => Ok(Self::DimSubpassData),
"DimTileImageDataEXT" => Ok(Self::DimTileImageDataEXT),
_ => Err(()),
}
}
}
#[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 SamplerAddressingMode {
None = 0u32,
ClampToEdge = 1u32,
Clamp = 2u32,
Repeat = 3u32,
RepeatMirrored = 4u32,
}
impl SamplerAddressingMode {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=4u32 => unsafe { core::mem::transmute::<u32, SamplerAddressingMode>(n) },
_ => return None,
})
}
}
#[allow(non_upper_case_globals)]
impl SamplerAddressingMode {}
impl core::str::FromStr for SamplerAddressingMode {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"None" => Ok(Self::None),
"ClampToEdge" => Ok(Self::ClampToEdge),
"Clamp" => Ok(Self::Clamp),
"Repeat" => Ok(Self::Repeat),
"RepeatMirrored" => Ok(Self::RepeatMirrored),
_ => Err(()),
}
}
}
#[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 SamplerFilterMode {
Nearest = 0u32,
Linear = 1u32,
}
impl SamplerFilterMode {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=1u32 => unsafe { core::mem::transmute::<u32, SamplerFilterMode>(n) },
_ => return None,
})
}
}
#[allow(non_upper_case_globals)]
impl SamplerFilterMode {}
impl core::str::FromStr for SamplerFilterMode {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"Nearest" => Ok(Self::Nearest),
"Linear" => Ok(Self::Linear),
_ => Err(()),
}
}
}
#[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 ImageFormat {
Unknown = 0u32,
Rgba32f = 1u32,
Rgba16f = 2u32,
R32f = 3u32,
Rgba8 = 4u32,
Rgba8Snorm = 5u32,
Rg32f = 6u32,
Rg16f = 7u32,
R11fG11fB10f = 8u32,
R16f = 9u32,
Rgba16 = 10u32,
Rgb10A2 = 11u32,
Rg16 = 12u32,
Rg8 = 13u32,
R16 = 14u32,
R8 = 15u32,
Rgba16Snorm = 16u32,
Rg16Snorm = 17u32,
Rg8Snorm = 18u32,
R16Snorm = 19u32,
R8Snorm = 20u32,
Rgba32i = 21u32,
Rgba16i = 22u32,
Rgba8i = 23u32,
R32i = 24u32,
Rg32i = 25u32,
Rg16i = 26u32,
Rg8i = 27u32,
R16i = 28u32,
R8i = 29u32,
Rgba32ui = 30u32,
Rgba16ui = 31u32,
Rgba8ui = 32u32,
R32ui = 33u32,
Rgb10a2ui = 34u32,
Rg32ui = 35u32,
Rg16ui = 36u32,
Rg8ui = 37u32,
R16ui = 38u32,
R8ui = 39u32,
R64ui = 40u32,
R64i = 41u32,
}
impl ImageFormat {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=41u32 => unsafe { core::mem::transmute::<u32, ImageFormat>(n) },
_ => return None,
})
}
}
#[allow(non_upper_case_globals)]
impl ImageFormat {}
impl core::str::FromStr for ImageFormat {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"Unknown" => Ok(Self::Unknown),
"Rgba32f" => Ok(Self::Rgba32f),
"Rgba16f" => Ok(Self::Rgba16f),
"R32f" => Ok(Self::R32f),
"Rgba8" => Ok(Self::Rgba8),
"Rgba8Snorm" => Ok(Self::Rgba8Snorm),
"Rg32f" => Ok(Self::Rg32f),
"Rg16f" => Ok(Self::Rg16f),
"R11fG11fB10f" => Ok(Self::R11fG11fB10f),
"R16f" => Ok(Self::R16f),
"Rgba16" => Ok(Self::Rgba16),
"Rgb10A2" => Ok(Self::Rgb10A2),
"Rg16" => Ok(Self::Rg16),
"Rg8" => Ok(Self::Rg8),
"R16" => Ok(Self::R16),
"R8" => Ok(Self::R8),
"Rgba16Snorm" => Ok(Self::Rgba16Snorm),
"Rg16Snorm" => Ok(Self::Rg16Snorm),
"Rg8Snorm" => Ok(Self::Rg8Snorm),
"R16Snorm" => Ok(Self::R16Snorm),
"R8Snorm" => Ok(Self::R8Snorm),
"Rgba32i" => Ok(Self::Rgba32i),
"Rgba16i" => Ok(Self::Rgba16i),
"Rgba8i" => Ok(Self::Rgba8i),
"R32i" => Ok(Self::R32i),
"Rg32i" => Ok(Self::Rg32i),
"Rg16i" => Ok(Self::Rg16i),
"Rg8i" => Ok(Self::Rg8i),
"R16i" => Ok(Self::R16i),
"R8i" => Ok(Self::R8i),
"Rgba32ui" => Ok(Self::Rgba32ui),
"Rgba16ui" => Ok(Self::Rgba16ui),
"Rgba8ui" => Ok(Self::Rgba8ui),
"R32ui" => Ok(Self::R32ui),
"Rgb10a2ui" => Ok(Self::Rgb10a2ui),
"Rg32ui" => Ok(Self::Rg32ui),
"Rg16ui" => Ok(Self::Rg16ui),
"Rg8ui" => Ok(Self::Rg8ui),
"R16ui" => Ok(Self::R16ui),
"R8ui" => Ok(Self::R8ui),
"R64ui" => Ok(Self::R64ui),
"R64i" => Ok(Self::R64i),
_ => Err(()),
}
}
}
#[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 ImageChannelOrder {
R = 0u32,
A = 1u32,
RG = 2u32,
RA = 3u32,
RGB = 4u32,
RGBA = 5u32,
BGRA = 6u32,
ARGB = 7u32,
Intensity = 8u32,
Luminance = 9u32,
Rx = 10u32,
RGx = 11u32,
RGBx = 12u32,
Depth = 13u32,
DepthStencil = 14u32,
sRGB = 15u32,
sRGBx = 16u32,
sRGBA = 17u32,
sBGRA = 18u32,
ABGR = 19u32,
}
impl ImageChannelOrder {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=19u32 => unsafe { core::mem::transmute::<u32, ImageChannelOrder>(n) },
_ => return None,
})
}
}
#[allow(non_upper_case_globals)]
impl ImageChannelOrder {}
impl core::str::FromStr for ImageChannelOrder {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"R" => Ok(Self::R),
"A" => Ok(Self::A),
"RG" => Ok(Self::RG),
"RA" => Ok(Self::RA),
"RGB" => Ok(Self::RGB),
"RGBA" => Ok(Self::RGBA),
"BGRA" => Ok(Self::BGRA),
"ARGB" => Ok(Self::ARGB),
"Intensity" => Ok(Self::Intensity),
"Luminance" => Ok(Self::Luminance),
"Rx" => Ok(Self::Rx),
"RGx" => Ok(Self::RGx),
"RGBx" => Ok(Self::RGBx),
"Depth" => Ok(Self::Depth),
"DepthStencil" => Ok(Self::DepthStencil),
"sRGB" => Ok(Self::sRGB),
"sRGBx" => Ok(Self::sRGBx),
"sRGBA" => Ok(Self::sRGBA),
"sBGRA" => Ok(Self::sBGRA),
"ABGR" => Ok(Self::ABGR),
_ => Err(()),
}
}
}
#[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 ImageChannelDataType {
SnormInt8 = 0u32,
SnormInt16 = 1u32,
UnormInt8 = 2u32,
UnormInt16 = 3u32,
UnormShort565 = 4u32,
UnormShort555 = 5u32,
UnormInt101010 = 6u32,
SignedInt8 = 7u32,
SignedInt16 = 8u32,
SignedInt32 = 9u32,
UnsignedInt8 = 10u32,
UnsignedInt16 = 11u32,
UnsignedInt32 = 12u32,
HalfFloat = 13u32,
Float = 14u32,
UnormInt24 = 15u32,
UnormInt101010_2 = 16u32,
UnsignedIntRaw10EXT = 19u32,
UnsignedIntRaw12EXT = 20u32,
}
impl ImageChannelDataType {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=16u32 => unsafe { core::mem::transmute::<u32, ImageChannelDataType>(n) },
19u32..=20u32 => unsafe { core::mem::transmute::<u32, ImageChannelDataType>(n) },
_ => return None,
})
}
}
#[allow(non_upper_case_globals)]
impl ImageChannelDataType {}
impl core::str::FromStr for ImageChannelDataType {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"SnormInt8" => Ok(Self::SnormInt8),
"SnormInt16" => Ok(Self::SnormInt16),
"UnormInt8" => Ok(Self::UnormInt8),
"UnormInt16" => Ok(Self::UnormInt16),
"UnormShort565" => Ok(Self::UnormShort565),
"UnormShort555" => Ok(Self::UnormShort555),
"UnormInt101010" => Ok(Self::UnormInt101010),
"SignedInt8" => Ok(Self::SignedInt8),
"SignedInt16" => Ok(Self::SignedInt16),
"SignedInt32" => Ok(Self::SignedInt32),
"UnsignedInt8" => Ok(Self::UnsignedInt8),
"UnsignedInt16" => Ok(Self::UnsignedInt16),
"UnsignedInt32" => Ok(Self::UnsignedInt32),
"HalfFloat" => Ok(Self::HalfFloat),
"Float" => Ok(Self::Float),
"UnormInt24" => Ok(Self::UnormInt24),
"UnormInt101010_2" => Ok(Self::UnormInt101010_2),
"UnsignedIntRaw10EXT" => Ok(Self::UnsignedIntRaw10EXT),
"UnsignedIntRaw12EXT" => Ok(Self::UnsignedIntRaw12EXT),
_ => Err(()),
}
}
}
#[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 FPRoundingMode {
RTE = 0u32,
RTZ = 1u32,
RTP = 2u32,
RTN = 3u32,
}
impl FPRoundingMode {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=3u32 => unsafe { core::mem::transmute::<u32, FPRoundingMode>(n) },
_ => return None,
})
}
}
#[allow(non_upper_case_globals)]
impl FPRoundingMode {}
impl core::str::FromStr for FPRoundingMode {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"RTE" => Ok(Self::RTE),
"RTZ" => Ok(Self::RTZ),
"RTP" => Ok(Self::RTP),
"RTN" => Ok(Self::RTN),
_ => Err(()),
}
}
}
#[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 FPDenormMode {
Preserve = 0u32,
FlushToZero = 1u32,
}
impl FPDenormMode {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=1u32 => unsafe { core::mem::transmute::<u32, FPDenormMode>(n) },
_ => return None,
})
}
}
#[allow(non_upper_case_globals)]
impl FPDenormMode {}
impl core::str::FromStr for FPDenormMode {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"Preserve" => Ok(Self::Preserve),
"FlushToZero" => Ok(Self::FlushToZero),
_ => Err(()),
}
}
}
#[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 QuantizationModes {
TRN = 0u32,
TRN_ZERO = 1u32,
RND = 2u32,
RND_ZERO = 3u32,
RND_INF = 4u32,
RND_MIN_INF = 5u32,
RND_CONV = 6u32,
RND_CONV_ODD = 7u32,
}
impl QuantizationModes {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=7u32 => unsafe { core::mem::transmute::<u32, QuantizationModes>(n) },
_ => return None,
})
}
}
#[allow(non_upper_case_globals)]
impl QuantizationModes {}
impl core::str::FromStr for QuantizationModes {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"TRN" => Ok(Self::TRN),
"TRN_ZERO" => Ok(Self::TRN_ZERO),
"RND" => Ok(Self::RND),
"RND_ZERO" => Ok(Self::RND_ZERO),
"RND_INF" => Ok(Self::RND_INF),
"RND_MIN_INF" => Ok(Self::RND_MIN_INF),
"RND_CONV" => Ok(Self::RND_CONV),
"RND_CONV_ODD" => Ok(Self::RND_CONV_ODD),
_ => Err(()),
}
}
}
#[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 FPOperationMode {
IEEE = 0u32,
ALT = 1u32,
}
impl FPOperationMode {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=1u32 => unsafe { core::mem::transmute::<u32, FPOperationMode>(n) },
_ => return None,
})
}
}
#[allow(non_upper_case_globals)]
impl FPOperationMode {}
impl core::str::FromStr for FPOperationMode {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"IEEE" => Ok(Self::IEEE),
"ALT" => Ok(Self::ALT),
_ => Err(()),
}
}
}
#[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 OverflowModes {
WRAP = 0u32,
SAT = 1u32,
SAT_ZERO = 2u32,
SAT_SYM = 3u32,
}
impl OverflowModes {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=3u32 => unsafe { core::mem::transmute::<u32, OverflowModes>(n) },
_ => return None,
})
}
}
#[allow(non_upper_case_globals)]
impl OverflowModes {}
impl core::str::FromStr for OverflowModes {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"WRAP" => Ok(Self::WRAP),
"SAT" => Ok(Self::SAT),
"SAT_ZERO" => Ok(Self::SAT_ZERO),
"SAT_SYM" => Ok(Self::SAT_SYM),
_ => Err(()),
}
}
}
#[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 LinkageType {
Export = 0u32,
Import = 1u32,
LinkOnceODR = 2u32,
}
impl LinkageType {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=2u32 => unsafe { core::mem::transmute::<u32, LinkageType>(n) },
_ => return None,
})
}
}
#[allow(non_upper_case_globals)]
impl LinkageType {}
impl core::str::FromStr for LinkageType {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"Export" => Ok(Self::Export),
"Import" => Ok(Self::Import),
"LinkOnceODR" => Ok(Self::LinkOnceODR),
_ => Err(()),
}
}
}
#[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 AccessQualifier {
ReadOnly = 0u32,
WriteOnly = 1u32,
ReadWrite = 2u32,
}
impl AccessQualifier {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=2u32 => unsafe { core::mem::transmute::<u32, AccessQualifier>(n) },
_ => return None,
})
}
}
#[allow(non_upper_case_globals)]
impl AccessQualifier {}
impl core::str::FromStr for AccessQualifier {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"ReadOnly" => Ok(Self::ReadOnly),
"WriteOnly" => Ok(Self::WriteOnly),
"ReadWrite" => Ok(Self::ReadWrite),
_ => Err(()),
}
}
}
#[repr(u32)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))]
#[allow(clippy::upper_case_acronyms)]
pub enum HostAccessQualifier {
NoneINTEL = 0u32,
ReadINTEL = 1u32,
WriteINTEL = 2u32,
ReadWriteINTEL = 3u32,
}
impl HostAccessQualifier {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=3u32 => unsafe { core::mem::transmute::<u32, HostAccessQualifier>(n) },
_ => return None,
})
}
}
#[allow(non_upper_case_globals)]
impl HostAccessQualifier {}
impl core::str::FromStr for HostAccessQualifier {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"NoneINTEL" => Ok(Self::NoneINTEL),
"ReadINTEL" => Ok(Self::ReadINTEL),
"WriteINTEL" => Ok(Self::WriteINTEL),
"ReadWriteINTEL" => Ok(Self::ReadWriteINTEL),
_ => Err(()),
}
}
}
#[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 FunctionParameterAttribute {
Zext = 0u32,
Sext = 1u32,
ByVal = 2u32,
Sret = 3u32,
NoAlias = 4u32,
NoCapture = 5u32,
NoWrite = 6u32,
NoReadWrite = 7u32,
RuntimeAlignedINTEL = 5940u32,
}
impl FunctionParameterAttribute {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=7u32 => unsafe { core::mem::transmute::<u32, FunctionParameterAttribute>(n) },
5940u32 => unsafe { core::mem::transmute::<u32, FunctionParameterAttribute>(5940u32) },
_ => return None,
})
}
}
#[allow(non_upper_case_globals)]
impl FunctionParameterAttribute {}
impl core::str::FromStr for FunctionParameterAttribute {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"Zext" => Ok(Self::Zext),
"Sext" => Ok(Self::Sext),
"ByVal" => Ok(Self::ByVal),
"Sret" => Ok(Self::Sret),
"NoAlias" => Ok(Self::NoAlias),
"NoCapture" => Ok(Self::NoCapture),
"NoWrite" => Ok(Self::NoWrite),
"NoReadWrite" => Ok(Self::NoReadWrite),
"RuntimeAlignedINTEL" => Ok(Self::RuntimeAlignedINTEL),
_ => Err(()),
}
}
}
#[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 Decoration {
RelaxedPrecision = 0u32,
SpecId = 1u32,
Block = 2u32,
BufferBlock = 3u32,
RowMajor = 4u32,
ColMajor = 5u32,
ArrayStride = 6u32,
MatrixStride = 7u32,
GLSLShared = 8u32,
GLSLPacked = 9u32,
CPacked = 10u32,
BuiltIn = 11u32,
NoPerspective = 13u32,
Flat = 14u32,
Patch = 15u32,
Centroid = 16u32,
Sample = 17u32,
Invariant = 18u32,
Restrict = 19u32,
Aliased = 20u32,
Volatile = 21u32,
Constant = 22u32,
Coherent = 23u32,
NonWritable = 24u32,
NonReadable = 25u32,
Uniform = 26u32,
UniformId = 27u32,
SaturatedConversion = 28u32,
Stream = 29u32,
Location = 30u32,
Component = 31u32,
Index = 32u32,
Binding = 33u32,
DescriptorSet = 34u32,
Offset = 35u32,
XfbBuffer = 36u32,
XfbStride = 37u32,
FuncParamAttr = 38u32,
FPRoundingMode = 39u32,
FPFastMathMode = 40u32,
LinkageAttributes = 41u32,
NoContraction = 42u32,
InputAttachmentIndex = 43u32,
Alignment = 44u32,
MaxByteOffset = 45u32,
AlignmentId = 46u32,
MaxByteOffsetId = 47u32,
NoSignedWrap = 4469u32,
NoUnsignedWrap = 4470u32,
WeightTextureQCOM = 4487u32,
BlockMatchTextureQCOM = 4488u32,
ExplicitInterpAMD = 4999u32,
NodeSharesPayloadLimitsWithAMDX = 5019u32,
NodeMaxPayloadsAMDX = 5020u32,
TrackFinishWritingAMDX = 5078u32,
PayloadNodeNameAMDX = 5091u32,
OverrideCoverageNV = 5248u32,
PassthroughNV = 5250u32,
ViewportRelativeNV = 5252u32,
SecondaryViewportRelativeNV = 5256u32,
PerPrimitiveNV = 5271u32,
PerViewNV = 5272u32,
PerTaskNV = 5273u32,
PerVertexKHR = 5285u32,
NonUniform = 5300u32,
RestrictPointer = 5355u32,
AliasedPointer = 5356u32,
HitObjectShaderRecordBufferNV = 5386u32,
BindlessSamplerNV = 5398u32,
BindlessImageNV = 5399u32,
BoundSamplerNV = 5400u32,
BoundImageNV = 5401u32,
SIMTCallINTEL = 5599u32,
ReferencedIndirectlyINTEL = 5602u32,
ClobberINTEL = 5607u32,
SideEffectsINTEL = 5608u32,
VectorComputeVariableINTEL = 5624u32,
FuncParamIOKindINTEL = 5625u32,
VectorComputeFunctionINTEL = 5626u32,
StackCallINTEL = 5627u32,
GlobalVariableOffsetINTEL = 5628u32,
CounterBuffer = 5634u32,
UserSemantic = 5635u32,
UserTypeGOOGLE = 5636u32,
FunctionRoundingModeINTEL = 5822u32,
FunctionDenormModeINTEL = 5823u32,
RegisterINTEL = 5825u32,
MemoryINTEL = 5826u32,
NumbanksINTEL = 5827u32,
BankwidthINTEL = 5828u32,
MaxPrivateCopiesINTEL = 5829u32,
SinglepumpINTEL = 5830u32,
DoublepumpINTEL = 5831u32,
MaxReplicatesINTEL = 5832u32,
SimpleDualPortINTEL = 5833u32,
MergeINTEL = 5834u32,
BankBitsINTEL = 5835u32,
ForcePow2DepthINTEL = 5836u32,
BurstCoalesceINTEL = 5899u32,
CacheSizeINTEL = 5900u32,
DontStaticallyCoalesceINTEL = 5901u32,
PrefetchINTEL = 5902u32,
StallEnableINTEL = 5905u32,
FuseLoopsInFunctionINTEL = 5907u32,
MathOpDSPModeINTEL = 5909u32,
AliasScopeINTEL = 5914u32,
NoAliasINTEL = 5915u32,
InitiationIntervalINTEL = 5917u32,
MaxConcurrencyINTEL = 5918u32,
PipelineEnableINTEL = 5919u32,
BufferLocationINTEL = 5921u32,
IOPipeStorageINTEL = 5944u32,
FunctionFloatingPointModeINTEL = 6080u32,
SingleElementVectorINTEL = 6085u32,
VectorComputeCallableFunctionINTEL = 6087u32,
MediaBlockIOINTEL = 6140u32,
InitModeINTEL = 6147u32,
ImplementInRegisterMapINTEL = 6148u32,
HostAccessINTEL = 6168u32,
FPMaxErrorDecorationINTEL = 6170u32,
LatencyControlLabelINTEL = 6172u32,
LatencyControlConstraintINTEL = 6173u32,
ConduitKernelArgumentINTEL = 6175u32,
RegisterMapKernelArgumentINTEL = 6176u32,
MMHostInterfaceAddressWidthINTEL = 6177u32,
MMHostInterfaceDataWidthINTEL = 6178u32,
MMHostInterfaceLatencyINTEL = 6179u32,
MMHostInterfaceReadWriteModeINTEL = 6180u32,
MMHostInterfaceMaxBurstINTEL = 6181u32,
MMHostInterfaceWaitRequestINTEL = 6182u32,
StableKernelArgumentINTEL = 6183u32,
CacheControlLoadINTEL = 6442u32,
CacheControlStoreINTEL = 6443u32,
}
impl Decoration {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=11u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) },
13u32..=47u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) },
4469u32..=4470u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) },
4487u32..=4488u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) },
4999u32 => unsafe { core::mem::transmute::<u32, Decoration>(4999u32) },
5019u32..=5020u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) },
5078u32 => unsafe { core::mem::transmute::<u32, Decoration>(5078u32) },
5091u32 => unsafe { core::mem::transmute::<u32, Decoration>(5091u32) },
5248u32 => unsafe { core::mem::transmute::<u32, Decoration>(5248u32) },
5250u32 => unsafe { core::mem::transmute::<u32, Decoration>(5250u32) },
5252u32 => unsafe { core::mem::transmute::<u32, Decoration>(5252u32) },
5256u32 => unsafe { core::mem::transmute::<u32, Decoration>(5256u32) },
5271u32..=5273u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) },
5285u32 => unsafe { core::mem::transmute::<u32, Decoration>(5285u32) },
5300u32 => unsafe { core::mem::transmute::<u32, Decoration>(5300u32) },
5355u32..=5356u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) },
5386u32 => unsafe { core::mem::transmute::<u32, Decoration>(5386u32) },
5398u32..=5401u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) },
5599u32 => unsafe { core::mem::transmute::<u32, Decoration>(5599u32) },
5602u32 => unsafe { core::mem::transmute::<u32, Decoration>(5602u32) },
5607u32..=5608u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) },
5624u32..=5628u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) },
5634u32..=5636u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) },
5822u32..=5823u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) },
5825u32..=5836u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) },
5899u32..=5902u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) },
5905u32 => unsafe { core::mem::transmute::<u32, Decoration>(5905u32) },
5907u32 => unsafe { core::mem::transmute::<u32, Decoration>(5907u32) },
5909u32 => unsafe { core::mem::transmute::<u32, Decoration>(5909u32) },
5914u32..=5915u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) },
5917u32..=5919u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) },
5921u32 => unsafe { core::mem::transmute::<u32, Decoration>(5921u32) },
5944u32 => unsafe { core::mem::transmute::<u32, Decoration>(5944u32) },
6080u32 => unsafe { core::mem::transmute::<u32, Decoration>(6080u32) },
6085u32 => unsafe { core::mem::transmute::<u32, Decoration>(6085u32) },
6087u32 => unsafe { core::mem::transmute::<u32, Decoration>(6087u32) },
6140u32 => unsafe { core::mem::transmute::<u32, Decoration>(6140u32) },
6147u32..=6148u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) },
6168u32 => unsafe { core::mem::transmute::<u32, Decoration>(6168u32) },
6170u32 => unsafe { core::mem::transmute::<u32, Decoration>(6170u32) },
6172u32..=6173u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) },
6175u32..=6183u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) },
6442u32..=6443u32 => unsafe { core::mem::transmute::<u32, Decoration>(n) },
_ => return None,
})
}
}
#[allow(non_upper_case_globals)]
impl Decoration {
pub const PerPrimitiveEXT: Self = Self::PerPrimitiveNV;
pub const PerVertexNV: Self = Self::PerVertexKHR;
pub const NonUniformEXT: Self = Self::NonUniform;
pub const RestrictPointerEXT: Self = Self::RestrictPointer;
pub const AliasedPointerEXT: Self = Self::AliasedPointer;
pub const HlslCounterBufferGOOGLE: Self = Self::CounterBuffer;
pub const HlslSemanticGOOGLE: Self = Self::UserSemantic;
}
impl core::str::FromStr for Decoration {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"RelaxedPrecision" => Ok(Self::RelaxedPrecision),
"SpecId" => Ok(Self::SpecId),
"Block" => Ok(Self::Block),
"BufferBlock" => Ok(Self::BufferBlock),
"RowMajor" => Ok(Self::RowMajor),
"ColMajor" => Ok(Self::ColMajor),
"ArrayStride" => Ok(Self::ArrayStride),
"MatrixStride" => Ok(Self::MatrixStride),
"GLSLShared" => Ok(Self::GLSLShared),
"GLSLPacked" => Ok(Self::GLSLPacked),
"CPacked" => Ok(Self::CPacked),
"BuiltIn" => Ok(Self::BuiltIn),
"NoPerspective" => Ok(Self::NoPerspective),
"Flat" => Ok(Self::Flat),
"Patch" => Ok(Self::Patch),
"Centroid" => Ok(Self::Centroid),
"Sample" => Ok(Self::Sample),
"Invariant" => Ok(Self::Invariant),
"Restrict" => Ok(Self::Restrict),
"Aliased" => Ok(Self::Aliased),
"Volatile" => Ok(Self::Volatile),
"Constant" => Ok(Self::Constant),
"Coherent" => Ok(Self::Coherent),
"NonWritable" => Ok(Self::NonWritable),
"NonReadable" => Ok(Self::NonReadable),
"Uniform" => Ok(Self::Uniform),
"UniformId" => Ok(Self::UniformId),
"SaturatedConversion" => Ok(Self::SaturatedConversion),
"Stream" => Ok(Self::Stream),
"Location" => Ok(Self::Location),
"Component" => Ok(Self::Component),
"Index" => Ok(Self::Index),
"Binding" => Ok(Self::Binding),
"DescriptorSet" => Ok(Self::DescriptorSet),
"Offset" => Ok(Self::Offset),
"XfbBuffer" => Ok(Self::XfbBuffer),
"XfbStride" => Ok(Self::XfbStride),
"FuncParamAttr" => Ok(Self::FuncParamAttr),
"FPRoundingMode" => Ok(Self::FPRoundingMode),
"FPFastMathMode" => Ok(Self::FPFastMathMode),
"LinkageAttributes" => Ok(Self::LinkageAttributes),
"NoContraction" => Ok(Self::NoContraction),
"InputAttachmentIndex" => Ok(Self::InputAttachmentIndex),
"Alignment" => Ok(Self::Alignment),
"MaxByteOffset" => Ok(Self::MaxByteOffset),
"AlignmentId" => Ok(Self::AlignmentId),
"MaxByteOffsetId" => Ok(Self::MaxByteOffsetId),
"NoSignedWrap" => Ok(Self::NoSignedWrap),
"NoUnsignedWrap" => Ok(Self::NoUnsignedWrap),
"WeightTextureQCOM" => Ok(Self::WeightTextureQCOM),
"BlockMatchTextureQCOM" => Ok(Self::BlockMatchTextureQCOM),
"ExplicitInterpAMD" => Ok(Self::ExplicitInterpAMD),
"NodeSharesPayloadLimitsWithAMDX" => Ok(Self::NodeSharesPayloadLimitsWithAMDX),
"NodeMaxPayloadsAMDX" => Ok(Self::NodeMaxPayloadsAMDX),
"TrackFinishWritingAMDX" => Ok(Self::TrackFinishWritingAMDX),
"PayloadNodeNameAMDX" => Ok(Self::PayloadNodeNameAMDX),
"OverrideCoverageNV" => Ok(Self::OverrideCoverageNV),
"PassthroughNV" => Ok(Self::PassthroughNV),
"ViewportRelativeNV" => Ok(Self::ViewportRelativeNV),
"SecondaryViewportRelativeNV" => Ok(Self::SecondaryViewportRelativeNV),
"PerPrimitiveNV" => Ok(Self::PerPrimitiveNV),
"PerPrimitiveEXT" => Ok(Self::PerPrimitiveNV),
"PerViewNV" => Ok(Self::PerViewNV),
"PerTaskNV" => Ok(Self::PerTaskNV),
"PerVertexKHR" => Ok(Self::PerVertexKHR),
"PerVertexNV" => Ok(Self::PerVertexKHR),
"NonUniform" => Ok(Self::NonUniform),
"NonUniformEXT" => Ok(Self::NonUniform),
"RestrictPointer" => Ok(Self::RestrictPointer),
"RestrictPointerEXT" => Ok(Self::RestrictPointer),
"AliasedPointer" => Ok(Self::AliasedPointer),
"AliasedPointerEXT" => Ok(Self::AliasedPointer),
"HitObjectShaderRecordBufferNV" => Ok(Self::HitObjectShaderRecordBufferNV),
"BindlessSamplerNV" => Ok(Self::BindlessSamplerNV),
"BindlessImageNV" => Ok(Self::BindlessImageNV),
"BoundSamplerNV" => Ok(Self::BoundSamplerNV),
"BoundImageNV" => Ok(Self::BoundImageNV),
"SIMTCallINTEL" => Ok(Self::SIMTCallINTEL),
"ReferencedIndirectlyINTEL" => Ok(Self::ReferencedIndirectlyINTEL),
"ClobberINTEL" => Ok(Self::ClobberINTEL),
"SideEffectsINTEL" => Ok(Self::SideEffectsINTEL),
"VectorComputeVariableINTEL" => Ok(Self::VectorComputeVariableINTEL),
"FuncParamIOKindINTEL" => Ok(Self::FuncParamIOKindINTEL),
"VectorComputeFunctionINTEL" => Ok(Self::VectorComputeFunctionINTEL),
"StackCallINTEL" => Ok(Self::StackCallINTEL),
"GlobalVariableOffsetINTEL" => Ok(Self::GlobalVariableOffsetINTEL),
"CounterBuffer" => Ok(Self::CounterBuffer),
"HlslCounterBufferGOOGLE" => Ok(Self::CounterBuffer),
"UserSemantic" => Ok(Self::UserSemantic),
"HlslSemanticGOOGLE" => Ok(Self::UserSemantic),
"UserTypeGOOGLE" => Ok(Self::UserTypeGOOGLE),
"FunctionRoundingModeINTEL" => Ok(Self::FunctionRoundingModeINTEL),
"FunctionDenormModeINTEL" => Ok(Self::FunctionDenormModeINTEL),
"RegisterINTEL" => Ok(Self::RegisterINTEL),
"MemoryINTEL" => Ok(Self::MemoryINTEL),
"NumbanksINTEL" => Ok(Self::NumbanksINTEL),
"BankwidthINTEL" => Ok(Self::BankwidthINTEL),
"MaxPrivateCopiesINTEL" => Ok(Self::MaxPrivateCopiesINTEL),
"SinglepumpINTEL" => Ok(Self::SinglepumpINTEL),
"DoublepumpINTEL" => Ok(Self::DoublepumpINTEL),
"MaxReplicatesINTEL" => Ok(Self::MaxReplicatesINTEL),
"SimpleDualPortINTEL" => Ok(Self::SimpleDualPortINTEL),
"MergeINTEL" => Ok(Self::MergeINTEL),
"BankBitsINTEL" => Ok(Self::BankBitsINTEL),
"ForcePow2DepthINTEL" => Ok(Self::ForcePow2DepthINTEL),
"BurstCoalesceINTEL" => Ok(Self::BurstCoalesceINTEL),
"CacheSizeINTEL" => Ok(Self::CacheSizeINTEL),
"DontStaticallyCoalesceINTEL" => Ok(Self::DontStaticallyCoalesceINTEL),
"PrefetchINTEL" => Ok(Self::PrefetchINTEL),
"StallEnableINTEL" => Ok(Self::StallEnableINTEL),
"FuseLoopsInFunctionINTEL" => Ok(Self::FuseLoopsInFunctionINTEL),
"MathOpDSPModeINTEL" => Ok(Self::MathOpDSPModeINTEL),
"AliasScopeINTEL" => Ok(Self::AliasScopeINTEL),
"NoAliasINTEL" => Ok(Self::NoAliasINTEL),
"InitiationIntervalINTEL" => Ok(Self::InitiationIntervalINTEL),
"MaxConcurrencyINTEL" => Ok(Self::MaxConcurrencyINTEL),
"PipelineEnableINTEL" => Ok(Self::PipelineEnableINTEL),
"BufferLocationINTEL" => Ok(Self::BufferLocationINTEL),
"IOPipeStorageINTEL" => Ok(Self::IOPipeStorageINTEL),
"FunctionFloatingPointModeINTEL" => Ok(Self::FunctionFloatingPointModeINTEL),
"SingleElementVectorINTEL" => Ok(Self::SingleElementVectorINTEL),
"VectorComputeCallableFunctionINTEL" => Ok(Self::VectorComputeCallableFunctionINTEL),
"MediaBlockIOINTEL" => Ok(Self::MediaBlockIOINTEL),
"InitModeINTEL" => Ok(Self::InitModeINTEL),
"ImplementInRegisterMapINTEL" => Ok(Self::ImplementInRegisterMapINTEL),
"HostAccessINTEL" => Ok(Self::HostAccessINTEL),
"FPMaxErrorDecorationINTEL" => Ok(Self::FPMaxErrorDecorationINTEL),
"LatencyControlLabelINTEL" => Ok(Self::LatencyControlLabelINTEL),
"LatencyControlConstraintINTEL" => Ok(Self::LatencyControlConstraintINTEL),
"ConduitKernelArgumentINTEL" => Ok(Self::ConduitKernelArgumentINTEL),
"RegisterMapKernelArgumentINTEL" => Ok(Self::RegisterMapKernelArgumentINTEL),
"MMHostInterfaceAddressWidthINTEL" => Ok(Self::MMHostInterfaceAddressWidthINTEL),
"MMHostInterfaceDataWidthINTEL" => Ok(Self::MMHostInterfaceDataWidthINTEL),
"MMHostInterfaceLatencyINTEL" => Ok(Self::MMHostInterfaceLatencyINTEL),
"MMHostInterfaceReadWriteModeINTEL" => Ok(Self::MMHostInterfaceReadWriteModeINTEL),
"MMHostInterfaceMaxBurstINTEL" => Ok(Self::MMHostInterfaceMaxBurstINTEL),
"MMHostInterfaceWaitRequestINTEL" => Ok(Self::MMHostInterfaceWaitRequestINTEL),
"StableKernelArgumentINTEL" => Ok(Self::StableKernelArgumentINTEL),
"CacheControlLoadINTEL" => Ok(Self::CacheControlLoadINTEL),
"CacheControlStoreINTEL" => Ok(Self::CacheControlStoreINTEL),
_ => Err(()),
}
}
}
#[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 BuiltIn {
Position = 0u32,
PointSize = 1u32,
ClipDistance = 3u32,
CullDistance = 4u32,
VertexId = 5u32,
InstanceId = 6u32,
PrimitiveId = 7u32,
InvocationId = 8u32,
Layer = 9u32,
ViewportIndex = 10u32,
TessLevelOuter = 11u32,
TessLevelInner = 12u32,
TessCoord = 13u32,
PatchVertices = 14u32,
FragCoord = 15u32,
PointCoord = 16u32,
FrontFacing = 17u32,
SampleId = 18u32,
SamplePosition = 19u32,
SampleMask = 20u32,
FragDepth = 22u32,
HelperInvocation = 23u32,
NumWorkgroups = 24u32,
WorkgroupSize = 25u32,
WorkgroupId = 26u32,
LocalInvocationId = 27u32,
GlobalInvocationId = 28u32,
LocalInvocationIndex = 29u32,
WorkDim = 30u32,
GlobalSize = 31u32,
EnqueuedWorkgroupSize = 32u32,
GlobalOffset = 33u32,
GlobalLinearId = 34u32,
SubgroupSize = 36u32,
SubgroupMaxSize = 37u32,
NumSubgroups = 38u32,
NumEnqueuedSubgroups = 39u32,
SubgroupId = 40u32,
SubgroupLocalInvocationId = 41u32,
VertexIndex = 42u32,
InstanceIndex = 43u32,
CoreIDARM = 4160u32,
CoreCountARM = 4161u32,
CoreMaxIDARM = 4162u32,
WarpIDARM = 4163u32,
WarpMaxIDARM = 4164u32,
SubgroupEqMask = 4416u32,
SubgroupGeMask = 4417u32,
SubgroupGtMask = 4418u32,
SubgroupLeMask = 4419u32,
SubgroupLtMask = 4420u32,
BaseVertex = 4424u32,
BaseInstance = 4425u32,
DrawIndex = 4426u32,
PrimitiveShadingRateKHR = 4432u32,
DeviceIndex = 4438u32,
ViewIndex = 4440u32,
ShadingRateKHR = 4444u32,
BaryCoordNoPerspAMD = 4992u32,
BaryCoordNoPerspCentroidAMD = 4993u32,
BaryCoordNoPerspSampleAMD = 4994u32,
BaryCoordSmoothAMD = 4995u32,
BaryCoordSmoothCentroidAMD = 4996u32,
BaryCoordSmoothSampleAMD = 4997u32,
BaryCoordPullModelAMD = 4998u32,
FragStencilRefEXT = 5014u32,
CoalescedInputCountAMDX = 5021u32,
ShaderIndexAMDX = 5073u32,
ViewportMaskNV = 5253u32,
SecondaryPositionNV = 5257u32,
SecondaryViewportMaskNV = 5258u32,
PositionPerViewNV = 5261u32,
ViewportMaskPerViewNV = 5262u32,
FullyCoveredEXT = 5264u32,
TaskCountNV = 5274u32,
PrimitiveCountNV = 5275u32,
PrimitiveIndicesNV = 5276u32,
ClipDistancePerViewNV = 5277u32,
CullDistancePerViewNV = 5278u32,
LayerPerViewNV = 5279u32,
MeshViewCountNV = 5280u32,
MeshViewIndicesNV = 5281u32,
BaryCoordKHR = 5286u32,
BaryCoordNoPerspKHR = 5287u32,
FragSizeEXT = 5292u32,
FragInvocationCountEXT = 5293u32,
PrimitivePointIndicesEXT = 5294u32,
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,
HitTNV = 5332u32,
HitKindNV = 5333u32,
CurrentRayTimeNV = 5334u32,
HitTriangleVertexPositionsKHR = 5335u32,
HitMicroTriangleVertexPositionsNV = 5337u32,
HitMicroTriangleVertexBarycentricsNV = 5344u32,
IncomingRayFlagsNV = 5351u32,
RayGeometryIndexKHR = 5352u32,
WarpsPerSMNV = 5374u32,
SMCountNV = 5375u32,
WarpIDNV = 5376u32,
SMIDNV = 5377u32,
HitKindFrontFacingMicroTriangleNV = 5405u32,
HitKindBackFacingMicroTriangleNV = 5406u32,
CullMaskKHR = 6021u32,
}
impl BuiltIn {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=1u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(n) },
3u32..=20u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(n) },
22u32..=34u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(n) },
36u32..=43u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(n) },
4160u32..=4164u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(n) },
4416u32..=4420u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(n) },
4424u32..=4426u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(n) },
4432u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(4432u32) },
4438u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(4438u32) },
4440u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(4440u32) },
4444u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(4444u32) },
4992u32..=4998u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(n) },
5014u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(5014u32) },
5021u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(5021u32) },
5073u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(5073u32) },
5253u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(5253u32) },
5257u32..=5258u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(n) },
5261u32..=5262u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(n) },
5264u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(5264u32) },
5274u32..=5281u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(n) },
5286u32..=5287u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(n) },
5292u32..=5296u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(n) },
5299u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(5299u32) },
5319u32..=5327u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(n) },
5330u32..=5335u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(n) },
5337u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(5337u32) },
5344u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(5344u32) },
5351u32..=5352u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(n) },
5374u32..=5377u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(n) },
5405u32..=5406u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(n) },
6021u32 => unsafe { core::mem::transmute::<u32, BuiltIn>(6021u32) },
_ => return None,
})
}
}
#[allow(non_upper_case_globals)]
impl BuiltIn {
pub const SubgroupEqMaskKHR: Self = Self::SubgroupEqMask;
pub const SubgroupGeMaskKHR: Self = Self::SubgroupGeMask;
pub const SubgroupGtMaskKHR: Self = Self::SubgroupGtMask;
pub const SubgroupLeMaskKHR: Self = Self::SubgroupLeMask;
pub const SubgroupLtMaskKHR: Self = Self::SubgroupLtMask;
pub const BaryCoordNV: Self = Self::BaryCoordKHR;
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;
}
impl core::str::FromStr for BuiltIn {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"Position" => Ok(Self::Position),
"PointSize" => Ok(Self::PointSize),
"ClipDistance" => Ok(Self::ClipDistance),
"CullDistance" => Ok(Self::CullDistance),
"VertexId" => Ok(Self::VertexId),
"InstanceId" => Ok(Self::InstanceId),
"PrimitiveId" => Ok(Self::PrimitiveId),
"InvocationId" => Ok(Self::InvocationId),
"Layer" => Ok(Self::Layer),
"ViewportIndex" => Ok(Self::ViewportIndex),
"TessLevelOuter" => Ok(Self::TessLevelOuter),
"TessLevelInner" => Ok(Self::TessLevelInner),
"TessCoord" => Ok(Self::TessCoord),
"PatchVertices" => Ok(Self::PatchVertices),
"FragCoord" => Ok(Self::FragCoord),
"PointCoord" => Ok(Self::PointCoord),
"FrontFacing" => Ok(Self::FrontFacing),
"SampleId" => Ok(Self::SampleId),
"SamplePosition" => Ok(Self::SamplePosition),
"SampleMask" => Ok(Self::SampleMask),
"FragDepth" => Ok(Self::FragDepth),
"HelperInvocation" => Ok(Self::HelperInvocation),
"NumWorkgroups" => Ok(Self::NumWorkgroups),
"WorkgroupSize" => Ok(Self::WorkgroupSize),
"WorkgroupId" => Ok(Self::WorkgroupId),
"LocalInvocationId" => Ok(Self::LocalInvocationId),
"GlobalInvocationId" => Ok(Self::GlobalInvocationId),
"LocalInvocationIndex" => Ok(Self::LocalInvocationIndex),
"WorkDim" => Ok(Self::WorkDim),
"GlobalSize" => Ok(Self::GlobalSize),
"EnqueuedWorkgroupSize" => Ok(Self::EnqueuedWorkgroupSize),
"GlobalOffset" => Ok(Self::GlobalOffset),
"GlobalLinearId" => Ok(Self::GlobalLinearId),
"SubgroupSize" => Ok(Self::SubgroupSize),
"SubgroupMaxSize" => Ok(Self::SubgroupMaxSize),
"NumSubgroups" => Ok(Self::NumSubgroups),
"NumEnqueuedSubgroups" => Ok(Self::NumEnqueuedSubgroups),
"SubgroupId" => Ok(Self::SubgroupId),
"SubgroupLocalInvocationId" => Ok(Self::SubgroupLocalInvocationId),
"VertexIndex" => Ok(Self::VertexIndex),
"InstanceIndex" => Ok(Self::InstanceIndex),
"CoreIDARM" => Ok(Self::CoreIDARM),
"CoreCountARM" => Ok(Self::CoreCountARM),
"CoreMaxIDARM" => Ok(Self::CoreMaxIDARM),
"WarpIDARM" => Ok(Self::WarpIDARM),
"WarpMaxIDARM" => Ok(Self::WarpMaxIDARM),
"SubgroupEqMask" => Ok(Self::SubgroupEqMask),
"SubgroupEqMaskKHR" => Ok(Self::SubgroupEqMask),
"SubgroupGeMask" => Ok(Self::SubgroupGeMask),
"SubgroupGeMaskKHR" => Ok(Self::SubgroupGeMask),
"SubgroupGtMask" => Ok(Self::SubgroupGtMask),
"SubgroupGtMaskKHR" => Ok(Self::SubgroupGtMask),
"SubgroupLeMask" => Ok(Self::SubgroupLeMask),
"SubgroupLeMaskKHR" => Ok(Self::SubgroupLeMask),
"SubgroupLtMask" => Ok(Self::SubgroupLtMask),
"SubgroupLtMaskKHR" => Ok(Self::SubgroupLtMask),
"BaseVertex" => Ok(Self::BaseVertex),
"BaseInstance" => Ok(Self::BaseInstance),
"DrawIndex" => Ok(Self::DrawIndex),
"PrimitiveShadingRateKHR" => Ok(Self::PrimitiveShadingRateKHR),
"DeviceIndex" => Ok(Self::DeviceIndex),
"ViewIndex" => Ok(Self::ViewIndex),
"ShadingRateKHR" => Ok(Self::ShadingRateKHR),
"BaryCoordNoPerspAMD" => Ok(Self::BaryCoordNoPerspAMD),
"BaryCoordNoPerspCentroidAMD" => Ok(Self::BaryCoordNoPerspCentroidAMD),
"BaryCoordNoPerspSampleAMD" => Ok(Self::BaryCoordNoPerspSampleAMD),
"BaryCoordSmoothAMD" => Ok(Self::BaryCoordSmoothAMD),
"BaryCoordSmoothCentroidAMD" => Ok(Self::BaryCoordSmoothCentroidAMD),
"BaryCoordSmoothSampleAMD" => Ok(Self::BaryCoordSmoothSampleAMD),
"BaryCoordPullModelAMD" => Ok(Self::BaryCoordPullModelAMD),
"FragStencilRefEXT" => Ok(Self::FragStencilRefEXT),
"CoalescedInputCountAMDX" => Ok(Self::CoalescedInputCountAMDX),
"ShaderIndexAMDX" => Ok(Self::ShaderIndexAMDX),
"ViewportMaskNV" => Ok(Self::ViewportMaskNV),
"SecondaryPositionNV" => Ok(Self::SecondaryPositionNV),
"SecondaryViewportMaskNV" => Ok(Self::SecondaryViewportMaskNV),
"PositionPerViewNV" => Ok(Self::PositionPerViewNV),
"ViewportMaskPerViewNV" => Ok(Self::ViewportMaskPerViewNV),
"FullyCoveredEXT" => Ok(Self::FullyCoveredEXT),
"TaskCountNV" => Ok(Self::TaskCountNV),
"PrimitiveCountNV" => Ok(Self::PrimitiveCountNV),
"PrimitiveIndicesNV" => Ok(Self::PrimitiveIndicesNV),
"ClipDistancePerViewNV" => Ok(Self::ClipDistancePerViewNV),
"CullDistancePerViewNV" => Ok(Self::CullDistancePerViewNV),
"LayerPerViewNV" => Ok(Self::LayerPerViewNV),
"MeshViewCountNV" => Ok(Self::MeshViewCountNV),
"MeshViewIndicesNV" => Ok(Self::MeshViewIndicesNV),
"BaryCoordKHR" => Ok(Self::BaryCoordKHR),
"BaryCoordNV" => Ok(Self::BaryCoordKHR),
"BaryCoordNoPerspKHR" => Ok(Self::BaryCoordNoPerspKHR),
"BaryCoordNoPerspNV" => Ok(Self::BaryCoordNoPerspKHR),
"FragSizeEXT" => Ok(Self::FragSizeEXT),
"FragmentSizeNV" => Ok(Self::FragSizeEXT),
"FragInvocationCountEXT" => Ok(Self::FragInvocationCountEXT),
"InvocationsPerPixelNV" => Ok(Self::FragInvocationCountEXT),
"PrimitivePointIndicesEXT" => Ok(Self::PrimitivePointIndicesEXT),
"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),
"HitTNV" => Ok(Self::HitTNV),
"HitKindNV" => Ok(Self::HitKindNV),
"HitKindKHR" => Ok(Self::HitKindNV),
"CurrentRayTimeNV" => Ok(Self::CurrentRayTimeNV),
"HitTriangleVertexPositionsKHR" => Ok(Self::HitTriangleVertexPositionsKHR),
"HitMicroTriangleVertexPositionsNV" => Ok(Self::HitMicroTriangleVertexPositionsNV),
"HitMicroTriangleVertexBarycentricsNV" => {
Ok(Self::HitMicroTriangleVertexBarycentricsNV)
}
"IncomingRayFlagsNV" => Ok(Self::IncomingRayFlagsNV),
"IncomingRayFlagsKHR" => Ok(Self::IncomingRayFlagsNV),
"RayGeometryIndexKHR" => Ok(Self::RayGeometryIndexKHR),
"WarpsPerSMNV" => Ok(Self::WarpsPerSMNV),
"SMCountNV" => Ok(Self::SMCountNV),
"WarpIDNV" => Ok(Self::WarpIDNV),
"SMIDNV" => Ok(Self::SMIDNV),
"HitKindFrontFacingMicroTriangleNV" => Ok(Self::HitKindFrontFacingMicroTriangleNV),
"HitKindBackFacingMicroTriangleNV" => Ok(Self::HitKindBackFacingMicroTriangleNV),
"CullMaskKHR" => Ok(Self::CullMaskKHR),
_ => Err(()),
}
}
}
#[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 Scope {
CrossDevice = 0u32,
Device = 1u32,
Workgroup = 2u32,
Subgroup = 3u32,
Invocation = 4u32,
QueueFamily = 5u32,
ShaderCallKHR = 6u32,
}
impl Scope {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=6u32 => unsafe { core::mem::transmute::<u32, Scope>(n) },
_ => return None,
})
}
}
#[allow(non_upper_case_globals)]
impl Scope {
pub const QueueFamilyKHR: Self = Self::QueueFamily;
}
impl core::str::FromStr for Scope {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"CrossDevice" => Ok(Self::CrossDevice),
"Device" => Ok(Self::Device),
"Workgroup" => Ok(Self::Workgroup),
"Subgroup" => Ok(Self::Subgroup),
"Invocation" => Ok(Self::Invocation),
"QueueFamily" => Ok(Self::QueueFamily),
"QueueFamilyKHR" => Ok(Self::QueueFamily),
"ShaderCallKHR" => Ok(Self::ShaderCallKHR),
_ => Err(()),
}
}
}
#[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 GroupOperation {
Reduce = 0u32,
InclusiveScan = 1u32,
ExclusiveScan = 2u32,
ClusteredReduce = 3u32,
PartitionedReduceNV = 6u32,
PartitionedInclusiveScanNV = 7u32,
PartitionedExclusiveScanNV = 8u32,
}
impl GroupOperation {
pub fn from_u32(n: u32) -> Option<Self> {
Some(match n {
0u32..=3u32 => unsafe { core::mem::transmute::<u32, GroupOperation>(n) },
6u32..=8u32 => unsafe { core::mem::transmute::<u32, GroupOperation>(n) },
_ => return None,
})
}
}
#[allow(non_upper_case_globals)]
impl GroupOperation {}
impl core::str::FromStr for GroupOperation {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"Reduce" => Ok(Self::Reduce),
"InclusiveScan" => Ok(Self::InclusiveScan),
"ExclusiveScan" => Ok(Self::ExclusiveScan),
"ClusteredReduce" => Ok(Self::ClusteredReduce),
"PartitionedReduceNV" => Ok(Self::PartitionedReduceNV),
"PartitionedInclusiveScanNV" => Ok(Self::PartitionedInclusiveScanNV),
"PartitionedExclusiveScanNV" => Ok(Self::PartitionedExclusiveScanNV),
_ => Err(()),
}
}
}
#[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 KernelEnqueueFlags {
NoWait = 0u32,
WaitKernel = 1u32,