Skip to content

Commit

Permalink
define enum and bitfield
Browse files Browse the repository at this point in the history
didn't look at the actual type before
  • Loading branch information
0xcaff committed Apr 8, 2024
1 parent 6203251 commit e0cdd65
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
33 changes: 15 additions & 18 deletions vulkano/src/device/physical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3623,28 +3623,25 @@ impl From<ash::vk::ShaderCorePropertiesFlagsAMD> for ShaderCoreProperties {
}
}

#[derive(Clone, Copy, Debug)]
pub struct LayeredDriverUnderlyingApi {
pub value: ash::vk::LayeredDriverUnderlyingApiMSFT,
}
vulkan_enum! {
#[non_exhaustive]

impl From<ash::vk::LayeredDriverUnderlyingApiMSFT> for LayeredDriverUnderlyingApi {
fn from(value: ash::vk::LayeredDriverUnderlyingApiMSFT) -> Self {
Self { value }
}
}
LayeredDriverUnderlyingApi = LayeredDriverUnderlyingApiMSFT(i32);

#[derive(Clone, Debug)]
pub struct PhysicalDeviceSchedulingControlsFlags {
pub value: ash::vk::PhysicalDeviceSchedulingControlsFlagsARM,
// TODO: document
None = NONE,

// TODO: document
D3D12 = D3D12,
}

impl From<ash::vk::PhysicalDeviceSchedulingControlsFlagsARM>
for PhysicalDeviceSchedulingControlsFlags
{
fn from(value: ash::vk::PhysicalDeviceSchedulingControlsFlagsARM) -> Self {
Self { value }
}
vulkan_bitflags! {
#[non_exhaustive]

PhysicalDeviceSchedulingControlsFlags = PhysicalDeviceSchedulingControlsFlagsARM(u64);

// todo: document
SHADER_CORE_COUNT = SHADER_CORE_COUNT,
}

vulkan_bitflags! {
Expand Down
2 changes: 1 addition & 1 deletion vulkano/src/device/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ impl FromVulkan<ash::vk::PhysicalDeviceSchedulingControlsFlagsARM>
impl FromVulkan<ash::vk::LayeredDriverUnderlyingApiMSFT> for LayeredDriverUnderlyingApi {
#[inline]
fn from_vulkan(val: ash::vk::LayeredDriverUnderlyingApiMSFT) -> Option<Self> {
Some(val.into())
val.try_into().ok()
}
}

Expand Down

0 comments on commit e0cdd65

Please sign in to comment.