diff --git a/Changelog.md b/Changelog.md index 8b4d5d14c..bfcd58b20 100644 --- a/Changelog.md +++ b/Changelog.md @@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added `load_with()` function on `Device` and `Instance` for providing custom `get_xxx_proc_addr()` implementations (#846) - Added `Send`/`Sync` to all Vulkan structs (#869) - Added `VK_KHR_dynamic_rendering_local_read` device extension (#888) +- Added `VK_KHR_line_rasterization` device extension (#889) ### Changed diff --git a/ash/src/extensions/khr/line_rasterization.rs b/ash/src/extensions/khr/line_rasterization.rs new file mode 100644 index 000000000..14e02dfb7 --- /dev/null +++ b/ash/src/extensions/khr/line_rasterization.rs @@ -0,0 +1,39 @@ +//! + +use crate::vk; +use core::mem; +pub use vk::khr::line_rasterization::NAME; + +#[derive(Clone)] +pub struct Device { + fp: vk::khr::line_rasterization::DeviceFn, +} + +impl Device { + pub fn new(instance: &crate::Instance, device: &crate::Device) -> Self { + let fp = vk::khr::line_rasterization::DeviceFn::load(|name| unsafe { + mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr())) + }); + Self { fp } + } + + /// + #[inline] + pub unsafe fn cmd_set_line_stipple( + &self, + command_buffer: vk::CommandBuffer, + line_stipple_factor: u32, + line_stipple_pattern: u16, + ) { + (self.fp.cmd_set_line_stipple_khr)( + command_buffer, + line_stipple_factor, + line_stipple_pattern, + ) + } + + #[inline] + pub fn fp(&self) -> &vk::khr::line_rasterization::DeviceFn { + &self.fp + } +} diff --git a/ash/src/extensions/khr/mod.rs b/ash/src/extensions/khr/mod.rs index bab6b204e..81ff8a11f 100644 --- a/ash/src/extensions/khr/mod.rs +++ b/ash/src/extensions/khr/mod.rs @@ -1,4 +1,3 @@ -pub mod acceleration_structure; pub mod android_surface; pub mod buffer_device_address; pub mod cooperative_matrix; @@ -21,6 +20,7 @@ pub mod external_semaphore_win32; pub mod get_memory_requirements2; pub mod get_physical_device_properties2; pub mod get_surface_capabilities2; +pub mod line_rasterization; pub mod maintenance1; pub mod maintenance3; pub mod maintenance4;