extensions/ext: Add VK_EXT_image_drm_format_modifier (#603)
This commit is contained in:
parent
cc0e70e8e4
commit
22313c2fe6
|
@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- Update Vulkan-Headers to 1.3.211 (#605, #608)
|
- Update Vulkan-Headers to 1.3.211 (#605, #608)
|
||||||
|
- Added `VK_EXT_image_drm_format_modifier` device extension (#603)
|
||||||
|
|
||||||
## [0.37.0] - 2022-03-23
|
## [0.37.0] - 2022-03-23
|
||||||
|
|
||||||
|
|
44
ash/src/extensions/ext/image_drm_format_modifier.rs
Normal file
44
ash/src/extensions/ext/image_drm_format_modifier.rs
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
use crate::prelude::*;
|
||||||
|
use crate::vk;
|
||||||
|
use crate::{Device, Instance};
|
||||||
|
use std::ffi::CStr;
|
||||||
|
use std::mem;
|
||||||
|
|
||||||
|
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VK_EXT_image_drm_format_modifier.html>
|
||||||
|
#[derive(Clone)]
|
||||||
|
pub struct ImageDrmFormatModifier {
|
||||||
|
handle: vk::Device,
|
||||||
|
fp: vk::ExtImageDrmFormatModifierFn,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ImageDrmFormatModifier {
|
||||||
|
pub fn new(instance: &Instance, device: &Device) -> Self {
|
||||||
|
let handle = device.handle();
|
||||||
|
let fp = vk::ExtImageDrmFormatModifierFn::load(|name| unsafe {
|
||||||
|
mem::transmute(instance.get_device_proc_addr(handle, name.as_ptr()))
|
||||||
|
});
|
||||||
|
Self { handle, fp }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetImageDrmFormatModifierPropertiesEXT.html>
|
||||||
|
pub unsafe fn get_image_drm_format_modifier_properties(
|
||||||
|
&self,
|
||||||
|
image: vk::Image,
|
||||||
|
properties: &mut vk::ImageDrmFormatModifierPropertiesEXT,
|
||||||
|
) -> VkResult<()> {
|
||||||
|
(self.fp.get_image_drm_format_modifier_properties_ext)(self.handle, image, properties)
|
||||||
|
.result()
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const fn name() -> &'static CStr {
|
||||||
|
vk::ExtImageDrmFormatModifierFn::name()
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn fp(&self) -> &vk::ExtImageDrmFormatModifierFn {
|
||||||
|
&self.fp
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn device(&self) -> vk::Device {
|
||||||
|
self.handle
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,6 +9,7 @@ pub use self::extended_dynamic_state::ExtendedDynamicState;
|
||||||
pub use self::extended_dynamic_state2::ExtendedDynamicState2;
|
pub use self::extended_dynamic_state2::ExtendedDynamicState2;
|
||||||
pub use self::full_screen_exclusive::FullScreenExclusive;
|
pub use self::full_screen_exclusive::FullScreenExclusive;
|
||||||
pub use self::headless_surface::HeadlessSurface;
|
pub use self::headless_surface::HeadlessSurface;
|
||||||
|
pub use self::image_drm_format_modifier::ImageDrmFormatModifier;
|
||||||
pub use self::metal_surface::MetalSurface;
|
pub use self::metal_surface::MetalSurface;
|
||||||
pub use self::physical_device_drm::PhysicalDeviceDrm;
|
pub use self::physical_device_drm::PhysicalDeviceDrm;
|
||||||
pub use self::private_data::PrivateData;
|
pub use self::private_data::PrivateData;
|
||||||
|
@ -25,6 +26,7 @@ mod extended_dynamic_state;
|
||||||
mod extended_dynamic_state2;
|
mod extended_dynamic_state2;
|
||||||
mod full_screen_exclusive;
|
mod full_screen_exclusive;
|
||||||
mod headless_surface;
|
mod headless_surface;
|
||||||
|
mod image_drm_format_modifier;
|
||||||
mod metal_surface;
|
mod metal_surface;
|
||||||
mod physical_device_drm;
|
mod physical_device_drm;
|
||||||
mod private_data;
|
mod private_data;
|
||||||
|
|
Loading…
Reference in a new issue