entry: Allow querying enumerate_instance_extension_properties() by layer name (#574)

This commit is contained in:
Michael Pollind 2022-02-19 01:30:35 -08:00 committed by GitHub
parent 955cb28d12
commit 40b572ff3a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- extensions/khr: Drop `_khr` suffix from `get_memory_fd_properties_khr` in `ExternalMemoryFd` (#580)
- entry: Allow querying `enumerate_instance_extension_properties()` by layer name (#574)
### Added

View file

@ -238,11 +238,15 @@ impl Entry {
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkEnumerateInstanceExtensionProperties.html>
pub fn enumerate_instance_extension_properties(
&self,
layer_name: Option<&CStr>,
) -> VkResult<Vec<vk::ExtensionProperties>> {
unsafe {
read_into_uninitialized_vector(|count, data| {
self.entry_fn_1_0
.enumerate_instance_extension_properties(ptr::null(), count, data)
self.entry_fn_1_0.enumerate_instance_extension_properties(
layer_name.map_or(ptr::null(), |str| str.as_ptr()),
count,
data,
)
})
}
}