-
Notifications
You must be signed in to change notification settings - Fork 192
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_video_encode_queue
- Loading branch information
Showing
4 changed files
with
162 additions
and
40 deletions.
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
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,58 @@ | ||
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_video_encode_queue.html> | ||
use crate::prelude::*; | ||
use crate::vk; | ||
|
||
impl crate::khr::video_encode_queue::Device { | ||
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdEncodeVideoKHR.html> | ||
#[doc(alias = "vkCmdEncodeVideoKHR")] | ||
#[inline] | ||
pub unsafe fn cmd_encode_video( | ||
&self, | ||
command_buffer: vk::CommandBuffer, | ||
encode_info: &vk::VideoEncodeInfoKHR<'_>, | ||
) { | ||
(self.fp.cmd_encode_video_khr)(command_buffer, encode_info); | ||
} | ||
|
||
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetEncodedVideoSessionParametersKHR.html> | ||
#[doc(alias = "vkGetEncodedVideoSessionParametersKHR")] | ||
#[inline] | ||
pub unsafe fn get_encoded_video_session_parameters( | ||
&self, | ||
session_parameters_info: &vk::VideoEncodeSessionParametersGetInfoKHR<'_>, | ||
info: &mut vk::VideoEncodeSessionParametersFeedbackInfoKHR<'_>, | ||
) -> VkResult<Vec<u8>> { | ||
let ptr: *mut _ = info; | ||
read_into_uninitialized_vector(|count, data: *mut u8| { | ||
(self.fp.get_encoded_video_session_parameters_khr)( | ||
self.handle, | ||
session_parameters_info, | ||
ptr, | ||
count, | ||
data.cast(), | ||
) | ||
}) | ||
} | ||
} | ||
|
||
impl crate::khr::video_encode_queue::Instance { | ||
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR.html> | ||
#[doc(alias = "vkGetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR")] | ||
#[inline] | ||
pub unsafe fn get_physical_device_video_encode_quality_level_properties( | ||
&self, | ||
physical_device: vk::PhysicalDevice, | ||
quality_level_info: &vk::PhysicalDeviceVideoEncodeQualityLevelInfoKHR<'_>, | ||
quality_level_properties: &mut vk::VideoEncodeQualityLevelPropertiesKHR<'_>, | ||
) -> VkResult<()> { | ||
(self | ||
.fp | ||
.get_physical_device_video_encode_quality_level_properties_khr)( | ||
physical_device, | ||
quality_level_info, | ||
quality_level_properties, | ||
) | ||
.result() | ||
} | ||
} |
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