added missing functions to V1_0 traits (#416)
This commit is contained in:
parent
f5e7cfe896
commit
940f84e04a
|
@ -2090,4 +2090,38 @@ impl Device {
|
|||
);
|
||||
granularity
|
||||
}
|
||||
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetDeviceMemoryCommitment.html>"]
|
||||
pub unsafe fn get_device_memory_commitment(&self, memory: vk::DeviceMemory) -> vk::DeviceSize {
|
||||
let mut committed_memory_in_bytes = 0;
|
||||
self.device_fn_1_0.get_device_memory_commitment(
|
||||
self.handle(),
|
||||
memory,
|
||||
&mut committed_memory_in_bytes,
|
||||
);
|
||||
committed_memory_in_bytes
|
||||
}
|
||||
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetImageSparseMemoryRequirements.html>"]
|
||||
pub unsafe fn get_image_sparse_memory_requirements(
|
||||
&self,
|
||||
image: vk::Image,
|
||||
) -> Vec<vk::SparseImageMemoryRequirements> {
|
||||
let mut count = 0;
|
||||
self.device_fn_1_0.get_image_sparse_memory_requirements(
|
||||
self.handle(),
|
||||
image,
|
||||
&mut count,
|
||||
ptr::null_mut(),
|
||||
);
|
||||
let mut data = Vec::with_capacity(count as usize);
|
||||
self.device_fn_1_0.get_image_sparse_memory_requirements(
|
||||
self.handle(),
|
||||
image,
|
||||
&mut count,
|
||||
data.as_mut_ptr(),
|
||||
);
|
||||
data.set_len(count as usize);
|
||||
data
|
||||
}
|
||||
}
|
||||
|
|
|
@ -413,4 +413,61 @@ impl Instance {
|
|||
data.set_len(num as usize);
|
||||
err_code.result_with_success(data)
|
||||
}
|
||||
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkEnumerateDeviceLayerProperties.html>"]
|
||||
pub unsafe fn enumerate_device_layer_properties(
|
||||
&self,
|
||||
device: vk::PhysicalDevice,
|
||||
) -> VkResult<Vec<vk::LayerProperties>> {
|
||||
let mut count = 0;
|
||||
self.instance_fn_1_0
|
||||
.enumerate_device_layer_properties(device, &mut count, ptr::null_mut())
|
||||
.result()?;
|
||||
let mut data = Vec::with_capacity(count as usize);
|
||||
let err_code = self.instance_fn_1_0.enumerate_device_layer_properties(
|
||||
device,
|
||||
&mut count,
|
||||
data.as_mut_ptr(),
|
||||
);
|
||||
data.set_len(count as usize);
|
||||
err_code.result_with_success(data)
|
||||
}
|
||||
|
||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceSparseImageFormatProperties.html>"]
|
||||
pub unsafe fn get_physical_device_sparse_image_format_properties(
|
||||
&self,
|
||||
physical_device: vk::PhysicalDevice,
|
||||
format: vk::Format,
|
||||
typ: vk::ImageType,
|
||||
samples: vk::SampleCountFlags,
|
||||
usage: vk::ImageUsageFlags,
|
||||
tiling: vk::ImageTiling,
|
||||
) -> Vec<vk::SparseImageFormatProperties> {
|
||||
let mut count = 0;
|
||||
self.instance_fn_1_0
|
||||
.get_physical_device_sparse_image_format_properties(
|
||||
physical_device,
|
||||
format,
|
||||
typ,
|
||||
samples,
|
||||
usage,
|
||||
tiling,
|
||||
&mut count,
|
||||
ptr::null_mut(),
|
||||
);
|
||||
let mut data = Vec::with_capacity(count as usize);
|
||||
self.instance_fn_1_0
|
||||
.get_physical_device_sparse_image_format_properties(
|
||||
physical_device,
|
||||
format,
|
||||
typ,
|
||||
samples,
|
||||
usage,
|
||||
tiling,
|
||||
&mut count,
|
||||
data.as_mut_ptr(),
|
||||
);
|
||||
data.set_len(count as usize);
|
||||
data
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue