#![allow(clippy::upper_case_acronyms)]
#![allow(dead_code)]
#![allow(non_upper_case_globals)]
impl super::PixelFormat {
pub const PixelFormatA1BGR5Unorm: Self = Self(41);
pub const PixelFormatA8Unorm: Self = Self(1);
pub const PixelFormatABGR4Unorm: Self = Self(42);
pub const PixelFormatASTC_10x10_HDR: Self = Self(234);
pub const PixelFormatASTC_10x10_LDR: Self = Self(216);
pub const PixelFormatASTC_10x10_sRGB: Self = Self(198);
pub const PixelFormatASTC_10x5_HDR: Self = Self(231);
pub const PixelFormatASTC_10x5_LDR: Self = Self(213);
pub const PixelFormatASTC_10x5_sRGB: Self = Self(195);
pub const PixelFormatASTC_10x6_HDR: Self = Self(232);
pub const PixelFormatASTC_10x6_LDR: Self = Self(214);
pub const PixelFormatASTC_10x6_sRGB: Self = Self(196);
pub const PixelFormatASTC_10x8_HDR: Self = Self(233);
pub const PixelFormatASTC_10x8_LDR: Self = Self(215);
pub const PixelFormatASTC_10x8_sRGB: Self = Self(197);
pub const PixelFormatASTC_12x10_HDR: Self = Self(235);
pub const PixelFormatASTC_12x10_LDR: Self = Self(217);
pub const PixelFormatASTC_12x10_sRGB: Self = Self(199);
pub const PixelFormatASTC_12x12_HDR: Self = Self(236);
pub const PixelFormatASTC_12x12_LDR: Self = Self(218);
pub const PixelFormatASTC_12x12_sRGB: Self = Self(200);
pub const PixelFormatASTC_4x4_HDR: Self = Self(222);
pub const PixelFormatASTC_4x4_LDR: Self = Self(204);
pub const PixelFormatASTC_4x4_sRGB: Self = Self(186);
pub const PixelFormatASTC_5x4_HDR: Self = Self(223);
pub const PixelFormatASTC_5x4_LDR: Self = Self(205);
pub const PixelFormatASTC_5x4_sRGB: Self = Self(187);
pub const PixelFormatASTC_5x5_HDR: Self = Self(224);
pub const PixelFormatASTC_5x5_LDR: Self = Self(206);
pub const PixelFormatASTC_5x5_sRGB: Self = Self(188);
pub const PixelFormatASTC_6x5_HDR: Self = Self(225);
pub const PixelFormatASTC_6x5_LDR: Self = Self(207);
pub const PixelFormatASTC_6x5_sRGB: Self = Self(189);
pub const PixelFormatASTC_6x6_HDR: Self = Self(226);
pub const PixelFormatASTC_6x6_LDR: Self = Self(208);
pub const PixelFormatASTC_6x6_sRGB: Self = Self(190);
pub const PixelFormatASTC_8x5_HDR: Self = Self(228);
pub const PixelFormatASTC_8x5_LDR: Self = Self(210);
pub const PixelFormatASTC_8x5_sRGB: Self = Self(192);
pub const PixelFormatASTC_8x6_HDR: Self = Self(229);
pub const PixelFormatASTC_8x6_LDR: Self = Self(211);
pub const PixelFormatASTC_8x6_sRGB: Self = Self(193);
pub const PixelFormatASTC_8x8_HDR: Self = Self(230);
pub const PixelFormatASTC_8x8_LDR: Self = Self(212);
pub const PixelFormatASTC_8x8_sRGB: Self = Self(194);
pub const PixelFormatB5G6R5Unorm: Self = Self(40);
pub const PixelFormatBC1_RGBA: Self = Self(130);
pub const PixelFormatBC1_RGBA_sRGB: Self = Self(131);
pub const PixelFormatBC2_RGBA: Self = Self(132);
pub const PixelFormatBC2_RGBA_sRGB: Self = Self(133);
pub const PixelFormatBC3_RGBA: Self = Self(134);
pub const PixelFormatBC3_RGBA_sRGB: Self = Self(135);
pub const PixelFormatBC4_RSnorm: Self = Self(141);
pub const PixelFormatBC4_RUnorm: Self = Self(140);
pub const PixelFormatBC5_RGSnorm: Self = Self(143);
pub const PixelFormatBC5_RGUnorm: Self = Self(142);
pub const PixelFormatBC6H_RGBFloat: Self = Self(150);
pub const PixelFormatBC6H_RGBUfloat: Self = Self(151);
pub const PixelFormatBC7_RGBAUnorm: Self = Self(152);
pub const PixelFormatBC7_RGBAUnorm_sRGB: Self = Self(153);
pub const PixelFormatBGR10A2Unorm: Self = Self(94);
pub const PixelFormatBGR10_XR: Self = Self(554);
pub const PixelFormatBGR10_XR_sRGB: Self = Self(555);
pub const PixelFormatBGR5A1Unorm: Self = Self(43);
pub const PixelFormatBGRA10_XR: Self = Self(552);
pub const PixelFormatBGRA10_XR_sRGB: Self = Self(553);
pub const PixelFormatBGRA8Unorm: Self = Self(80);
pub const PixelFormatBGRA8Unorm_sRGB: Self = Self(81);
pub const PixelFormatBGRG422: Self = Self(241);
pub const PixelFormatDepth16Unorm: Self = Self(250);
pub const PixelFormatDepth24Unorm_Stencil8: Self = Self(255);
pub const PixelFormatDepth32Float: Self = Self(252);
pub const PixelFormatDepth32Float_Stencil8: Self = Self(260);
pub const PixelFormatEAC_R11Snorm: Self = Self(172);
pub const PixelFormatEAC_R11Unorm: Self = Self(170);
pub const PixelFormatEAC_RG11Snorm: Self = Self(176);
pub const PixelFormatEAC_RG11Unorm: Self = Self(174);
pub const PixelFormatEAC_RGBA8: Self = Self(178);
pub const PixelFormatEAC_RGBA8_sRGB: Self = Self(179);
pub const PixelFormatETC2_RGB8: Self = Self(180);
pub const PixelFormatETC2_RGB8A1: Self = Self(182);
pub const PixelFormatETC2_RGB8A1_sRGB: Self = Self(183);
pub const PixelFormatETC2_RGB8_sRGB: Self = Self(181);
pub const PixelFormatGBGR422: Self = Self(240);
pub const PixelFormatInvalid: Self = Self(0);
pub const PixelFormatPVRTC_RGBA_2BPP: Self = Self(164);
pub const PixelFormatPVRTC_RGBA_2BPP_sRGB: Self = Self(165);
pub const PixelFormatPVRTC_RGBA_4BPP: Self = Self(166);
pub const PixelFormatPVRTC_RGBA_4BPP_sRGB: Self = Self(167);
pub const PixelFormatPVRTC_RGB_2BPP: Self = Self(160);
pub const PixelFormatPVRTC_RGB_2BPP_sRGB: Self = Self(161);
pub const PixelFormatPVRTC_RGB_4BPP: Self = Self(162);
pub const PixelFormatPVRTC_RGB_4BPP_sRGB: Self = Self(163);
pub const PixelFormatR16Float: Self = Self(25);
pub const PixelFormatR16Sint: Self = Self(24);
pub const PixelFormatR16Snorm: Self = Self(22);
pub const PixelFormatR16Uint: Self = Self(23);
pub const PixelFormatR16Unorm: Self = Self(20);
pub const PixelFormatR32Float: Self = Self(55);
pub const PixelFormatR32Sint: Self = Self(54);
pub const PixelFormatR32Uint: Self = Self(53);
pub const PixelFormatR8Sint: Self = Self(14);
pub const PixelFormatR8Snorm: Self = Self(12);
pub const PixelFormatR8Uint: Self = Self(13);
pub const PixelFormatR8Unorm: Self = Self(10);
pub const PixelFormatR8Unorm_sRGB: Self = Self(11);
pub const PixelFormatRG11B10Float: Self = Self(92);
pub const PixelFormatRG16Float: Self = Self(65);
pub const PixelFormatRG16Sint: Self = Self(64);
pub const PixelFormatRG16Snorm: Self = Self(62);
pub const PixelFormatRG16Uint: Self = Self(63);
pub const PixelFormatRG16Unorm: Self = Self(60);
pub const PixelFormatRG32Float: Self = Self(105);
pub const PixelFormatRG32Sint: Self = Self(104);
pub const PixelFormatRG32Uint: Self = Self(103);
pub const PixelFormatRG8Sint: Self = Self(34);
pub const PixelFormatRG8Snorm: Self = Self(32);
pub const PixelFormatRG8Uint: Self = Self(33);
pub const PixelFormatRG8Unorm: Self = Self(30);
pub const PixelFormatRG8Unorm_sRGB: Self = Self(31);
pub const PixelFormatRGB10A2Uint: Self = Self(91);
pub const PixelFormatRGB10A2Unorm: Self = Self(90);
pub const PixelFormatRGB9E5Float: Self = Self(93);
pub const PixelFormatRGBA16Float: Self = Self(115);
pub const PixelFormatRGBA16Sint: Self = Self(114);
pub const PixelFormatRGBA16Snorm: Self = Self(112);
pub const PixelFormatRGBA16Uint: Self = Self(113);
pub const PixelFormatRGBA16Unorm: Self = Self(110);
pub const PixelFormatRGBA32Float: Self = Self(125);
pub const PixelFormatRGBA32Sint: Self = Self(124);
pub const PixelFormatRGBA32Uint: Self = Self(123);
pub const PixelFormatRGBA8Sint: Self = Self(74);
pub const PixelFormatRGBA8Snorm: Self = Self(72);
pub const PixelFormatRGBA8Uint: Self = Self(73);
pub const PixelFormatRGBA8Unorm: Self = Self(70);
pub const PixelFormatRGBA8Unorm_sRGB: Self = Self(71);
pub const PixelFormatStencil8: Self = Self(253);
pub const PixelFormatUnspecialized: Self = Self(263);
pub const PixelFormatX24_Stencil8: Self = Self(262);
pub const PixelFormatX32_Stencil8: Self = Self(261);
}
impl super::ResourceOptions {
pub const ResourceCPUCacheModeDefaultCache: Self = Self(0);
pub const ResourceCPUCacheModeWriteCombined: Self = Self(1);
pub const ResourceHazardTrackingModeDefault: Self = Self(0);
pub const ResourceHazardTrackingModeTracked: Self = Self(512);
pub const ResourceHazardTrackingModeUntracked: Self = Self(256);
pub const ResourceStorageModeManaged: Self = Self(16);
pub const ResourceStorageModeMemoryless: Self = Self(48);
pub const ResourceStorageModePrivate: Self = Self(32);
pub const ResourceStorageModeShared: Self = Self(0);
}
impl super::TextureUsage {
pub const TextureUsagePixelFormatView: Self = Self(16);
pub const TextureUsageRenderTarget: Self = Self(4);
pub const TextureUsageShaderAtomic: Self = Self(32);
pub const TextureUsageShaderRead: Self = Self(1);
pub const TextureUsageShaderWrite: Self = Self(2);
pub const TextureUsageUnknown: Self = Self(0);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct AlphaToCoverageState(isize);
impl AlphaToCoverageState {
pub const AlphaToCoverageStateDisabled: Self = Self(0);
pub const AlphaToCoverageStateEnabled: Self = Self(1);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<isize> for AlphaToCoverageState {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct AlphaToOneState(isize);
impl AlphaToOneState {
pub const AlphaToOneStateDisabled: Self = Self(0);
pub const AlphaToOneStateEnabled: Self = Self(1);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<isize> for AlphaToOneState {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct BinaryFunctionOptions(usize);
impl BinaryFunctionOptions {
pub const BinaryFunctionOptionNone: Self = Self(0);
pub const BinaryFunctionOptionPipelineIndependent: Self = Self(2);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
const VALID_BITS: usize = 2;
self.0 & !VALID_BITS == 0
}
#[must_use]
pub const fn from_bits(value: usize) -> Option<Self> {
let value = Self(value);
if value.is_valid() { Some(value) } else { None }
}
}
impl std::ops::BitOr for BinaryFunctionOptions {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl std::ops::BitAnd for BinaryFunctionOptions {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct BlendState(isize);
impl BlendState {
pub const BlendStateDisabled: Self = Self(0);
pub const BlendStateEnabled: Self = Self(1);
pub const BlendStateUnspecialized: Self = Self(2);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=2)
}
}
impl std::convert::TryFrom<isize> for BlendState {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct CommandQueueError(isize);
impl CommandQueueError {
pub const CommandQueueErrorAccessRevoked: Self = Self(5);
pub const CommandQueueErrorDeviceRemoved: Self = Self(4);
pub const CommandQueueErrorInternal: Self = Self(6);
pub const CommandQueueErrorNone: Self = Self(0);
pub const CommandQueueErrorNotPermitted: Self = Self(2);
pub const CommandQueueErrorOutOfMemory: Self = Self(3);
pub const CommandQueueErrorTimeout: Self = Self(1);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=6)
}
}
impl std::convert::TryFrom<isize> for CommandQueueError {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct CompilerTaskStatus(isize);
impl CompilerTaskStatus {
pub const CompilerTaskStatusCompiling: Self = Self(2);
pub const CompilerTaskStatusFinished: Self = Self(3);
pub const CompilerTaskStatusNone: Self = Self(0);
pub const CompilerTaskStatusScheduled: Self = Self(1);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=3)
}
}
impl std::convert::TryFrom<isize> for CompilerTaskStatus {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct CounterHeapType(isize);
impl CounterHeapType {
pub const CounterHeapTypeInvalid: Self = Self(0);
pub const CounterHeapTypeTimestamp: Self = Self(1);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<isize> for CounterHeapType {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct IndirectCommandBufferSupportState(isize);
impl IndirectCommandBufferSupportState {
pub const IndirectCommandBufferSupportStateDisabled: Self = Self(0);
pub const IndirectCommandBufferSupportStateEnabled: Self = Self(1);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<isize> for IndirectCommandBufferSupportState {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct LogicalToPhysicalColorAttachmentMappingState(isize);
impl LogicalToPhysicalColorAttachmentMappingState {
pub const LogicalToPhysicalColorAttachmentMappingStateIdentity: Self = Self(0);
pub const LogicalToPhysicalColorAttachmentMappingStateInherited: Self = Self(1);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<isize> for LogicalToPhysicalColorAttachmentMappingState {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct PipelineDataSetSerializerConfiguration(usize);
impl PipelineDataSetSerializerConfiguration {
pub const PipelineDataSetSerializerConfigurationCaptureBinaries: Self = Self(2);
pub const PipelineDataSetSerializerConfigurationCaptureDescriptors: Self = Self(1);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
const VALID_BITS: usize = 3;
self.0 & !VALID_BITS == 0
}
#[must_use]
pub const fn from_bits(value: usize) -> Option<Self> {
let value = Self(value);
if value.is_valid() { Some(value) } else { None }
}
}
impl std::ops::BitOr for PipelineDataSetSerializerConfiguration {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl std::ops::BitAnd for PipelineDataSetSerializerConfiguration {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct RenderEncoderOptions(usize);
impl RenderEncoderOptions {
pub const RenderEncoderOptionNone: Self = Self(0);
pub const RenderEncoderOptionResuming: Self = Self(2);
pub const RenderEncoderOptionSuspending: Self = Self(1);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
const VALID_BITS: usize = 3;
self.0 & !VALID_BITS == 0
}
#[must_use]
pub const fn from_bits(value: usize) -> Option<Self> {
let value = Self(value);
if value.is_valid() { Some(value) } else { None }
}
}
impl std::ops::BitOr for RenderEncoderOptions {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl std::ops::BitAnd for RenderEncoderOptions {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct ShaderReflection(usize);
impl ShaderReflection {
pub const ShaderReflectionBindingInfo: Self = Self(1);
pub const ShaderReflectionBufferTypeInfo: Self = Self(2);
pub const ShaderReflectionNone: Self = Self(0);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
const VALID_BITS: usize = 3;
self.0 & !VALID_BITS == 0
}
#[must_use]
pub const fn from_bits(value: usize) -> Option<Self> {
let value = Self(value);
if value.is_valid() { Some(value) } else { None }
}
}
impl std::ops::BitOr for ShaderReflection {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl std::ops::BitAnd for ShaderReflection {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct TimestampGranularity(isize);
impl TimestampGranularity {
pub const TimestampGranularityPrecise: Self = Self(1);
pub const TimestampGranularityRelaxed: Self = Self(0);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<isize> for TimestampGranularity {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct VisibilityOptions(usize);
impl VisibilityOptions {
pub const VisibilityOptionDevice: Self = Self(1);
pub const VisibilityOptionNone: Self = Self(0);
pub const VisibilityOptionResourceAlias: Self = Self(2);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
const VALID_BITS: usize = 3;
self.0 & !VALID_BITS == 0
}
#[must_use]
pub const fn from_bits(value: usize) -> Option<Self> {
let value = Self(value);
if value.is_valid() { Some(value) } else { None }
}
}
impl std::ops::BitOr for VisibilityOptions {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl std::ops::BitAnd for VisibilityOptions {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct AccelerationStructureInstanceDescriptorType(usize);
impl AccelerationStructureInstanceDescriptorType {
pub const AccelerationStructureInstanceDescriptorTypeDefault: Self = Self(0);
pub const AccelerationStructureInstanceDescriptorTypeIndirect: Self = Self(3);
pub const AccelerationStructureInstanceDescriptorTypeIndirectMotion: Self = Self(4);
pub const AccelerationStructureInstanceDescriptorTypeMotion: Self = Self(2);
pub const AccelerationStructureInstanceDescriptorTypeUserID: Self = Self(1);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=4)
}
}
impl std::convert::TryFrom<usize> for AccelerationStructureInstanceDescriptorType {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct AccelerationStructureInstanceOptions(u32);
impl AccelerationStructureInstanceOptions {
pub const AccelerationStructureInstanceOptionDisableTriangleCulling: Self = Self(1);
pub const AccelerationStructureInstanceOptionNonOpaque: Self = Self(8);
pub const AccelerationStructureInstanceOptionNone: Self = Self(0);
pub const AccelerationStructureInstanceOptionOpaque: Self = Self(4);
pub const AccelerationStructureInstanceOptionTriangleFrontFacingWindingCounterClockwise: Self =
Self(2);
pub(crate) const fn from_system_raw(value: u32) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> u32 {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
const VALID_BITS: u32 = 15;
self.0 & !VALID_BITS == 0
}
#[must_use]
pub const fn from_bits(value: u32) -> Option<Self> {
let value = Self(value);
if value.is_valid() { Some(value) } else { None }
}
}
impl std::ops::BitOr for AccelerationStructureInstanceOptions {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl std::ops::BitAnd for AccelerationStructureInstanceOptions {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct AccelerationStructureRefitOptions(usize);
impl AccelerationStructureRefitOptions {
pub const AccelerationStructureRefitOptionPerPrimitiveData: Self = Self(2);
pub const AccelerationStructureRefitOptionVertexData: Self = Self(1);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
const VALID_BITS: usize = 3;
self.0 & !VALID_BITS == 0
}
#[must_use]
pub const fn from_bits(value: usize) -> Option<Self> {
let value = Self(value);
if value.is_valid() { Some(value) } else { None }
}
}
impl std::ops::BitOr for AccelerationStructureRefitOptions {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl std::ops::BitAnd for AccelerationStructureRefitOptions {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct AccelerationStructureUsage(usize);
impl AccelerationStructureUsage {
pub const AccelerationStructureUsageExtendedLimits: Self = Self(4);
pub const AccelerationStructureUsageMinimizeMemory: Self = Self(32);
pub const AccelerationStructureUsageNone: Self = Self(0);
pub const AccelerationStructureUsagePreferFastBuild: Self = Self(2);
pub const AccelerationStructureUsagePreferFastIntersection: Self = Self(16);
pub const AccelerationStructureUsageRefit: Self = Self(1);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
const VALID_BITS: usize = 55;
self.0 & !VALID_BITS == 0
}
#[must_use]
pub const fn from_bits(value: usize) -> Option<Self> {
let value = Self(value);
if value.is_valid() { Some(value) } else { None }
}
}
impl std::ops::BitOr for AccelerationStructureUsage {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl std::ops::BitAnd for AccelerationStructureUsage {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct ArgumentBuffersTier(usize);
impl ArgumentBuffersTier {
pub const ArgumentBuffersTier1: Self = Self(0);
pub const ArgumentBuffersTier2: Self = Self(1);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<usize> for ArgumentBuffersTier {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct ArgumentType(usize);
impl ArgumentType {
pub const ArgumentTypeBuffer: Self = Self(0);
pub const ArgumentTypeImageblock: Self = Self(17);
pub const ArgumentTypeImageblockData: Self = Self(16);
pub const ArgumentTypeInstanceAccelerationStructure: Self = Self(26);
pub const ArgumentTypeIntersectionFunctionTable: Self = Self(27);
pub const ArgumentTypePrimitiveAccelerationStructure: Self = Self(25);
pub const ArgumentTypeSampler: Self = Self(3);
pub const ArgumentTypeTexture: Self = Self(2);
pub const ArgumentTypeThreadgroupMemory: Self = Self(1);
pub const ArgumentTypeVisibleFunctionTable: Self = Self(24);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=3 | 16 | 17 | 24..=27)
}
}
impl std::convert::TryFrom<usize> for ArgumentType {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct AttributeFormat(usize);
impl AttributeFormat {
pub const AttributeFormatChar: Self = Self(46);
pub const AttributeFormatChar2: Self = Self(4);
pub const AttributeFormatChar2Normalized: Self = Self(10);
pub const AttributeFormatChar3: Self = Self(5);
pub const AttributeFormatChar3Normalized: Self = Self(11);
pub const AttributeFormatChar4: Self = Self(6);
pub const AttributeFormatChar4Normalized: Self = Self(12);
pub const AttributeFormatCharNormalized: Self = Self(48);
pub const AttributeFormatFloat: Self = Self(28);
pub const AttributeFormatFloat2: Self = Self(29);
pub const AttributeFormatFloat3: Self = Self(30);
pub const AttributeFormatFloat4: Self = Self(31);
pub const AttributeFormatFloatRG11B10: Self = Self(54);
pub const AttributeFormatFloatRGB9E5: Self = Self(55);
pub const AttributeFormatHalf: Self = Self(53);
pub const AttributeFormatHalf2: Self = Self(25);
pub const AttributeFormatHalf3: Self = Self(26);
pub const AttributeFormatHalf4: Self = Self(27);
pub const AttributeFormatInt: Self = Self(32);
pub const AttributeFormatInt1010102Normalized: Self = Self(40);
pub const AttributeFormatInt2: Self = Self(33);
pub const AttributeFormatInt3: Self = Self(34);
pub const AttributeFormatInt4: Self = Self(35);
pub const AttributeFormatInvalid: Self = Self(0);
pub const AttributeFormatShort: Self = Self(50);
pub const AttributeFormatShort2: Self = Self(16);
pub const AttributeFormatShort2Normalized: Self = Self(22);
pub const AttributeFormatShort3: Self = Self(17);
pub const AttributeFormatShort3Normalized: Self = Self(23);
pub const AttributeFormatShort4: Self = Self(18);
pub const AttributeFormatShort4Normalized: Self = Self(24);
pub const AttributeFormatShortNormalized: Self = Self(52);
pub const AttributeFormatUChar: Self = Self(45);
pub const AttributeFormatUChar2: Self = Self(1);
pub const AttributeFormatUChar2Normalized: Self = Self(7);
pub const AttributeFormatUChar3: Self = Self(2);
pub const AttributeFormatUChar3Normalized: Self = Self(8);
pub const AttributeFormatUChar4: Self = Self(3);
pub const AttributeFormatUChar4Normalized: Self = Self(9);
pub const AttributeFormatUChar4Normalized_BGRA: Self = Self(42);
pub const AttributeFormatUCharNormalized: Self = Self(47);
pub const AttributeFormatUInt: Self = Self(36);
pub const AttributeFormatUInt1010102Normalized: Self = Self(41);
pub const AttributeFormatUInt2: Self = Self(37);
pub const AttributeFormatUInt3: Self = Self(38);
pub const AttributeFormatUInt4: Self = Self(39);
pub const AttributeFormatUShort: Self = Self(49);
pub const AttributeFormatUShort2: Self = Self(13);
pub const AttributeFormatUShort2Normalized: Self = Self(19);
pub const AttributeFormatUShort3: Self = Self(14);
pub const AttributeFormatUShort3Normalized: Self = Self(20);
pub const AttributeFormatUShort4: Self = Self(15);
pub const AttributeFormatUShort4Normalized: Self = Self(21);
pub const AttributeFormatUShortNormalized: Self = Self(51);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=42 | 45..=55)
}
}
impl std::convert::TryFrom<usize> for AttributeFormat {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct BarrierScope(usize);
impl BarrierScope {
pub const BarrierScopeBuffers: Self = Self(1);
pub const BarrierScopeRenderTargets: Self = Self(4);
pub const BarrierScopeTextures: Self = Self(2);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
const VALID_BITS: usize = 7;
self.0 & !VALID_BITS == 0
}
#[must_use]
pub const fn from_bits(value: usize) -> Option<Self> {
let value = Self(value);
if value.is_valid() { Some(value) } else { None }
}
}
impl std::ops::BitOr for BarrierScope {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl std::ops::BitAnd for BarrierScope {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct BinaryArchiveError(usize);
impl BinaryArchiveError {
pub const BinaryArchiveErrorCompilationFailure: Self = Self(3);
pub const BinaryArchiveErrorInternalError: Self = Self(4);
pub const BinaryArchiveErrorInvalidFile: Self = Self(1);
pub const BinaryArchiveErrorNone: Self = Self(0);
pub const BinaryArchiveErrorUnexpectedElement: Self = Self(2);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=4)
}
}
impl std::convert::TryFrom<usize> for BinaryArchiveError {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct BindingAccess(usize);
impl BindingAccess {
pub const ArgumentAccessReadOnly: Self = Self(0);
pub const ArgumentAccessReadWrite: Self = Self(1);
pub const ArgumentAccessWriteOnly: Self = Self(2);
pub const BindingAccessReadOnly: Self = Self(0);
pub const BindingAccessReadWrite: Self = Self(1);
pub const BindingAccessWriteOnly: Self = Self(2);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=2)
}
}
impl std::convert::TryFrom<usize> for BindingAccess {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct BindingType(isize);
impl BindingType {
pub const BindingTypeBuffer: Self = Self(0);
pub const BindingTypeImageblock: Self = Self(17);
pub const BindingTypeImageblockData: Self = Self(16);
pub const BindingTypeInstanceAccelerationStructure: Self = Self(26);
pub const BindingTypeIntersectionFunctionTable: Self = Self(27);
pub const BindingTypeObjectPayload: Self = Self(34);
pub const BindingTypePrimitiveAccelerationStructure: Self = Self(25);
pub const BindingTypeSampler: Self = Self(3);
pub const BindingTypeTensor: Self = Self(37);
pub const BindingTypeTexture: Self = Self(2);
pub const BindingTypeThreadgroupMemory: Self = Self(1);
pub const BindingTypeVisibleFunctionTable: Self = Self(24);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=3 | 16 | 17 | 24..=27 | 34 | 37)
}
}
impl std::convert::TryFrom<isize> for BindingType {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct BlendFactor(usize);
impl BlendFactor {
pub const BlendFactorBlendAlpha: Self = Self(13);
pub const BlendFactorBlendColor: Self = Self(11);
pub const BlendFactorDestinationAlpha: Self = Self(8);
pub const BlendFactorDestinationColor: Self = Self(6);
pub const BlendFactorOne: Self = Self(1);
pub const BlendFactorOneMinusBlendAlpha: Self = Self(14);
pub const BlendFactorOneMinusBlendColor: Self = Self(12);
pub const BlendFactorOneMinusDestinationAlpha: Self = Self(9);
pub const BlendFactorOneMinusDestinationColor: Self = Self(7);
pub const BlendFactorOneMinusSource1Alpha: Self = Self(18);
pub const BlendFactorOneMinusSource1Color: Self = Self(16);
pub const BlendFactorOneMinusSourceAlpha: Self = Self(5);
pub const BlendFactorOneMinusSourceColor: Self = Self(3);
pub const BlendFactorSource1Alpha: Self = Self(17);
pub const BlendFactorSource1Color: Self = Self(15);
pub const BlendFactorSourceAlpha: Self = Self(4);
pub const BlendFactorSourceAlphaSaturated: Self = Self(10);
pub const BlendFactorSourceColor: Self = Self(2);
pub const BlendFactorUnspecialized: Self = Self(19);
pub const BlendFactorZero: Self = Self(0);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=19)
}
}
impl std::convert::TryFrom<usize> for BlendFactor {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct BlendOperation(usize);
impl BlendOperation {
pub const BlendOperationAdd: Self = Self(0);
pub const BlendOperationMax: Self = Self(4);
pub const BlendOperationMin: Self = Self(3);
pub const BlendOperationReverseSubtract: Self = Self(2);
pub const BlendOperationSubtract: Self = Self(1);
pub const BlendOperationUnspecialized: Self = Self(5);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=5)
}
}
impl std::convert::TryFrom<usize> for BlendOperation {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct BlitOption(usize);
impl BlitOption {
pub const BlitOptionDepthFromDepthStencil: Self = Self(1);
pub const BlitOptionNone: Self = Self(0);
pub const BlitOptionRowLinearPVRTC: Self = Self(4);
pub const BlitOptionStencilFromDepthStencil: Self = Self(2);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
const VALID_BITS: usize = 7;
self.0 & !VALID_BITS == 0
}
#[must_use]
pub const fn from_bits(value: usize) -> Option<Self> {
let value = Self(value);
if value.is_valid() { Some(value) } else { None }
}
}
impl std::ops::BitOr for BlitOption {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl std::ops::BitAnd for BlitOption {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct BufferSparseTier(isize);
impl BufferSparseTier {
pub const BufferSparseTier1: Self = Self(1);
pub const BufferSparseTierNone: Self = Self(0);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<isize> for BufferSparseTier {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct CPUCacheMode(usize);
impl CPUCacheMode {
pub const CPUCacheModeDefaultCache: Self = Self(0);
pub const CPUCacheModeWriteCombined: Self = Self(1);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<usize> for CPUCacheMode {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct CaptureDestination(isize);
impl CaptureDestination {
pub const CaptureDestinationDeveloperTools: Self = Self(1);
pub const CaptureDestinationGPUTraceDocument: Self = Self(2);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 1 | 2)
}
}
impl std::convert::TryFrom<isize> for CaptureDestination {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct CaptureError(isize);
impl CaptureError {
pub const CaptureErrorAlreadyCapturing: Self = Self(2);
pub const CaptureErrorInvalidDescriptor: Self = Self(3);
pub const CaptureErrorNotSupported: Self = Self(1);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 1..=3)
}
}
impl std::convert::TryFrom<isize> for CaptureError {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct ColorWriteMask(usize);
impl ColorWriteMask {
pub const ColorWriteMaskAll: Self = Self(15);
pub const ColorWriteMaskAlpha: Self = Self(1);
pub const ColorWriteMaskBlue: Self = Self(2);
pub const ColorWriteMaskGreen: Self = Self(4);
pub const ColorWriteMaskNone: Self = Self(0);
pub const ColorWriteMaskRed: Self = Self(8);
pub const ColorWriteMaskUnspecialized: Self = Self(16);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
const VALID_BITS: usize = 31;
self.0 & !VALID_BITS == 0
}
#[must_use]
pub const fn from_bits(value: usize) -> Option<Self> {
let value = Self(value);
if value.is_valid() { Some(value) } else { None }
}
}
impl std::ops::BitOr for ColorWriteMask {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl std::ops::BitAnd for ColorWriteMask {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct CommandBufferError(usize);
impl CommandBufferError {
pub const CommandBufferErrorAccessRevoked: Self = Self(4);
pub const CommandBufferErrorBlacklisted: Self = Self(4);
pub const CommandBufferErrorDeviceRemoved: Self = Self(11);
pub const CommandBufferErrorInternal: Self = Self(1);
pub const CommandBufferErrorInvalidResource: Self = Self(9);
pub const CommandBufferErrorMemoryless: Self = Self(10);
pub const CommandBufferErrorNone: Self = Self(0);
pub const CommandBufferErrorNotPermitted: Self = Self(7);
pub const CommandBufferErrorOutOfMemory: Self = Self(8);
pub const CommandBufferErrorPageFault: Self = Self(3);
pub const CommandBufferErrorStackOverflow: Self = Self(12);
pub const CommandBufferErrorTimeout: Self = Self(2);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=4 | 7..=12)
}
}
impl std::convert::TryFrom<usize> for CommandBufferError {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct CommandBufferErrorOption(usize);
impl CommandBufferErrorOption {
pub const CommandBufferErrorOptionEncoderExecutionStatus: Self = Self(1);
pub const CommandBufferErrorOptionNone: Self = Self(0);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
const VALID_BITS: usize = 1;
self.0 & !VALID_BITS == 0
}
#[must_use]
pub const fn from_bits(value: usize) -> Option<Self> {
let value = Self(value);
if value.is_valid() { Some(value) } else { None }
}
}
impl std::ops::BitOr for CommandBufferErrorOption {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl std::ops::BitAnd for CommandBufferErrorOption {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct CommandEncoderErrorState(isize);
impl CommandEncoderErrorState {
pub const CommandEncoderErrorStateAffected: Self = Self(2);
pub const CommandEncoderErrorStateCompleted: Self = Self(1);
pub const CommandEncoderErrorStateFaulted: Self = Self(4);
pub const CommandEncoderErrorStatePending: Self = Self(3);
pub const CommandEncoderErrorStateUnknown: Self = Self(0);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=4)
}
}
impl std::convert::TryFrom<isize> for CommandEncoderErrorState {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct CompareFunction(usize);
impl CompareFunction {
pub const CompareFunctionAlways: Self = Self(7);
pub const CompareFunctionEqual: Self = Self(2);
pub const CompareFunctionGreater: Self = Self(4);
pub const CompareFunctionGreaterEqual: Self = Self(6);
pub const CompareFunctionLess: Self = Self(1);
pub const CompareFunctionLessEqual: Self = Self(3);
pub const CompareFunctionNever: Self = Self(0);
pub const CompareFunctionNotEqual: Self = Self(5);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=7)
}
}
impl std::convert::TryFrom<usize> for CompareFunction {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct CompileSymbolVisibility(isize);
impl CompileSymbolVisibility {
pub const CompileSymbolVisibilityDefault: Self = Self(0);
pub const CompileSymbolVisibilityHidden: Self = Self(1);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<isize> for CompileSymbolVisibility {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct CounterSampleBufferError(isize);
impl CounterSampleBufferError {
pub const CounterSampleBufferErrorInternal: Self = Self(2);
pub const CounterSampleBufferErrorInvalid: Self = Self(1);
pub const CounterSampleBufferErrorOutOfMemory: Self = Self(0);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=2)
}
}
impl std::convert::TryFrom<isize> for CounterSampleBufferError {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct CounterSamplingPoint(usize);
impl CounterSamplingPoint {
pub const CounterSamplingPointAtBlitBoundary: Self = Self(4);
pub const CounterSamplingPointAtDispatchBoundary: Self = Self(2);
pub const CounterSamplingPointAtDrawBoundary: Self = Self(1);
pub const CounterSamplingPointAtStageBoundary: Self = Self(0);
pub const CounterSamplingPointAtTileDispatchBoundary: Self = Self(3);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=4)
}
}
impl std::convert::TryFrom<usize> for CounterSamplingPoint {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct CullMode(usize);
impl CullMode {
pub const CullModeBack: Self = Self(2);
pub const CullModeFront: Self = Self(1);
pub const CullModeNone: Self = Self(0);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=2)
}
}
impl std::convert::TryFrom<usize> for CullMode {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct CurveBasis(isize);
impl CurveBasis {
pub const CurveBasisBSpline: Self = Self(0);
pub const CurveBasisBezier: Self = Self(3);
pub const CurveBasisCatmullRom: Self = Self(1);
pub const CurveBasisLinear: Self = Self(2);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=3)
}
}
impl std::convert::TryFrom<isize> for CurveBasis {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct CurveEndCaps(isize);
impl CurveEndCaps {
pub const CurveEndCapsDisk: Self = Self(1);
pub const CurveEndCapsNone: Self = Self(0);
pub const CurveEndCapsSphere: Self = Self(2);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=2)
}
}
impl std::convert::TryFrom<isize> for CurveEndCaps {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct CurveType(isize);
impl CurveType {
pub const CurveTypeFlat: Self = Self(1);
pub const CurveTypeRound: Self = Self(0);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<isize> for CurveType {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct DataType(usize);
impl DataType {
pub const DataTypeArray: Self = Self(2);
pub const DataTypeBFloat: Self = Self(121);
pub const DataTypeBFloat2: Self = Self(122);
pub const DataTypeBFloat3: Self = Self(123);
pub const DataTypeBFloat4: Self = Self(124);
pub const DataTypeBool: Self = Self(53);
pub const DataTypeBool2: Self = Self(54);
pub const DataTypeBool3: Self = Self(55);
pub const DataTypeBool4: Self = Self(56);
pub const DataTypeChar: Self = Self(45);
pub const DataTypeChar2: Self = Self(46);
pub const DataTypeChar3: Self = Self(47);
pub const DataTypeChar4: Self = Self(48);
pub const DataTypeComputePipeline: Self = Self(79);
pub const DataTypeDepthStencilState: Self = Self(139);
pub const DataTypeFloat: Self = Self(3);
pub const DataTypeFloat2: Self = Self(4);
pub const DataTypeFloat2x2: Self = Self(7);
pub const DataTypeFloat2x3: Self = Self(8);
pub const DataTypeFloat2x4: Self = Self(9);
pub const DataTypeFloat3: Self = Self(5);
pub const DataTypeFloat3x2: Self = Self(10);
pub const DataTypeFloat3x3: Self = Self(11);
pub const DataTypeFloat3x4: Self = Self(12);
pub const DataTypeFloat4: Self = Self(6);
pub const DataTypeFloat4x2: Self = Self(13);
pub const DataTypeFloat4x3: Self = Self(14);
pub const DataTypeFloat4x4: Self = Self(15);
pub const DataTypeHalf: Self = Self(16);
pub const DataTypeHalf2: Self = Self(17);
pub const DataTypeHalf2x2: Self = Self(20);
pub const DataTypeHalf2x3: Self = Self(21);
pub const DataTypeHalf2x4: Self = Self(22);
pub const DataTypeHalf3: Self = Self(18);
pub const DataTypeHalf3x2: Self = Self(23);
pub const DataTypeHalf3x3: Self = Self(24);
pub const DataTypeHalf3x4: Self = Self(25);
pub const DataTypeHalf4: Self = Self(19);
pub const DataTypeHalf4x2: Self = Self(26);
pub const DataTypeHalf4x3: Self = Self(27);
pub const DataTypeHalf4x4: Self = Self(28);
pub const DataTypeIndirectCommandBuffer: Self = Self(80);
pub const DataTypeInstanceAccelerationStructure: Self = Self(118);
pub const DataTypeInt: Self = Self(29);
pub const DataTypeInt2: Self = Self(30);
pub const DataTypeInt3: Self = Self(31);
pub const DataTypeInt4: Self = Self(32);
pub const DataTypeIntersectionFunctionTable: Self = Self(116);
pub const DataTypeLong: Self = Self(81);
pub const DataTypeLong2: Self = Self(82);
pub const DataTypeLong3: Self = Self(83);
pub const DataTypeLong4: Self = Self(84);
pub const DataTypeNone: Self = Self(0);
pub const DataTypePointer: Self = Self(60);
pub const DataTypePrimitiveAccelerationStructure: Self = Self(117);
pub const DataTypeR16Snorm: Self = Self(65);
pub const DataTypeR16Unorm: Self = Self(64);
pub const DataTypeR8Snorm: Self = Self(63);
pub const DataTypeR8Unorm: Self = Self(62);
pub const DataTypeRG11B10Float: Self = Self(76);
pub const DataTypeRG16Snorm: Self = Self(69);
pub const DataTypeRG16Unorm: Self = Self(68);
pub const DataTypeRG8Snorm: Self = Self(67);
pub const DataTypeRG8Unorm: Self = Self(66);
pub const DataTypeRGB10A2Unorm: Self = Self(75);
pub const DataTypeRGB9E5Float: Self = Self(77);
pub const DataTypeRGBA16Snorm: Self = Self(74);
pub const DataTypeRGBA16Unorm: Self = Self(73);
pub const DataTypeRGBA8Snorm: Self = Self(72);
pub const DataTypeRGBA8Unorm: Self = Self(70);
pub const DataTypeRGBA8Unorm_sRGB: Self = Self(71);
pub const DataTypeRenderPipeline: Self = Self(78);
pub const DataTypeSampler: Self = Self(59);
pub const DataTypeShort: Self = Self(37);
pub const DataTypeShort2: Self = Self(38);
pub const DataTypeShort3: Self = Self(39);
pub const DataTypeShort4: Self = Self(40);
pub const DataTypeStruct: Self = Self(1);
pub const DataTypeTensor: Self = Self(140);
pub const DataTypeTexture: Self = Self(58);
pub const DataTypeUChar: Self = Self(49);
pub const DataTypeUChar2: Self = Self(50);
pub const DataTypeUChar3: Self = Self(51);
pub const DataTypeUChar4: Self = Self(52);
pub const DataTypeUInt: Self = Self(33);
pub const DataTypeUInt2: Self = Self(34);
pub const DataTypeUInt3: Self = Self(35);
pub const DataTypeUInt4: Self = Self(36);
pub const DataTypeULong: Self = Self(85);
pub const DataTypeULong2: Self = Self(86);
pub const DataTypeULong3: Self = Self(87);
pub const DataTypeULong4: Self = Self(88);
pub const DataTypeUShort: Self = Self(41);
pub const DataTypeUShort2: Self = Self(42);
pub const DataTypeUShort3: Self = Self(43);
pub const DataTypeUShort4: Self = Self(44);
pub const DataTypeVisibleFunctionTable: Self = Self(115);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=56 | 58..=60 | 62..=88 | 115..=118 | 121..=124 | 139 | 140)
}
}
impl std::convert::TryFrom<usize> for DataType {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct DepthClipMode(usize);
impl DepthClipMode {
pub const DepthClipModeClamp: Self = Self(1);
pub const DepthClipModeClip: Self = Self(0);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<usize> for DepthClipMode {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct DeviceError(isize);
impl DeviceError {
pub const DeviceErrorNone: Self = Self(0);
pub const DeviceErrorNotSupported: Self = Self(1);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<isize> for DeviceError {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct DeviceLocation(usize);
impl DeviceLocation {
pub const DeviceLocationBuiltIn: Self = Self(0);
pub const DeviceLocationExternal: Self = Self(2);
pub const DeviceLocationSlot: Self = Self(1);
pub const DeviceLocationUnspecified: Self = Self(usize::MAX);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=2 | 18446744073709551615)
}
}
impl std::convert::TryFrom<usize> for DeviceLocation {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct DispatchType(usize);
impl DispatchType {
pub const DispatchTypeConcurrent: Self = Self(1);
pub const DispatchTypeSerial: Self = Self(0);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<usize> for DispatchType {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct DynamicLibraryError(usize);
impl DynamicLibraryError {
pub const DynamicLibraryErrorCompilationFailure: Self = Self(2);
pub const DynamicLibraryErrorDependencyLoadFailure: Self = Self(4);
pub const DynamicLibraryErrorInvalidFile: Self = Self(1);
pub const DynamicLibraryErrorNone: Self = Self(0);
pub const DynamicLibraryErrorUnresolvedInstallName: Self = Self(3);
pub const DynamicLibraryErrorUnsupported: Self = Self(5);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=5)
}
}
impl std::convert::TryFrom<usize> for DynamicLibraryError {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct FeatureSet(usize);
impl FeatureSet {
pub const FeatureSet_OSX_GPUFamily1_v1: Self = Self(10000);
pub const FeatureSet_OSX_GPUFamily1_v2: Self = Self(10001);
pub const FeatureSet_OSX_ReadWriteTextureTier2: Self = Self(10002);
pub const FeatureSet_TVOS_GPUFamily1_v1: Self = Self(30000);
pub const FeatureSet_WatchOS_GPUFamily1_v1: Self = Self(20000);
pub const FeatureSet_WatchOS_GPUFamily2_v1: Self = Self(20001);
pub const FeatureSet_iOS_GPUFamily1_v1: Self = Self(0);
pub const FeatureSet_iOS_GPUFamily1_v2: Self = Self(2);
pub const FeatureSet_iOS_GPUFamily1_v3: Self = Self(5);
pub const FeatureSet_iOS_GPUFamily1_v4: Self = Self(8);
pub const FeatureSet_iOS_GPUFamily1_v5: Self = Self(12);
pub const FeatureSet_iOS_GPUFamily2_v1: Self = Self(1);
pub const FeatureSet_iOS_GPUFamily2_v2: Self = Self(3);
pub const FeatureSet_iOS_GPUFamily2_v3: Self = Self(6);
pub const FeatureSet_iOS_GPUFamily2_v4: Self = Self(9);
pub const FeatureSet_iOS_GPUFamily2_v5: Self = Self(13);
pub const FeatureSet_iOS_GPUFamily3_v1: Self = Self(4);
pub const FeatureSet_iOS_GPUFamily3_v2: Self = Self(7);
pub const FeatureSet_iOS_GPUFamily3_v3: Self = Self(10);
pub const FeatureSet_iOS_GPUFamily3_v4: Self = Self(14);
pub const FeatureSet_iOS_GPUFamily4_v1: Self = Self(11);
pub const FeatureSet_iOS_GPUFamily4_v2: Self = Self(15);
pub const FeatureSet_iOS_GPUFamily5_v1: Self = Self(16);
pub const FeatureSet_macOS_GPUFamily1_v1: Self = Self(10000);
pub const FeatureSet_macOS_GPUFamily1_v2: Self = Self(10001);
pub const FeatureSet_macOS_GPUFamily1_v3: Self = Self(10003);
pub const FeatureSet_macOS_GPUFamily1_v4: Self = Self(10004);
pub const FeatureSet_macOS_GPUFamily2_v1: Self = Self(10005);
pub const FeatureSet_macOS_ReadWriteTextureTier2: Self = Self(10002);
pub const FeatureSet_tvOS_GPUFamily1_v1: Self = Self(30000);
pub const FeatureSet_tvOS_GPUFamily1_v2: Self = Self(30001);
pub const FeatureSet_tvOS_GPUFamily1_v3: Self = Self(30002);
pub const FeatureSet_tvOS_GPUFamily1_v4: Self = Self(30004);
pub const FeatureSet_tvOS_GPUFamily2_v1: Self = Self(30003);
pub const FeatureSet_tvOS_GPUFamily2_v2: Self = Self(30005);
pub const FeatureSet_watchOS_GPUFamily1_v1: Self = Self(20000);
pub const FeatureSet_watchOS_GPUFamily2_v1: Self = Self(20001);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=16 | 10000..=10005 | 20000 | 20001 | 30000..=30005)
}
}
impl std::convert::TryFrom<usize> for FeatureSet {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct FloatingPointConversionRoundingMode(isize);
impl FloatingPointConversionRoundingMode {
pub const FloatingPointConversionRoundingModeToNearestEven: Self = Self(0);
pub const FloatingPointConversionRoundingModeTowardZero: Self = Self(1);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<isize> for FloatingPointConversionRoundingMode {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct FunctionLogType(usize);
impl FunctionLogType {
pub const FunctionLogTypeValidation: Self = Self(0);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0)
}
}
impl std::convert::TryFrom<usize> for FunctionLogType {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct FunctionOptions(usize);
impl FunctionOptions {
pub const FunctionOptionCompileToBinary: Self = Self(1);
pub const FunctionOptionFailOnBinaryArchiveMiss: Self = Self(4);
pub const FunctionOptionNone: Self = Self(0);
pub const FunctionOptionPipelineIndependent: Self = Self(8);
pub const FunctionOptionStoreFunctionInMetalPipelinesScript: Self = Self(2);
pub const FunctionOptionStoreFunctionInMetalScript: Self = Self(2);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
const VALID_BITS: usize = 15;
self.0 & !VALID_BITS == 0
}
#[must_use]
pub const fn from_bits(value: usize) -> Option<Self> {
let value = Self(value);
if value.is_valid() { Some(value) } else { None }
}
}
impl std::ops::BitOr for FunctionOptions {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl std::ops::BitAnd for FunctionOptions {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct FunctionType(usize);
impl FunctionType {
pub const FunctionTypeFragment: Self = Self(2);
pub const FunctionTypeIntersection: Self = Self(6);
pub const FunctionTypeKernel: Self = Self(3);
pub const FunctionTypeMesh: Self = Self(7);
pub const FunctionTypeObject: Self = Self(8);
pub const FunctionTypeVertex: Self = Self(1);
pub const FunctionTypeVisible: Self = Self(5);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 1..=3 | 5..=8)
}
}
impl std::convert::TryFrom<usize> for FunctionType {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct GPUFamily(isize);
impl GPUFamily {
pub const GPUFamilyApple1: Self = Self(1001);
pub const GPUFamilyApple10: Self = Self(1010);
pub const GPUFamilyApple2: Self = Self(1002);
pub const GPUFamilyApple3: Self = Self(1003);
pub const GPUFamilyApple4: Self = Self(1004);
pub const GPUFamilyApple5: Self = Self(1005);
pub const GPUFamilyApple6: Self = Self(1006);
pub const GPUFamilyApple7: Self = Self(1007);
pub const GPUFamilyApple8: Self = Self(1008);
pub const GPUFamilyApple9: Self = Self(1009);
pub const GPUFamilyCommon1: Self = Self(3001);
pub const GPUFamilyCommon2: Self = Self(3002);
pub const GPUFamilyCommon3: Self = Self(3003);
pub const GPUFamilyMac1: Self = Self(2001);
pub const GPUFamilyMac2: Self = Self(2002);
pub const GPUFamilyMacCatalyst1: Self = Self(4001);
pub const GPUFamilyMacCatalyst2: Self = Self(4002);
pub const GPUFamilyMetal3: Self = Self(5001);
pub const GPUFamilyMetal4: Self = Self(5002);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 1001..=1010 | 2001 | 2002 | 3001..=3003 | 4001 | 4002 | 5001 | 5002)
}
}
impl std::convert::TryFrom<isize> for GPUFamily {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct HazardTrackingMode(usize);
impl HazardTrackingMode {
pub const HazardTrackingModeDefault: Self = Self(0);
pub const HazardTrackingModeTracked: Self = Self(2);
pub const HazardTrackingModeUntracked: Self = Self(1);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=2)
}
}
impl std::convert::TryFrom<usize> for HazardTrackingMode {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct HeapType(isize);
impl HeapType {
pub const HeapTypeAutomatic: Self = Self(0);
pub const HeapTypePlacement: Self = Self(1);
pub const HeapTypeSparse: Self = Self(2);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=2)
}
}
impl std::convert::TryFrom<isize> for HeapType {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct IOCommandQueueType(isize);
impl IOCommandQueueType {
pub const IOCommandQueueTypeConcurrent: Self = Self(0);
pub const IOCommandQueueTypeSerial: Self = Self(1);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<isize> for IOCommandQueueType {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct IOCompressionMethod(isize);
impl IOCompressionMethod {
pub const IOCompressionMethodLZ4: Self = Self(2);
pub const IOCompressionMethodLZBitmap: Self = Self(4);
pub const IOCompressionMethodLZFSE: Self = Self(1);
pub const IOCompressionMethodLZMA: Self = Self(3);
pub const IOCompressionMethodZlib: Self = Self(0);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=4)
}
}
impl std::convert::TryFrom<isize> for IOCompressionMethod {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct IOCompressionStatus(isize);
impl IOCompressionStatus {
pub const IOCompressionStatusComplete: Self = Self(0);
pub const IOCompressionStatusError: Self = Self(1);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<isize> for IOCompressionStatus {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct IOError(isize);
impl IOError {
pub const IOErrorInternal: Self = Self(2);
pub const IOErrorURLInvalid: Self = Self(1);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 1 | 2)
}
}
impl std::convert::TryFrom<isize> for IOError {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct IOPriority(isize);
impl IOPriority {
pub const IOPriorityHigh: Self = Self(0);
pub const IOPriorityLow: Self = Self(2);
pub const IOPriorityNormal: Self = Self(1);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=2)
}
}
impl std::convert::TryFrom<isize> for IOPriority {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct IOStatus(isize);
impl IOStatus {
pub const IOStatusCancelled: Self = Self(1);
pub const IOStatusComplete: Self = Self(3);
pub const IOStatusError: Self = Self(2);
pub const IOStatusPending: Self = Self(0);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=3)
}
}
impl std::convert::TryFrom<isize> for IOStatus {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct IndexType(usize);
impl IndexType {
pub const IndexTypeUInt16: Self = Self(0);
pub const IndexTypeUInt32: Self = Self(1);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<usize> for IndexType {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct IndirectCommandType(usize);
impl IndirectCommandType {
pub const IndirectCommandTypeConcurrentDispatch: Self = Self(32);
pub const IndirectCommandTypeConcurrentDispatchThreads: Self = Self(64);
pub const IndirectCommandTypeDraw: Self = Self(1);
pub const IndirectCommandTypeDrawIndexed: Self = Self(2);
pub const IndirectCommandTypeDrawIndexedPatches: Self = Self(8);
pub const IndirectCommandTypeDrawMeshThreadgroups: Self = Self(128);
pub const IndirectCommandTypeDrawMeshThreads: Self = Self(256);
pub const IndirectCommandTypeDrawPatches: Self = Self(4);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
const VALID_BITS: usize = 495;
self.0 & !VALID_BITS == 0
}
#[must_use]
pub const fn from_bits(value: usize) -> Option<Self> {
let value = Self(value);
if value.is_valid() { Some(value) } else { None }
}
}
impl std::ops::BitOr for IndirectCommandType {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl std::ops::BitAnd for IndirectCommandType {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct IntersectionFunctionSignature(usize);
impl IntersectionFunctionSignature {
pub const IntersectionFunctionSignatureCurveData: Self = Self(128);
pub const IntersectionFunctionSignatureExtendedLimits: Self = Self(32);
pub const IntersectionFunctionSignatureInstanceMotion: Self = Self(8);
pub const IntersectionFunctionSignatureInstancing: Self = Self(1);
pub const IntersectionFunctionSignatureIntersectionFunctionBuffer: Self = Self(256);
pub const IntersectionFunctionSignatureMaxLevels: Self = Self(64);
pub const IntersectionFunctionSignatureNone: Self = Self(0);
pub const IntersectionFunctionSignaturePrimitiveMotion: Self = Self(16);
pub const IntersectionFunctionSignatureTriangleData: Self = Self(2);
pub const IntersectionFunctionSignatureUserData: Self = Self(512);
pub const IntersectionFunctionSignatureWorldSpaceData: Self = Self(4);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
const VALID_BITS: usize = 1023;
self.0 & !VALID_BITS == 0
}
#[must_use]
pub const fn from_bits(value: usize) -> Option<Self> {
let value = Self(value);
if value.is_valid() { Some(value) } else { None }
}
}
impl std::ops::BitOr for IntersectionFunctionSignature {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl std::ops::BitAnd for IntersectionFunctionSignature {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct LanguageVersion(usize);
impl LanguageVersion {
pub const LanguageVersion1_0: Self = Self(65536);
pub const LanguageVersion1_1: Self = Self(65537);
pub const LanguageVersion1_2: Self = Self(65538);
pub const LanguageVersion2_0: Self = Self(131072);
pub const LanguageVersion2_1: Self = Self(131073);
pub const LanguageVersion2_2: Self = Self(131074);
pub const LanguageVersion2_3: Self = Self(131075);
pub const LanguageVersion2_4: Self = Self(131076);
pub const LanguageVersion3_0: Self = Self(196608);
pub const LanguageVersion3_1: Self = Self(196609);
pub const LanguageVersion3_2: Self = Self(196610);
pub const LanguageVersion4_0: Self = Self(262144);
pub const LanguageVersion4_1: Self = Self(262145);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 65536..=65538 | 131072..=131076 | 196608..=196610 | 262144 | 262145)
}
}
impl std::convert::TryFrom<usize> for LanguageVersion {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct LibraryError(usize);
impl LibraryError {
pub const LibraryErrorCompileFailure: Self = Self(3);
pub const LibraryErrorCompileWarning: Self = Self(4);
pub const LibraryErrorFileNotFound: Self = Self(6);
pub const LibraryErrorFunctionNotFound: Self = Self(5);
pub const LibraryErrorInternal: Self = Self(2);
pub const LibraryErrorUnsupported: Self = Self(1);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 1..=6)
}
}
impl std::convert::TryFrom<usize> for LibraryError {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct LibraryOptimizationLevel(isize);
impl LibraryOptimizationLevel {
pub const LibraryOptimizationLevelDefault: Self = Self(0);
pub const LibraryOptimizationLevelSize: Self = Self(1);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<isize> for LibraryOptimizationLevel {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct LibraryType(isize);
impl LibraryType {
pub const LibraryTypeDynamic: Self = Self(1);
pub const LibraryTypeExecutable: Self = Self(0);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<isize> for LibraryType {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct LoadAction(usize);
impl LoadAction {
pub const LoadActionClear: Self = Self(2);
pub const LoadActionDontCare: Self = Self(0);
pub const LoadActionLoad: Self = Self(1);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=2)
}
}
impl std::convert::TryFrom<usize> for LoadAction {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct LogLevel(isize);
impl LogLevel {
pub const LogLevelDebug: Self = Self(1);
pub const LogLevelError: Self = Self(4);
pub const LogLevelFault: Self = Self(5);
pub const LogLevelInfo: Self = Self(2);
pub const LogLevelNotice: Self = Self(3);
pub const LogLevelUndefined: Self = Self(0);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=5)
}
}
impl std::convert::TryFrom<isize> for LogLevel {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct LogStateError(usize);
impl LogStateError {
pub const LogStateErrorInvalid: Self = Self(2);
pub const LogStateErrorInvalidSize: Self = Self(1);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 1 | 2)
}
}
impl std::convert::TryFrom<usize> for LogStateError {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct MathFloatingPointFunctions(isize);
impl MathFloatingPointFunctions {
pub const MathFloatingPointFunctionsFast: Self = Self(0);
pub const MathFloatingPointFunctionsPrecise: Self = Self(1);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<isize> for MathFloatingPointFunctions {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct MathMode(isize);
impl MathMode {
pub const MathModeFast: Self = Self(2);
pub const MathModeRelaxed: Self = Self(1);
pub const MathModeSafe: Self = Self(0);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=2)
}
}
impl std::convert::TryFrom<isize> for MathMode {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct MatrixLayout(isize);
impl MatrixLayout {
pub const MatrixLayoutColumnMajor: Self = Self(0);
pub const MatrixLayoutRowMajor: Self = Self(1);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<isize> for MatrixLayout {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct MotionBorderMode(u32);
impl MotionBorderMode {
pub const MotionBorderModeClamp: Self = Self(0);
pub const MotionBorderModeVanish: Self = Self(1);
pub(crate) const fn from_system_raw(value: u32) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> u32 {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<u32> for MotionBorderMode {
type Error = ();
fn try_from(value: u32) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct MultisampleDepthResolveFilter(usize);
impl MultisampleDepthResolveFilter {
pub const MultisampleDepthResolveFilterMax: Self = Self(2);
pub const MultisampleDepthResolveFilterMin: Self = Self(1);
pub const MultisampleDepthResolveFilterSample0: Self = Self(0);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=2)
}
}
impl std::convert::TryFrom<usize> for MultisampleDepthResolveFilter {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct MultisampleStencilResolveFilter(usize);
impl MultisampleStencilResolveFilter {
pub const MultisampleStencilResolveFilterDepthResolvedSample: Self = Self(1);
pub const MultisampleStencilResolveFilterSample0: Self = Self(0);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<usize> for MultisampleStencilResolveFilter {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct Mutability(usize);
impl Mutability {
pub const MutabilityDefault: Self = Self(0);
pub const MutabilityImmutable: Self = Self(2);
pub const MutabilityMutable: Self = Self(1);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=2)
}
}
impl std::convert::TryFrom<usize> for Mutability {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct PatchType(usize);
impl PatchType {
pub const PatchTypeNone: Self = Self(0);
pub const PatchTypeQuad: Self = Self(2);
pub const PatchTypeTriangle: Self = Self(1);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=2)
}
}
impl std::convert::TryFrom<usize> for PatchType {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct PipelineOption(usize);
impl PipelineOption {
pub const PipelineOptionArgumentInfo: Self = Self(1);
pub const PipelineOptionBindingInfo: Self = Self(1);
pub const PipelineOptionBufferTypeInfo: Self = Self(2);
pub const PipelineOptionFailOnBinaryArchiveMiss: Self = Self(4);
pub const PipelineOptionNone: Self = Self(0);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
const VALID_BITS: usize = 7;
self.0 & !VALID_BITS == 0
}
#[must_use]
pub const fn from_bits(value: usize) -> Option<Self> {
let value = Self(value);
if value.is_valid() { Some(value) } else { None }
}
}
impl std::ops::BitOr for PipelineOption {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl std::ops::BitAnd for PipelineOption {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct PrimitiveTopologyClass(usize);
impl PrimitiveTopologyClass {
pub const PrimitiveTopologyClassLine: Self = Self(2);
pub const PrimitiveTopologyClassPoint: Self = Self(1);
pub const PrimitiveTopologyClassTriangle: Self = Self(3);
pub const PrimitiveTopologyClassUnspecified: Self = Self(0);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=3)
}
}
impl std::convert::TryFrom<usize> for PrimitiveTopologyClass {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct PurgeableState(usize);
impl PurgeableState {
pub const PurgeableStateEmpty: Self = Self(4);
pub const PurgeableStateKeepCurrent: Self = Self(1);
pub const PurgeableStateNonVolatile: Self = Self(2);
pub const PurgeableStateVolatile: Self = Self(3);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 1..=4)
}
}
impl std::convert::TryFrom<usize> for PurgeableState {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct ReadWriteTextureTier(usize);
impl ReadWriteTextureTier {
pub const ReadWriteTextureTier1: Self = Self(1);
pub const ReadWriteTextureTier2: Self = Self(2);
pub const ReadWriteTextureTierNone: Self = Self(0);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=2)
}
}
impl std::convert::TryFrom<usize> for ReadWriteTextureTier {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct RenderStages(usize);
impl RenderStages {
pub const RenderStageFragment: Self = Self(2);
pub const RenderStageMesh: Self = Self(16);
pub const RenderStageObject: Self = Self(8);
pub const RenderStageTile: Self = Self(4);
pub const RenderStageVertex: Self = Self(1);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
const VALID_BITS: usize = 31;
self.0 & !VALID_BITS == 0
}
#[must_use]
pub const fn from_bits(value: usize) -> Option<Self> {
let value = Self(value);
if value.is_valid() { Some(value) } else { None }
}
}
impl std::ops::BitOr for RenderStages {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl std::ops::BitAnd for RenderStages {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct ResourceUsage(usize);
impl ResourceUsage {
pub const ResourceUsageRead: Self = Self(1);
pub const ResourceUsageSample: Self = Self(4);
pub const ResourceUsageWrite: Self = Self(2);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
const VALID_BITS: usize = 7;
self.0 & !VALID_BITS == 0
}
#[must_use]
pub const fn from_bits(value: usize) -> Option<Self> {
let value = Self(value);
if value.is_valid() { Some(value) } else { None }
}
}
impl std::ops::BitOr for ResourceUsage {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl std::ops::BitAnd for ResourceUsage {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct SamplerAddressMode(usize);
impl SamplerAddressMode {
pub const SamplerAddressModeClampToBorderColor: Self = Self(5);
pub const SamplerAddressModeClampToEdge: Self = Self(0);
pub const SamplerAddressModeClampToZero: Self = Self(4);
pub const SamplerAddressModeMirrorClampToEdge: Self = Self(1);
pub const SamplerAddressModeMirrorRepeat: Self = Self(3);
pub const SamplerAddressModeRepeat: Self = Self(2);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=5)
}
}
impl std::convert::TryFrom<usize> for SamplerAddressMode {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct SamplerBorderColor(usize);
impl SamplerBorderColor {
pub const SamplerBorderColorOpaqueBlack: Self = Self(1);
pub const SamplerBorderColorOpaqueWhite: Self = Self(2);
pub const SamplerBorderColorTransparentBlack: Self = Self(0);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=2)
}
}
impl std::convert::TryFrom<usize> for SamplerBorderColor {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct SamplerMinMagFilter(usize);
impl SamplerMinMagFilter {
pub const SamplerMinMagFilterLinear: Self = Self(1);
pub const SamplerMinMagFilterNearest: Self = Self(0);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<usize> for SamplerMinMagFilter {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct SamplerMipFilter(usize);
impl SamplerMipFilter {
pub const SamplerMipFilterLinear: Self = Self(2);
pub const SamplerMipFilterNearest: Self = Self(1);
pub const SamplerMipFilterNotMipmapped: Self = Self(0);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=2)
}
}
impl std::convert::TryFrom<usize> for SamplerMipFilter {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct SamplerReductionMode(isize);
impl SamplerReductionMode {
pub const SamplerReductionModeMaximum: Self = Self(2);
pub const SamplerReductionModeMinimum: Self = Self(1);
pub const SamplerReductionModeWeightedAverage: Self = Self(0);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=2)
}
}
impl std::convert::TryFrom<isize> for SamplerReductionMode {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct ShaderValidation(isize);
impl ShaderValidation {
pub const ShaderValidationDefault: Self = Self(0);
pub const ShaderValidationDisabled: Self = Self(2);
pub const ShaderValidationEnabled: Self = Self(1);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=2)
}
}
impl std::convert::TryFrom<isize> for ShaderValidation {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct SparsePageSize(isize);
impl SparsePageSize {
pub const SparsePageSize16: Self = Self(101);
pub const SparsePageSize256: Self = Self(103);
pub const SparsePageSize64: Self = Self(102);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 101..=103)
}
}
impl std::convert::TryFrom<isize> for SparsePageSize {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct SparseTextureMappingMode(usize);
impl SparseTextureMappingMode {
pub const SparseTextureMappingModeMap: Self = Self(0);
pub const SparseTextureMappingModeUnmap: Self = Self(1);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<usize> for SparseTextureMappingMode {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct SparseTextureRegionAlignmentMode(usize);
impl SparseTextureRegionAlignmentMode {
pub const SparseTextureRegionAlignmentModeInward: Self = Self(1);
pub const SparseTextureRegionAlignmentModeOutward: Self = Self(0);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<usize> for SparseTextureRegionAlignmentMode {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct Stages(usize);
impl Stages {
pub const StageAccelerationStructure: Self = Self(536870912);
pub const StageAll: Self = Self(9223372036854775807);
pub const StageBlit: Self = Self(268435456);
pub const StageDispatch: Self = Self(134217728);
pub const StageFragment: Self = Self(2);
pub const StageMachineLearning: Self = Self(1073741824);
pub const StageMesh: Self = Self(16);
pub const StageObject: Self = Self(8);
pub const StageResourceState: Self = Self(67108864);
pub const StageTile: Self = Self(4);
pub const StageVertex: Self = Self(1);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
const VALID_BITS: usize = 9223372036854775807;
self.0 & !VALID_BITS == 0
}
#[must_use]
pub const fn from_bits(value: usize) -> Option<Self> {
let value = Self(value);
if value.is_valid() { Some(value) } else { None }
}
}
impl std::ops::BitOr for Stages {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl std::ops::BitAnd for Stages {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct StencilOperation(usize);
impl StencilOperation {
pub const StencilOperationDecrementClamp: Self = Self(4);
pub const StencilOperationDecrementWrap: Self = Self(7);
pub const StencilOperationIncrementClamp: Self = Self(3);
pub const StencilOperationIncrementWrap: Self = Self(6);
pub const StencilOperationInvert: Self = Self(5);
pub const StencilOperationKeep: Self = Self(0);
pub const StencilOperationReplace: Self = Self(2);
pub const StencilOperationZero: Self = Self(1);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=7)
}
}
impl std::convert::TryFrom<usize> for StencilOperation {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct StepFunction(usize);
impl StepFunction {
pub const StepFunctionConstant: Self = Self(0);
pub const StepFunctionPerInstance: Self = Self(2);
pub const StepFunctionPerPatch: Self = Self(3);
pub const StepFunctionPerPatchControlPoint: Self = Self(4);
pub const StepFunctionPerVertex: Self = Self(1);
pub const StepFunctionThreadPositionInGridX: Self = Self(5);
pub const StepFunctionThreadPositionInGridXIndexed: Self = Self(7);
pub const StepFunctionThreadPositionInGridY: Self = Self(6);
pub const StepFunctionThreadPositionInGridYIndexed: Self = Self(8);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=8)
}
}
impl std::convert::TryFrom<usize> for StepFunction {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct StitchedLibraryOptions(usize);
impl StitchedLibraryOptions {
pub const StitchedLibraryOptionFailOnBinaryArchiveMiss: Self = Self(1);
pub const StitchedLibraryOptionNone: Self = Self(0);
pub const StitchedLibraryOptionStoreLibraryInMetalPipelinesScript: Self = Self(2);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
const VALID_BITS: usize = 3;
self.0 & !VALID_BITS == 0
}
#[must_use]
pub const fn from_bits(value: usize) -> Option<Self> {
let value = Self(value);
if value.is_valid() { Some(value) } else { None }
}
}
impl std::ops::BitOr for StitchedLibraryOptions {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl std::ops::BitAnd for StitchedLibraryOptions {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct StoreAction(usize);
impl StoreAction {
pub const StoreActionCustomSampleDepthStore: Self = Self(5);
pub const StoreActionDontCare: Self = Self(0);
pub const StoreActionMultisampleResolve: Self = Self(2);
pub const StoreActionStore: Self = Self(1);
pub const StoreActionStoreAndMultisampleResolve: Self = Self(3);
pub const StoreActionUnknown: Self = Self(4);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=5)
}
}
impl std::convert::TryFrom<usize> for StoreAction {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct StoreActionOptions(usize);
impl StoreActionOptions {
pub const StoreActionOptionCustomSamplePositions: Self = Self(1);
pub const StoreActionOptionNone: Self = Self(0);
pub const StoreActionOptionValidMask: Self = Self(1);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
const VALID_BITS: usize = 1;
self.0 & !VALID_BITS == 0
}
#[must_use]
pub const fn from_bits(value: usize) -> Option<Self> {
let value = Self(value);
if value.is_valid() { Some(value) } else { None }
}
}
impl std::ops::BitOr for StoreActionOptions {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl std::ops::BitAnd for StoreActionOptions {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct TensorDataType(isize);
impl TensorDataType {
pub const TensorDataTypeBFloat16: Self = Self(121);
pub const TensorDataTypeFloat16: Self = Self(16);
pub const TensorDataTypeFloat32: Self = Self(3);
pub const TensorDataTypeInt16: Self = Self(37);
pub const TensorDataTypeInt2: Self = Self(150);
pub const TensorDataTypeInt32: Self = Self(29);
pub const TensorDataTypeInt4: Self = Self(143);
pub const TensorDataTypeInt8: Self = Self(45);
pub const TensorDataTypeMetalFloat4E2M1: Self = Self(148);
pub const TensorDataTypeMetalFloat8E4M3: Self = Self(142);
pub const TensorDataTypeMetalFloat8E5M2: Self = Self(141);
pub const TensorDataTypeMetalFloat8UE8M0: Self = Self(145);
pub const TensorDataTypeNone: Self = Self(0);
pub const TensorDataTypeUInt16: Self = Self(41);
pub const TensorDataTypeUInt2: Self = Self(149);
pub const TensorDataTypeUInt32: Self = Self(33);
pub const TensorDataTypeUInt4: Self = Self(144);
pub const TensorDataTypeUInt8: Self = Self(49);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 3 | 16 | 29 | 33 | 37 | 41 | 45 | 49 | 121 | 141..=145 | 148..=150)
}
}
impl std::convert::TryFrom<isize> for TensorDataType {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct TensorError(isize);
impl TensorError {
pub const TensorErrorInternalError: Self = Self(1);
pub const TensorErrorInvalidDescriptor: Self = Self(2);
pub const TensorErrorNone: Self = Self(0);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=2)
}
}
impl std::convert::TryFrom<isize> for TensorError {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct TensorPlaneType(isize);
impl TensorPlaneType {
pub const TensorPlaneTypeData: Self = Self(0);
pub const TensorPlaneTypeScales: Self = Self(1);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<isize> for TensorPlaneType {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct TensorUsage(usize);
impl TensorUsage {
pub const TensorUsageCompute: Self = Self(1);
pub const TensorUsageMachineLearning: Self = Self(4);
pub const TensorUsageRender: Self = Self(2);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
const VALID_BITS: usize = 7;
self.0 & !VALID_BITS == 0
}
#[must_use]
pub const fn from_bits(value: usize) -> Option<Self> {
let value = Self(value);
if value.is_valid() { Some(value) } else { None }
}
}
impl std::ops::BitOr for TensorUsage {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl std::ops::BitAnd for TensorUsage {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct TessellationControlPointIndexType(usize);
impl TessellationControlPointIndexType {
pub const TessellationControlPointIndexTypeNone: Self = Self(0);
pub const TessellationControlPointIndexTypeUInt16: Self = Self(1);
pub const TessellationControlPointIndexTypeUInt32: Self = Self(2);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=2)
}
}
impl std::convert::TryFrom<usize> for TessellationControlPointIndexType {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct TessellationFactorFormat(usize);
impl TessellationFactorFormat {
pub const TessellationFactorFormatHalf: Self = Self(0);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0)
}
}
impl std::convert::TryFrom<usize> for TessellationFactorFormat {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct TessellationFactorStepFunction(usize);
impl TessellationFactorStepFunction {
pub const TessellationFactorStepFunctionConstant: Self = Self(0);
pub const TessellationFactorStepFunctionPerInstance: Self = Self(2);
pub const TessellationFactorStepFunctionPerPatch: Self = Self(1);
pub const TessellationFactorStepFunctionPerPatchAndPerInstance: Self = Self(3);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=3)
}
}
impl std::convert::TryFrom<usize> for TessellationFactorStepFunction {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct TessellationPartitionMode(usize);
impl TessellationPartitionMode {
pub const TessellationPartitionModeFractionalEven: Self = Self(3);
pub const TessellationPartitionModeFractionalOdd: Self = Self(2);
pub const TessellationPartitionModeInteger: Self = Self(1);
pub const TessellationPartitionModePow2: Self = Self(0);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=3)
}
}
impl std::convert::TryFrom<usize> for TessellationPartitionMode {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct TextureCompressionType(isize);
impl TextureCompressionType {
pub const TextureCompressionTypeLossless: Self = Self(0);
pub const TextureCompressionTypeLossy: Self = Self(1);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<isize> for TextureCompressionType {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct TextureSparseTier(isize);
impl TextureSparseTier {
pub const TextureSparseTier1: Self = Self(1);
pub const TextureSparseTier2: Self = Self(2);
pub const TextureSparseTierNone: Self = Self(0);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=2)
}
}
impl std::convert::TryFrom<isize> for TextureSparseTier {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct TextureSwizzle(u8);
impl TextureSwizzle {
pub const TextureSwizzleAlpha: Self = Self(5);
pub const TextureSwizzleBlue: Self = Self(4);
pub const TextureSwizzleGreen: Self = Self(3);
pub const TextureSwizzleOne: Self = Self(1);
pub const TextureSwizzleRed: Self = Self(2);
pub const TextureSwizzleZero: Self = Self(0);
pub(crate) const fn from_system_raw(value: u8) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> u8 {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=5)
}
}
impl std::convert::TryFrom<u8> for TextureSwizzle {
type Error = ();
fn try_from(value: u8) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct TransformType(isize);
impl TransformType {
pub const TransformTypeComponent: Self = Self(1);
pub const TransformTypePackedFloat4x3: Self = Self(0);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<isize> for TransformType {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct TriangleFillMode(usize);
impl TriangleFillMode {
pub const TriangleFillModeFill: Self = Self(0);
pub const TriangleFillModeLines: Self = Self(1);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<usize> for TriangleFillMode {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct VertexFormat(usize);
impl VertexFormat {
pub const VertexFormatChar: Self = Self(46);
pub const VertexFormatChar2: Self = Self(4);
pub const VertexFormatChar2Normalized: Self = Self(10);
pub const VertexFormatChar3: Self = Self(5);
pub const VertexFormatChar3Normalized: Self = Self(11);
pub const VertexFormatChar4: Self = Self(6);
pub const VertexFormatChar4Normalized: Self = Self(12);
pub const VertexFormatCharNormalized: Self = Self(48);
pub const VertexFormatFloat: Self = Self(28);
pub const VertexFormatFloat2: Self = Self(29);
pub const VertexFormatFloat3: Self = Self(30);
pub const VertexFormatFloat4: Self = Self(31);
pub const VertexFormatFloatRG11B10: Self = Self(54);
pub const VertexFormatFloatRGB9E5: Self = Self(55);
pub const VertexFormatHalf: Self = Self(53);
pub const VertexFormatHalf2: Self = Self(25);
pub const VertexFormatHalf3: Self = Self(26);
pub const VertexFormatHalf4: Self = Self(27);
pub const VertexFormatInt: Self = Self(32);
pub const VertexFormatInt1010102Normalized: Self = Self(40);
pub const VertexFormatInt2: Self = Self(33);
pub const VertexFormatInt3: Self = Self(34);
pub const VertexFormatInt4: Self = Self(35);
pub const VertexFormatInvalid: Self = Self(0);
pub const VertexFormatShort: Self = Self(50);
pub const VertexFormatShort2: Self = Self(16);
pub const VertexFormatShort2Normalized: Self = Self(22);
pub const VertexFormatShort3: Self = Self(17);
pub const VertexFormatShort3Normalized: Self = Self(23);
pub const VertexFormatShort4: Self = Self(18);
pub const VertexFormatShort4Normalized: Self = Self(24);
pub const VertexFormatShortNormalized: Self = Self(52);
pub const VertexFormatUChar: Self = Self(45);
pub const VertexFormatUChar2: Self = Self(1);
pub const VertexFormatUChar2Normalized: Self = Self(7);
pub const VertexFormatUChar3: Self = Self(2);
pub const VertexFormatUChar3Normalized: Self = Self(8);
pub const VertexFormatUChar4: Self = Self(3);
pub const VertexFormatUChar4Normalized: Self = Self(9);
pub const VertexFormatUChar4Normalized_BGRA: Self = Self(42);
pub const VertexFormatUCharNormalized: Self = Self(47);
pub const VertexFormatUInt: Self = Self(36);
pub const VertexFormatUInt1010102Normalized: Self = Self(41);
pub const VertexFormatUInt2: Self = Self(37);
pub const VertexFormatUInt3: Self = Self(38);
pub const VertexFormatUInt4: Self = Self(39);
pub const VertexFormatUShort: Self = Self(49);
pub const VertexFormatUShort2: Self = Self(13);
pub const VertexFormatUShort2Normalized: Self = Self(19);
pub const VertexFormatUShort3: Self = Self(14);
pub const VertexFormatUShort3Normalized: Self = Self(20);
pub const VertexFormatUShort4: Self = Self(15);
pub const VertexFormatUShort4Normalized: Self = Self(21);
pub const VertexFormatUShortNormalized: Self = Self(51);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=42 | 45..=55)
}
}
impl std::convert::TryFrom<usize> for VertexFormat {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct VertexStepFunction(usize);
impl VertexStepFunction {
pub const VertexStepFunctionConstant: Self = Self(0);
pub const VertexStepFunctionPerInstance: Self = Self(2);
pub const VertexStepFunctionPerPatch: Self = Self(3);
pub const VertexStepFunctionPerPatchControlPoint: Self = Self(4);
pub const VertexStepFunctionPerVertex: Self = Self(1);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=4)
}
}
impl std::convert::TryFrom<usize> for VertexStepFunction {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct VisibilityResultMode(usize);
impl VisibilityResultMode {
pub const VisibilityResultModeBoolean: Self = Self(1);
pub const VisibilityResultModeCounting: Self = Self(2);
pub const VisibilityResultModeDisabled: Self = Self(0);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=2)
}
}
impl std::convert::TryFrom<usize> for VisibilityResultMode {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct VisibilityResultType(isize);
impl VisibilityResultType {
pub const VisibilityResultTypeAccumulate: Self = Self(1);
pub const VisibilityResultTypeReset: Self = Self(0);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<isize> for VisibilityResultType {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct Winding(usize);
impl Winding {
pub const WindingClockwise: Self = Self(0);
pub const WindingCounterClockwise: Self = Self(1);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0 | 1)
}
}
impl std::convert::TryFrom<usize> for Winding {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct ActivityOptions(u64);
impl ActivityOptions {
pub const ActivityAutomaticTerminationDisabled: Self = Self(32768);
pub const ActivityBackground: Self = Self(255);
pub const ActivityIdleDisplaySleepDisabled: Self = Self(1099511627776);
pub const ActivityIdleSystemSleepDisabled: Self = Self(1048576);
pub const ActivityLatencyCritical: Self = Self(1095216660480);
pub const ActivitySuddenTerminationDisabled: Self = Self(16384);
pub const ActivityUserInitiated: Self = Self(16777215);
pub const ActivityUserInitiatedAllowingIdleSystemSleep: Self = Self(15728639);
pub(crate) const fn from_system_raw(value: u64) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> u64 {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
const VALID_BITS: u64 = 2194745065471;
self.0 & !VALID_BITS == 0
}
#[must_use]
pub const fn from_bits(value: u64) -> Option<Self> {
let value = Self(value);
if value.is_valid() { Some(value) } else { None }
}
}
impl std::ops::BitOr for ActivityOptions {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl std::ops::BitAnd for ActivityOptions {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct ComparisonResult(isize);
impl ComparisonResult {
pub const OrderedAscending: Self = Self(-1);
pub const OrderedDescending: Self = Self(0);
pub const OrderedSame: Self = Self(1);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, -1..=1)
}
}
impl std::convert::TryFrom<isize> for ComparisonResult {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct ProcessInfoThermalState(isize);
impl ProcessInfoThermalState {
pub const ProcessInfoThermalStateCritical: Self = Self(3);
pub const ProcessInfoThermalStateFair: Self = Self(1);
pub const ProcessInfoThermalStateNominal: Self = Self(0);
pub const ProcessInfoThermalStateSerious: Self = Self(2);
pub(crate) const fn from_system_raw(value: isize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> isize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(self.0, 0..=3)
}
}
impl std::convert::TryFrom<isize> for ProcessInfoThermalState {
type Error = ();
fn try_from(value: isize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct StringCompareOptions(usize);
impl StringCompareOptions {
pub const AnchoredSearch: Self = Self(8);
pub const BackwardsSearch: Self = Self(4);
pub const CaseInsensitiveSearch: Self = Self(1);
pub const DiacriticInsensitiveSearch: Self = Self(128);
pub const ForcedOrderingSearch: Self = Self(512);
pub const LiteralSearch: Self = Self(2);
pub const NumericSearch: Self = Self(64);
pub const RegularExpressionSearch: Self = Self(1024);
pub const WidthInsensitiveSearch: Self = Self(256);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
const VALID_BITS: usize = 1999;
self.0 & !VALID_BITS == 0
}
#[must_use]
pub const fn from_bits(value: usize) -> Option<Self> {
let value = Self(value);
if value.is_valid() { Some(value) } else { None }
}
}
impl std::ops::BitOr for StringCompareOptions {
type Output = Self;
fn bitor(self, other: Self) -> Self {
Self(self.0 | other.0)
}
}
impl std::ops::BitAnd for StringCompareOptions {
type Output = Self;
fn bitand(self, other: Self) -> Self {
Self(self.0 & other.0)
}
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct StringEncoding(usize);
impl StringEncoding {
pub const ASCIIStringEncoding: Self = Self(1);
pub const ISO2022JPStringEncoding: Self = Self(21);
pub const ISOLatin1StringEncoding: Self = Self(5);
pub const ISOLatin2StringEncoding: Self = Self(9);
pub const JapaneseEUCStringEncoding: Self = Self(3);
pub const MacOSRomanStringEncoding: Self = Self(30);
pub const NEXTSTEPStringEncoding: Self = Self(2);
pub const NonLossyASCIIStringEncoding: Self = Self(7);
pub const ShiftJISStringEncoding: Self = Self(8);
pub const SymbolStringEncoding: Self = Self(6);
pub const UTF16BigEndianStringEncoding: Self = Self(2415919360);
pub const UTF16LittleEndianStringEncoding: Self = Self(2483028224);
pub const UTF16StringEncoding: Self = Self(10);
pub const UTF32BigEndianStringEncoding: Self = Self(2550137088);
pub const UTF32LittleEndianStringEncoding: Self = Self(2617245952);
pub const UTF32StringEncoding: Self = Self(2348810496);
pub const UTF8StringEncoding: Self = Self(4);
pub const UnicodeStringEncoding: Self = Self(10);
pub const WindowsCP1250StringEncoding: Self = Self(15);
pub const WindowsCP1251StringEncoding: Self = Self(11);
pub const WindowsCP1252StringEncoding: Self = Self(12);
pub const WindowsCP1253StringEncoding: Self = Self(13);
pub const WindowsCP1254StringEncoding: Self = Self(14);
pub(crate) const fn from_system_raw(value: usize) -> Self {
Self(value)
}
#[must_use]
pub const fn as_raw(self) -> usize {
self.0
}
#[must_use]
pub const fn is_valid(self) -> bool {
matches!(
self.0,
1..=15 | 21 | 30 | 2348810496 | 2415919360 | 2483028224 | 2550137088 | 2617245952
)
}
}
impl std::convert::TryFrom<usize> for StringEncoding {
type Error = ();
fn try_from(value: usize) -> Result<Self, Self::Error> {
let value = Self(value);
if value.is_valid() { Ok(value) } else { Err(()) }
}
}