-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extensions/khr: Add VK_KHR_line_rasterization extension
- Loading branch information
Showing
3 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_line_rasterization.html> | ||
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 } | ||
} | ||
|
||
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetLineStippleKHR.html> | ||
#[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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters