Omit wrapper functions on Fp structs (#599)
* Omit wrapper functions on Fp structs These wrappers contributed thousands of lines of code but offered insignificant ergonomic benefit as the same functions are also wrapped at a higher level and, if necessary, wrapper functions can be called directly. * Standardize on direct fp table access in wrapper functions
This commit is contained in:
parent
1cd810653c
commit
84cddb7383
|
@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
## Unreleased
|
||||
|
||||
- Dropped auto-generated wrapper methods from function pointer structs
|
||||
in favor of direct invocation of function pointers (#599)
|
||||
|
||||
### Added
|
||||
|
||||
- Update Vulkan-Headers to 1.3.208 (#597)
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -144,7 +144,10 @@ impl Entry {
|
|||
/// Vulkan 1.0, which must remain valid for at least the lifetime of the returned [`Entry`].
|
||||
pub unsafe fn from_static_fn(static_fn: vk::StaticFn) -> Self {
|
||||
let load_fn = |name: &std::ffi::CStr| {
|
||||
mem::transmute(static_fn.get_instance_proc_addr(vk::Instance::null(), name.as_ptr()))
|
||||
mem::transmute((static_fn.get_instance_proc_addr)(
|
||||
vk::Instance::null(),
|
||||
name.as_ptr(),
|
||||
))
|
||||
};
|
||||
let entry_fn_1_0 = vk::EntryFnV1_0::load(load_fn);
|
||||
let entry_fn_1_1 = vk::EntryFnV1_1::load(load_fn);
|
||||
|
@ -192,10 +195,10 @@ impl Entry {
|
|||
let mut api_version = 0;
|
||||
let enumerate_instance_version: Option<vk::PFN_vkEnumerateInstanceVersion> = {
|
||||
let name = b"vkEnumerateInstanceVersion\0".as_ptr() as *const _;
|
||||
mem::transmute(
|
||||
self.static_fn
|
||||
.get_instance_proc_addr(vk::Instance::null(), name),
|
||||
)
|
||||
mem::transmute((self.static_fn.get_instance_proc_addr)(
|
||||
vk::Instance::null(),
|
||||
name,
|
||||
))
|
||||
};
|
||||
if let Some(enumerate_instance_version) = enumerate_instance_version {
|
||||
(enumerate_instance_version)(&mut api_version)
|
||||
|
@ -218,13 +221,12 @@ impl Entry {
|
|||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<Instance> {
|
||||
let mut instance = mem::zeroed();
|
||||
self.entry_fn_1_0
|
||||
.create_instance(
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut instance,
|
||||
)
|
||||
.result()?;
|
||||
(self.entry_fn_1_0.create_instance)(
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut instance,
|
||||
)
|
||||
.result()?;
|
||||
Ok(Instance::load(&self.static_fn, instance))
|
||||
}
|
||||
|
||||
|
@ -232,8 +234,7 @@ impl Entry {
|
|||
pub fn enumerate_instance_layer_properties(&self) -> VkResult<Vec<vk::LayerProperties>> {
|
||||
unsafe {
|
||||
read_into_uninitialized_vector(|count, data| {
|
||||
self.entry_fn_1_0
|
||||
.enumerate_instance_layer_properties(count, data)
|
||||
(self.entry_fn_1_0.enumerate_instance_layer_properties)(count, data)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -245,7 +246,7 @@ impl Entry {
|
|||
) -> VkResult<Vec<vk::ExtensionProperties>> {
|
||||
unsafe {
|
||||
read_into_uninitialized_vector(|count, data| {
|
||||
self.entry_fn_1_0.enumerate_instance_extension_properties(
|
||||
(self.entry_fn_1_0.enumerate_instance_extension_properties)(
|
||||
layer_name.map_or(ptr::null(), |str| str.as_ptr()),
|
||||
count,
|
||||
data,
|
||||
|
@ -260,7 +261,7 @@ impl Entry {
|
|||
instance: vk::Instance,
|
||||
p_name: *const c_char,
|
||||
) -> vk::PFN_vkVoidFunction {
|
||||
self.static_fn.get_instance_proc_addr(instance, p_name)
|
||||
(self.static_fn.get_instance_proc_addr)(instance, p_name)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -278,8 +279,7 @@ impl Entry {
|
|||
pub fn enumerate_instance_version(&self) -> VkResult<u32> {
|
||||
unsafe {
|
||||
let mut api_version = 0;
|
||||
self.entry_fn_1_1
|
||||
.enumerate_instance_version(&mut api_version)
|
||||
(self.entry_fn_1_1.enumerate_instance_version)(&mut api_version)
|
||||
.result_with_success(api_version)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ impl BufferDeviceAddress {
|
|||
&self,
|
||||
info: &vk::BufferDeviceAddressInfoEXT,
|
||||
) -> vk::DeviceAddress {
|
||||
self.fp.get_buffer_device_address_ext(self.handle, info)
|
||||
(self.fp.get_buffer_device_address_ext)(self.handle, info)
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -25,8 +25,11 @@ impl CalibratedTimestamps {
|
|||
physical_device: vk::PhysicalDevice,
|
||||
) -> VkResult<Vec<vk::TimeDomainEXT>> {
|
||||
read_into_uninitialized_vector(|count, data| {
|
||||
self.fp
|
||||
.get_physical_device_calibrateable_time_domains_ext(physical_device, count, data)
|
||||
(self.fp.get_physical_device_calibrateable_time_domains_ext)(
|
||||
physical_device,
|
||||
count,
|
||||
data,
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -40,15 +43,14 @@ impl CalibratedTimestamps {
|
|||
) -> VkResult<(Vec<u64>, Vec<u64>)> {
|
||||
let mut timestamps = vec![0u64; info.len()];
|
||||
let mut max_deviation = vec![0u64; info.len()];
|
||||
self.fp
|
||||
.get_calibrated_timestamps_ext(
|
||||
device,
|
||||
info.len() as u32,
|
||||
info.as_ptr(),
|
||||
timestamps.as_mut_ptr(),
|
||||
max_deviation.as_mut_ptr(),
|
||||
)
|
||||
.result_with_success((timestamps, max_deviation))
|
||||
(self.fp.get_calibrated_timestamps_ext)(
|
||||
device,
|
||||
info.len() as u32,
|
||||
info.as_ptr(),
|
||||
timestamps.as_mut_ptr(),
|
||||
max_deviation.as_mut_ptr(),
|
||||
)
|
||||
.result_with_success((timestamps, max_deviation))
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -24,9 +24,7 @@ impl DebugMarker {
|
|||
&self,
|
||||
name_info: &vk::DebugMarkerObjectNameInfoEXT,
|
||||
) -> VkResult<()> {
|
||||
self.fp
|
||||
.debug_marker_set_object_name_ext(self.handle, name_info)
|
||||
.result()
|
||||
(self.fp.debug_marker_set_object_name_ext)(self.handle, name_info).result()
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDebugMarkerBeginEXT.html>
|
||||
|
@ -35,13 +33,12 @@ impl DebugMarker {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
marker_info: &vk::DebugMarkerMarkerInfoEXT,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_debug_marker_begin_ext(command_buffer, marker_info);
|
||||
(self.fp.cmd_debug_marker_begin_ext)(command_buffer, marker_info);
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDebugMarkerEndEXT.html>
|
||||
pub unsafe fn cmd_debug_marker_end(&self, command_buffer: vk::CommandBuffer) {
|
||||
self.fp.cmd_debug_marker_end_ext(command_buffer);
|
||||
(self.fp.cmd_debug_marker_end_ext)(command_buffer);
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDebugMarkerInsertEXT.html>
|
||||
|
@ -50,8 +47,7 @@ impl DebugMarker {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
marker_info: &vk::DebugMarkerMarkerInfoEXT,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_debug_marker_insert_ext(command_buffer, marker_info);
|
||||
(self.fp.cmd_debug_marker_insert_ext)(command_buffer, marker_info);
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -26,7 +26,7 @@ impl DebugReport {
|
|||
debug: vk::DebugReportCallbackEXT,
|
||||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) {
|
||||
self.fp.destroy_debug_report_callback_ext(
|
||||
(self.fp.destroy_debug_report_callback_ext)(
|
||||
self.handle,
|
||||
debug,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
|
@ -40,14 +40,13 @@ impl DebugReport {
|
|||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<vk::DebugReportCallbackEXT> {
|
||||
let mut debug_cb = mem::zeroed();
|
||||
self.fp
|
||||
.create_debug_report_callback_ext(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut debug_cb,
|
||||
)
|
||||
.result_with_success(debug_cb)
|
||||
(self.fp.create_debug_report_callback_ext)(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut debug_cb,
|
||||
)
|
||||
.result_with_success(debug_cb)
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -25,9 +25,7 @@ impl DebugUtils {
|
|||
device: vk::Device,
|
||||
name_info: &vk::DebugUtilsObjectNameInfoEXT,
|
||||
) -> VkResult<()> {
|
||||
self.fp
|
||||
.set_debug_utils_object_name_ext(device, name_info)
|
||||
.result()
|
||||
(self.fp.set_debug_utils_object_name_ext)(device, name_info).result()
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkSetDebugUtilsObjectTagEXT.html>
|
||||
|
@ -36,9 +34,7 @@ impl DebugUtils {
|
|||
device: vk::Device,
|
||||
tag_info: &vk::DebugUtilsObjectTagInfoEXT,
|
||||
) -> VkResult<()> {
|
||||
self.fp
|
||||
.set_debug_utils_object_tag_ext(device, tag_info)
|
||||
.result()
|
||||
(self.fp.set_debug_utils_object_tag_ext)(device, tag_info).result()
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBeginDebugUtilsLabelEXT.html>
|
||||
|
@ -47,13 +43,12 @@ impl DebugUtils {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
label: &vk::DebugUtilsLabelEXT,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_begin_debug_utils_label_ext(command_buffer, label);
|
||||
(self.fp.cmd_begin_debug_utils_label_ext)(command_buffer, label);
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdEndDebugUtilsLabelEXT.html>
|
||||
pub unsafe fn cmd_end_debug_utils_label(&self, command_buffer: vk::CommandBuffer) {
|
||||
self.fp.cmd_end_debug_utils_label_ext(command_buffer);
|
||||
(self.fp.cmd_end_debug_utils_label_ext)(command_buffer);
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdInsertDebugUtilsLabelEXT.html>
|
||||
|
@ -62,8 +57,7 @@ impl DebugUtils {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
label: &vk::DebugUtilsLabelEXT,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_insert_debug_utils_label_ext(command_buffer, label);
|
||||
(self.fp.cmd_insert_debug_utils_label_ext)(command_buffer, label);
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueueBeginDebugUtilsLabelEXT.html>
|
||||
|
@ -72,12 +66,12 @@ impl DebugUtils {
|
|||
queue: vk::Queue,
|
||||
label: &vk::DebugUtilsLabelEXT,
|
||||
) {
|
||||
self.fp.queue_begin_debug_utils_label_ext(queue, label);
|
||||
(self.fp.queue_begin_debug_utils_label_ext)(queue, label);
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueueEndDebugUtilsLabelEXT.html>
|
||||
pub unsafe fn queue_end_debug_utils_label(&self, queue: vk::Queue) {
|
||||
self.fp.queue_end_debug_utils_label_ext(queue);
|
||||
(self.fp.queue_end_debug_utils_label_ext)(queue);
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueueInsertDebugUtilsLabelEXT.html>
|
||||
|
@ -86,7 +80,7 @@ impl DebugUtils {
|
|||
queue: vk::Queue,
|
||||
label: &vk::DebugUtilsLabelEXT,
|
||||
) {
|
||||
self.fp.queue_insert_debug_utils_label_ext(queue, label);
|
||||
(self.fp.queue_insert_debug_utils_label_ext)(queue, label);
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateDebugUtilsMessengerEXT.html>
|
||||
|
@ -96,14 +90,13 @@ impl DebugUtils {
|
|||
allocator: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<vk::DebugUtilsMessengerEXT> {
|
||||
let mut messenger = mem::zeroed();
|
||||
self.fp
|
||||
.create_debug_utils_messenger_ext(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocator.as_raw_ptr(),
|
||||
&mut messenger,
|
||||
)
|
||||
.result_with_success(messenger)
|
||||
(self.fp.create_debug_utils_messenger_ext)(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocator.as_raw_ptr(),
|
||||
&mut messenger,
|
||||
)
|
||||
.result_with_success(messenger)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyDebugUtilsMessengerEXT.html>
|
||||
|
@ -112,8 +105,7 @@ impl DebugUtils {
|
|||
messenger: vk::DebugUtilsMessengerEXT,
|
||||
allocator: Option<&vk::AllocationCallbacks>,
|
||||
) {
|
||||
self.fp
|
||||
.destroy_debug_utils_messenger_ext(self.handle, messenger, allocator.as_raw_ptr());
|
||||
(self.fp.destroy_debug_utils_messenger_ext)(self.handle, messenger, allocator.as_raw_ptr());
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkSubmitDebugUtilsMessageEXT.html>
|
||||
|
@ -123,7 +115,7 @@ impl DebugUtils {
|
|||
message_types: vk::DebugUtilsMessageTypeFlagsEXT,
|
||||
callback_data: &vk::DebugUtilsMessengerCallbackDataEXT,
|
||||
) {
|
||||
self.fp.submit_debug_utils_message_ext(
|
||||
(self.fp.submit_debug_utils_message_ext)(
|
||||
self.handle,
|
||||
message_severity,
|
||||
message_types,
|
||||
|
|
|
@ -23,7 +23,7 @@ impl ExtendedDynamicState {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
cull_mode: vk::CullModeFlags,
|
||||
) {
|
||||
self.fp.cmd_set_cull_mode_ext(command_buffer, cull_mode)
|
||||
(self.fp.cmd_set_cull_mode_ext)(command_buffer, cull_mode)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetFrontFaceEXT.html>
|
||||
|
@ -32,7 +32,7 @@ impl ExtendedDynamicState {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
front_face: vk::FrontFace,
|
||||
) {
|
||||
self.fp.cmd_set_front_face_ext(command_buffer, front_face)
|
||||
(self.fp.cmd_set_front_face_ext)(command_buffer, front_face)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetPrimitiveTopologyEXT.html>
|
||||
|
@ -41,8 +41,7 @@ impl ExtendedDynamicState {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
primitive_topology: vk::PrimitiveTopology,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_set_primitive_topology_ext(command_buffer, primitive_topology)
|
||||
(self.fp.cmd_set_primitive_topology_ext)(command_buffer, primitive_topology)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetViewportWithCountEXT.html>
|
||||
|
@ -51,7 +50,7 @@ impl ExtendedDynamicState {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
viewports: &[vk::Viewport],
|
||||
) {
|
||||
self.fp.cmd_set_viewport_with_count_ext(
|
||||
(self.fp.cmd_set_viewport_with_count_ext)(
|
||||
command_buffer,
|
||||
viewports.len() as u32,
|
||||
viewports.as_ptr(),
|
||||
|
@ -64,7 +63,7 @@ impl ExtendedDynamicState {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
scissors: &[vk::Rect2D],
|
||||
) {
|
||||
self.fp.cmd_set_scissor_with_count_ext(
|
||||
(self.fp.cmd_set_scissor_with_count_ext)(
|
||||
command_buffer,
|
||||
scissors.len() as u32,
|
||||
scissors.as_ptr(),
|
||||
|
@ -94,7 +93,7 @@ impl ExtendedDynamicState {
|
|||
} else {
|
||||
ptr::null()
|
||||
};
|
||||
self.fp.cmd_bind_vertex_buffers2_ext(
|
||||
(self.fp.cmd_bind_vertex_buffers2_ext)(
|
||||
command_buffer,
|
||||
first_binding,
|
||||
buffers.len() as u32,
|
||||
|
@ -111,8 +110,7 @@ impl ExtendedDynamicState {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
depth_test_enable: bool,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_set_depth_test_enable_ext(command_buffer, depth_test_enable.into())
|
||||
(self.fp.cmd_set_depth_test_enable_ext)(command_buffer, depth_test_enable.into())
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthWriteEnableEXT.html>
|
||||
|
@ -121,8 +119,7 @@ impl ExtendedDynamicState {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
depth_write_enable: bool,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_set_depth_write_enable_ext(command_buffer, depth_write_enable.into())
|
||||
(self.fp.cmd_set_depth_write_enable_ext)(command_buffer, depth_write_enable.into())
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthCompareOpEXT.html>
|
||||
|
@ -131,8 +128,7 @@ impl ExtendedDynamicState {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
depth_compare_op: vk::CompareOp,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_set_depth_compare_op_ext(command_buffer, depth_compare_op)
|
||||
(self.fp.cmd_set_depth_compare_op_ext)(command_buffer, depth_compare_op)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthBoundsTestEnableEXT.html>
|
||||
|
@ -141,8 +137,10 @@ impl ExtendedDynamicState {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
depth_bounds_test_enable: bool,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_set_depth_bounds_test_enable_ext(command_buffer, depth_bounds_test_enable.into())
|
||||
(self.fp.cmd_set_depth_bounds_test_enable_ext)(
|
||||
command_buffer,
|
||||
depth_bounds_test_enable.into(),
|
||||
)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetStencilTestEnableEXT.html>
|
||||
|
@ -151,8 +149,7 @@ impl ExtendedDynamicState {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
stencil_test_enable: bool,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_set_stencil_test_enable_ext(command_buffer, stencil_test_enable.into())
|
||||
(self.fp.cmd_set_stencil_test_enable_ext)(command_buffer, stencil_test_enable.into())
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetStencilOpEXT.html>
|
||||
|
@ -165,7 +162,7 @@ impl ExtendedDynamicState {
|
|||
depth_fail_op: vk::StencilOp,
|
||||
compare_op: vk::CompareOp,
|
||||
) {
|
||||
self.fp.cmd_set_stencil_op_ext(
|
||||
(self.fp.cmd_set_stencil_op_ext)(
|
||||
command_buffer,
|
||||
face_mask,
|
||||
fail_op,
|
||||
|
|
|
@ -23,8 +23,7 @@ impl ExtendedDynamicState2 {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
patch_control_points: u32,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_set_patch_control_points_ext(command_buffer, patch_control_points)
|
||||
(self.fp.cmd_set_patch_control_points_ext)(command_buffer, patch_control_points)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetRasterizerDiscardEnableEXT.html>
|
||||
|
@ -33,8 +32,10 @@ impl ExtendedDynamicState2 {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
rasterizer_discard_enable: bool,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_set_rasterizer_discard_enable_ext(command_buffer, rasterizer_discard_enable.into())
|
||||
(self.fp.cmd_set_rasterizer_discard_enable_ext)(
|
||||
command_buffer,
|
||||
rasterizer_discard_enable.into(),
|
||||
)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthBiasEnableEXT.html>
|
||||
|
@ -43,8 +44,7 @@ impl ExtendedDynamicState2 {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
depth_bias_enable: bool,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_set_depth_bias_enable_ext(command_buffer, depth_bias_enable.into())
|
||||
(self.fp.cmd_set_depth_bias_enable_ext)(command_buffer, depth_bias_enable.into())
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetLogicOpEXT.html>
|
||||
|
@ -53,7 +53,7 @@ impl ExtendedDynamicState2 {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
logic_op: vk::LogicOp,
|
||||
) {
|
||||
self.fp.cmd_set_logic_op_ext(command_buffer, logic_op)
|
||||
(self.fp.cmd_set_logic_op_ext)(command_buffer, logic_op)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetPrimitiveRestartEnableEXT.html>
|
||||
|
@ -62,8 +62,10 @@ impl ExtendedDynamicState2 {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
primitive_restart_enable: bool,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_set_primitive_restart_enable_ext(command_buffer, primitive_restart_enable.into())
|
||||
(self.fp.cmd_set_primitive_restart_enable_ext)(
|
||||
command_buffer,
|
||||
primitive_restart_enable.into(),
|
||||
)
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -24,9 +24,7 @@ impl FullScreenExclusive {
|
|||
&self,
|
||||
swapchain: vk::SwapchainKHR,
|
||||
) -> VkResult<()> {
|
||||
self.fp
|
||||
.acquire_full_screen_exclusive_mode_ext(self.handle, swapchain)
|
||||
.result()
|
||||
(self.fp.acquire_full_screen_exclusive_mode_ext)(self.handle, swapchain).result()
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSurfacePresentModes2EXT.html>
|
||||
|
@ -36,7 +34,7 @@ impl FullScreenExclusive {
|
|||
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR,
|
||||
) -> VkResult<Vec<vk::PresentModeKHR>> {
|
||||
read_into_uninitialized_vector(|count, data| {
|
||||
self.fp.get_physical_device_surface_present_modes2_ext(
|
||||
(self.fp.get_physical_device_surface_present_modes2_ext)(
|
||||
physical_device,
|
||||
surface_info,
|
||||
count,
|
||||
|
@ -50,9 +48,7 @@ impl FullScreenExclusive {
|
|||
&self,
|
||||
swapchain: vk::SwapchainKHR,
|
||||
) -> VkResult<()> {
|
||||
self.fp
|
||||
.release_full_screen_exclusive_mode_ext(self.handle, swapchain)
|
||||
.result()
|
||||
(self.fp.release_full_screen_exclusive_mode_ext)(self.handle, swapchain).result()
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceGroupSurfacePresentModes2EXT.html>
|
||||
|
@ -61,13 +57,12 @@ impl FullScreenExclusive {
|
|||
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR,
|
||||
) -> VkResult<vk::DeviceGroupPresentModeFlagsKHR> {
|
||||
let mut present_modes = mem::zeroed();
|
||||
self.fp
|
||||
.get_device_group_surface_present_modes2_ext(
|
||||
self.handle,
|
||||
surface_info,
|
||||
&mut present_modes,
|
||||
)
|
||||
.result_with_success(present_modes)
|
||||
(self.fp.get_device_group_surface_present_modes2_ext)(
|
||||
self.handle,
|
||||
surface_info,
|
||||
&mut present_modes,
|
||||
)
|
||||
.result_with_success(present_modes)
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -28,14 +28,13 @@ impl HeadlessSurface {
|
|||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<vk::SurfaceKHR> {
|
||||
let mut surface = mem::zeroed();
|
||||
self.fp
|
||||
.create_headless_surface_ext(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut surface,
|
||||
)
|
||||
.result_with_success(surface)
|
||||
(self.fp.create_headless_surface_ext)(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut surface,
|
||||
)
|
||||
.result_with_success(surface)
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -27,14 +27,13 @@ impl MetalSurface {
|
|||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<vk::SurfaceKHR> {
|
||||
let mut surface = mem::zeroed();
|
||||
self.fp
|
||||
.create_metal_surface_ext(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut surface,
|
||||
)
|
||||
.result_with_success(surface)
|
||||
(self.fp.create_metal_surface_ext)(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut surface,
|
||||
)
|
||||
.result_with_success(surface)
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -28,14 +28,13 @@ impl PrivateData {
|
|||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<vk::PrivateDataSlotEXT> {
|
||||
let mut private_data_slot = mem::zeroed();
|
||||
self.fp
|
||||
.create_private_data_slot_ext(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut private_data_slot,
|
||||
)
|
||||
.result_with_success(private_data_slot)
|
||||
(self.fp.create_private_data_slot_ext)(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut private_data_slot,
|
||||
)
|
||||
.result_with_success(private_data_slot)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyPrivateDataSlotEXT.html>
|
||||
|
@ -44,7 +43,7 @@ impl PrivateData {
|
|||
private_data_slot: vk::PrivateDataSlotEXT,
|
||||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) {
|
||||
self.fp.destroy_private_data_slot_ext(
|
||||
(self.fp.destroy_private_data_slot_ext)(
|
||||
self.handle,
|
||||
private_data_slot,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
|
@ -58,15 +57,14 @@ impl PrivateData {
|
|||
private_data_slot: vk::PrivateDataSlotEXT,
|
||||
data: u64,
|
||||
) -> VkResult<()> {
|
||||
self.fp
|
||||
.set_private_data_ext(
|
||||
self.handle,
|
||||
T::TYPE,
|
||||
object.as_raw(),
|
||||
private_data_slot,
|
||||
data,
|
||||
)
|
||||
.result()
|
||||
(self.fp.set_private_data_ext)(
|
||||
self.handle,
|
||||
T::TYPE,
|
||||
object.as_raw(),
|
||||
private_data_slot,
|
||||
data,
|
||||
)
|
||||
.result()
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPrivateDataEXT.html>
|
||||
|
@ -76,7 +74,7 @@ impl PrivateData {
|
|||
private_data_slot: vk::PrivateDataSlotEXT,
|
||||
) -> u64 {
|
||||
let mut data = mem::zeroed();
|
||||
self.fp.get_private_data_ext(
|
||||
(self.fp.get_private_data_ext)(
|
||||
self.handle,
|
||||
T::TYPE,
|
||||
object.as_raw(),
|
||||
|
|
|
@ -23,8 +23,7 @@ impl ToolingInfo {
|
|||
physical_device: vk::PhysicalDevice,
|
||||
) -> VkResult<Vec<vk::PhysicalDeviceToolPropertiesEXT>> {
|
||||
read_into_defaulted_vector(|count, data| {
|
||||
self.fp
|
||||
.get_physical_device_tool_properties_ext(physical_device, count, data)
|
||||
(self.fp.get_physical_device_tool_properties_ext)(physical_device, count, data)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -39,14 +39,13 @@ impl AccelerationStructure {
|
|||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<vk::AccelerationStructureKHR> {
|
||||
let mut accel_struct = mem::zeroed();
|
||||
self.fp
|
||||
.create_acceleration_structure_khr(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut accel_struct,
|
||||
)
|
||||
.result_with_success(accel_struct)
|
||||
(self.fp.create_acceleration_structure_khr)(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut accel_struct,
|
||||
)
|
||||
.result_with_success(accel_struct)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyAccelerationStructureKHR.html>
|
||||
|
@ -55,7 +54,7 @@ impl AccelerationStructure {
|
|||
accel_struct: vk::AccelerationStructureKHR,
|
||||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) {
|
||||
self.fp.destroy_acceleration_structure_khr(
|
||||
(self.fp.destroy_acceleration_structure_khr)(
|
||||
self.handle,
|
||||
accel_struct,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
|
@ -80,7 +79,7 @@ impl AccelerationStructure {
|
|||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
self.fp.cmd_build_acceleration_structures_khr(
|
||||
(self.fp.cmd_build_acceleration_structures_khr)(
|
||||
command_buffer,
|
||||
infos.len() as _,
|
||||
infos.as_ptr(),
|
||||
|
@ -110,7 +109,7 @@ impl AccelerationStructure {
|
|||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
self.fp.cmd_build_acceleration_structures_indirect_khr(
|
||||
(self.fp.cmd_build_acceleration_structures_indirect_khr)(
|
||||
command_buffer,
|
||||
infos.len() as _,
|
||||
infos.as_ptr(),
|
||||
|
@ -138,15 +137,14 @@ impl AccelerationStructure {
|
|||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
self.fp
|
||||
.build_acceleration_structures_khr(
|
||||
self.handle,
|
||||
deferred_operation,
|
||||
infos.len() as _,
|
||||
infos.as_ptr(),
|
||||
build_range_infos.as_ptr(),
|
||||
)
|
||||
.result()
|
||||
(self.fp.build_acceleration_structures_khr)(
|
||||
self.handle,
|
||||
deferred_operation,
|
||||
infos.len() as _,
|
||||
infos.as_ptr(),
|
||||
build_range_infos.as_ptr(),
|
||||
)
|
||||
.result()
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCopyAccelerationStructureKHR.html>
|
||||
|
@ -155,9 +153,7 @@ impl AccelerationStructure {
|
|||
deferred_operation: vk::DeferredOperationKHR,
|
||||
info: &vk::CopyAccelerationStructureInfoKHR,
|
||||
) -> VkResult<()> {
|
||||
self.fp
|
||||
.copy_acceleration_structure_khr(self.handle, deferred_operation, info)
|
||||
.result()
|
||||
(self.fp.copy_acceleration_structure_khr)(self.handle, deferred_operation, info).result()
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCopyAccelerationStructureToMemoryKHR.html>
|
||||
|
@ -166,8 +162,7 @@ impl AccelerationStructure {
|
|||
deferred_operation: vk::DeferredOperationKHR,
|
||||
info: &vk::CopyAccelerationStructureToMemoryInfoKHR,
|
||||
) -> VkResult<()> {
|
||||
self.fp
|
||||
.copy_acceleration_structure_to_memory_khr(self.handle, deferred_operation, info)
|
||||
(self.fp.copy_acceleration_structure_to_memory_khr)(self.handle, deferred_operation, info)
|
||||
.result()
|
||||
}
|
||||
|
||||
|
@ -177,8 +172,7 @@ impl AccelerationStructure {
|
|||
deferred_operation: vk::DeferredOperationKHR,
|
||||
info: &vk::CopyMemoryToAccelerationStructureInfoKHR,
|
||||
) -> VkResult<()> {
|
||||
self.fp
|
||||
.copy_memory_to_acceleration_structure_khr(self.handle, deferred_operation, info)
|
||||
(self.fp.copy_memory_to_acceleration_structure_khr)(self.handle, deferred_operation, info)
|
||||
.result()
|
||||
}
|
||||
|
||||
|
@ -190,17 +184,16 @@ impl AccelerationStructure {
|
|||
data: &mut [u8],
|
||||
stride: usize,
|
||||
) -> VkResult<()> {
|
||||
self.fp
|
||||
.write_acceleration_structures_properties_khr(
|
||||
self.handle,
|
||||
acceleration_structures.len() as _,
|
||||
acceleration_structures.as_ptr(),
|
||||
query_type,
|
||||
data.len(),
|
||||
data.as_mut_ptr() as *mut std::ffi::c_void,
|
||||
stride,
|
||||
)
|
||||
.result()
|
||||
(self.fp.write_acceleration_structures_properties_khr)(
|
||||
self.handle,
|
||||
acceleration_structures.len() as _,
|
||||
acceleration_structures.as_ptr(),
|
||||
query_type,
|
||||
data.len(),
|
||||
data.as_mut_ptr() as *mut std::ffi::c_void,
|
||||
stride,
|
||||
)
|
||||
.result()
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyAccelerationStructureKHR.html>
|
||||
|
@ -209,8 +202,7 @@ impl AccelerationStructure {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
info: &vk::CopyAccelerationStructureInfoKHR,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_copy_acceleration_structure_khr(command_buffer, info);
|
||||
(self.fp.cmd_copy_acceleration_structure_khr)(command_buffer, info);
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyAccelerationStructureToMemoryKHR.html>
|
||||
|
@ -219,8 +211,7 @@ impl AccelerationStructure {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
info: &vk::CopyAccelerationStructureToMemoryInfoKHR,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_copy_acceleration_structure_to_memory_khr(command_buffer, info);
|
||||
(self.fp.cmd_copy_acceleration_structure_to_memory_khr)(command_buffer, info);
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyMemoryToAccelerationStructureKHR.html>
|
||||
|
@ -229,8 +220,7 @@ impl AccelerationStructure {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
info: &vk::CopyMemoryToAccelerationStructureInfoKHR,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_copy_memory_to_acceleration_structure_khr(command_buffer, info);
|
||||
(self.fp.cmd_copy_memory_to_acceleration_structure_khr)(command_buffer, info);
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetAccelerationStructureHandleKHR.html>
|
||||
|
@ -238,8 +228,7 @@ impl AccelerationStructure {
|
|||
&self,
|
||||
info: &vk::AccelerationStructureDeviceAddressInfoKHR,
|
||||
) -> vk::DeviceAddress {
|
||||
self.fp
|
||||
.get_acceleration_structure_device_address_khr(self.handle, info)
|
||||
(self.fp.get_acceleration_structure_device_address_khr)(self.handle, info)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdWriteAccelerationStructuresPropertiesKHR.html>
|
||||
|
@ -251,7 +240,7 @@ impl AccelerationStructure {
|
|||
query_pool: vk::QueryPool,
|
||||
first_query: u32,
|
||||
) {
|
||||
self.fp.cmd_write_acceleration_structures_properties_khr(
|
||||
(self.fp.cmd_write_acceleration_structures_properties_khr)(
|
||||
command_buffer,
|
||||
structures.len() as _,
|
||||
structures.as_ptr(),
|
||||
|
@ -268,7 +257,7 @@ impl AccelerationStructure {
|
|||
) -> vk::AccelerationStructureCompatibilityKHR {
|
||||
let mut compatibility = vk::AccelerationStructureCompatibilityKHR::default();
|
||||
|
||||
self.fp.get_device_acceleration_structure_compatibility_khr(
|
||||
(self.fp.get_device_acceleration_structure_compatibility_khr)(
|
||||
self.handle,
|
||||
version,
|
||||
&mut compatibility,
|
||||
|
@ -288,7 +277,7 @@ impl AccelerationStructure {
|
|||
|
||||
let mut size_info = vk::AccelerationStructureBuildSizesInfoKHR::default();
|
||||
|
||||
self.fp.get_acceleration_structure_build_sizes_khr(
|
||||
(self.fp.get_acceleration_structure_build_sizes_khr)(
|
||||
self.handle,
|
||||
build_type,
|
||||
build_info,
|
||||
|
|
|
@ -27,14 +27,13 @@ impl AndroidSurface {
|
|||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<vk::SurfaceKHR> {
|
||||
let mut surface = mem::zeroed();
|
||||
self.fp
|
||||
.create_android_surface_khr(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut surface,
|
||||
)
|
||||
.result_with_success(surface)
|
||||
(self.fp.create_android_surface_khr)(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut surface,
|
||||
)
|
||||
.result_with_success(surface)
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -23,7 +23,7 @@ impl BufferDeviceAddress {
|
|||
&self,
|
||||
info: &vk::BufferDeviceAddressInfoKHR,
|
||||
) -> vk::DeviceAddress {
|
||||
self.fp.get_buffer_device_address_khr(self.handle, info)
|
||||
(self.fp.get_buffer_device_address_khr)(self.handle, info)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetBufferOpaqueCaptureAddressKHR.html>
|
||||
|
@ -31,8 +31,7 @@ impl BufferDeviceAddress {
|
|||
&self,
|
||||
info: &vk::BufferDeviceAddressInfoKHR,
|
||||
) -> u64 {
|
||||
self.fp
|
||||
.get_buffer_opaque_capture_address_khr(self.handle, info)
|
||||
(self.fp.get_buffer_opaque_capture_address_khr)(self.handle, info)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceMemoryOpaqueCaptureAddressKHR.html>
|
||||
|
@ -40,8 +39,7 @@ impl BufferDeviceAddress {
|
|||
&self,
|
||||
info: &vk::DeviceMemoryOpaqueCaptureAddressInfoKHR,
|
||||
) -> u64 {
|
||||
self.fp
|
||||
.get_device_memory_opaque_capture_address_khr(self.handle, info)
|
||||
(self.fp.get_device_memory_opaque_capture_address_khr)(self.handle, info)
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -23,8 +23,7 @@ impl CopyCommands2 {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
copy_buffer_info: &vk::CopyBufferInfo2KHR,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_copy_buffer2_khr(command_buffer, copy_buffer_info)
|
||||
(self.fp.cmd_copy_buffer2_khr)(command_buffer, copy_buffer_info)
|
||||
}
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyImage2KHR.html>
|
||||
pub unsafe fn cmd_copy_image2(
|
||||
|
@ -32,7 +31,7 @@ impl CopyCommands2 {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
copy_image_info: &vk::CopyImageInfo2KHR,
|
||||
) {
|
||||
self.fp.cmd_copy_image2_khr(command_buffer, copy_image_info)
|
||||
(self.fp.cmd_copy_image2_khr)(command_buffer, copy_image_info)
|
||||
}
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyBufferToImage2KHR.html>
|
||||
pub unsafe fn cmd_copy_buffer_to_image2(
|
||||
|
@ -40,8 +39,7 @@ impl CopyCommands2 {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
copy_buffer_to_image_info: &vk::CopyBufferToImageInfo2KHR,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_copy_buffer_to_image2_khr(command_buffer, copy_buffer_to_image_info)
|
||||
(self.fp.cmd_copy_buffer_to_image2_khr)(command_buffer, copy_buffer_to_image_info)
|
||||
}
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyImageToBuffer2KHR.html>
|
||||
pub unsafe fn cmd_copy_image_to_buffer2(
|
||||
|
@ -49,8 +47,7 @@ impl CopyCommands2 {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
copy_image_to_buffer_info: &vk::CopyImageToBufferInfo2KHR,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_copy_image_to_buffer2_khr(command_buffer, copy_image_to_buffer_info)
|
||||
(self.fp.cmd_copy_image_to_buffer2_khr)(command_buffer, copy_image_to_buffer_info)
|
||||
}
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBlitImage2KHR.html>
|
||||
pub unsafe fn cmd_blit_image2(
|
||||
|
@ -58,7 +55,7 @@ impl CopyCommands2 {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
blit_image_info: &vk::BlitImageInfo2KHR,
|
||||
) {
|
||||
self.fp.cmd_blit_image2_khr(command_buffer, blit_image_info)
|
||||
(self.fp.cmd_blit_image2_khr)(command_buffer, blit_image_info)
|
||||
}
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdResolveImage2KHR.html>
|
||||
pub unsafe fn cmd_resolve_image2(
|
||||
|
@ -66,8 +63,7 @@ impl CopyCommands2 {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
resolve_image_info: &vk::ResolveImageInfo2KHR,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_resolve_image2_khr(command_buffer, resolve_image_info)
|
||||
(self.fp.cmd_resolve_image2_khr)(command_buffer, resolve_image_info)
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -27,14 +27,13 @@ impl CreateRenderPass2 {
|
|||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<vk::RenderPass> {
|
||||
let mut renderpass = mem::zeroed();
|
||||
self.fp
|
||||
.create_render_pass2_khr(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut renderpass,
|
||||
)
|
||||
.result_with_success(renderpass)
|
||||
(self.fp.create_render_pass2_khr)(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut renderpass,
|
||||
)
|
||||
.result_with_success(renderpass)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBeginRenderPass2.html>
|
||||
|
@ -44,7 +43,7 @@ impl CreateRenderPass2 {
|
|||
render_pass_begin_info: &vk::RenderPassBeginInfo,
|
||||
subpass_begin_info: &vk::SubpassBeginInfo,
|
||||
) {
|
||||
self.fp.cmd_begin_render_pass2_khr(
|
||||
(self.fp.cmd_begin_render_pass2_khr)(
|
||||
command_buffer,
|
||||
render_pass_begin_info,
|
||||
subpass_begin_info,
|
||||
|
@ -58,8 +57,7 @@ impl CreateRenderPass2 {
|
|||
subpass_begin_info: &vk::SubpassBeginInfo,
|
||||
subpass_end_info: &vk::SubpassEndInfo,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_next_subpass2_khr(command_buffer, subpass_begin_info, subpass_end_info);
|
||||
(self.fp.cmd_next_subpass2_khr)(command_buffer, subpass_begin_info, subpass_end_info);
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdEndRenderPass2.html>
|
||||
|
@ -68,8 +66,7 @@ impl CreateRenderPass2 {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
subpass_end_info: &vk::SubpassEndInfo,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_end_render_pass2_khr(command_buffer, subpass_end_info);
|
||||
(self.fp.cmd_end_render_pass2_khr)(command_buffer, subpass_end_info);
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -26,13 +26,12 @@ impl DeferredHostOperations {
|
|||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<vk::DeferredOperationKHR> {
|
||||
let mut operation = mem::zeroed();
|
||||
self.fp
|
||||
.create_deferred_operation_khr(
|
||||
self.handle,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut operation,
|
||||
)
|
||||
.result_with_success(operation)
|
||||
(self.fp.create_deferred_operation_khr)(
|
||||
self.handle,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut operation,
|
||||
)
|
||||
.result_with_success(operation)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDeferredOperationJoinKHR.html>
|
||||
|
@ -40,9 +39,7 @@ impl DeferredHostOperations {
|
|||
&self,
|
||||
operation: vk::DeferredOperationKHR,
|
||||
) -> VkResult<()> {
|
||||
self.fp
|
||||
.deferred_operation_join_khr(self.handle, operation)
|
||||
.result()
|
||||
(self.fp.deferred_operation_join_khr)(self.handle, operation).result()
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyDeferredOperationKHR.html>
|
||||
|
@ -51,7 +48,7 @@ impl DeferredHostOperations {
|
|||
operation: vk::DeferredOperationKHR,
|
||||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) {
|
||||
self.fp.destroy_deferred_operation_khr(
|
||||
(self.fp.destroy_deferred_operation_khr)(
|
||||
self.handle,
|
||||
operation,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
|
@ -63,8 +60,7 @@ impl DeferredHostOperations {
|
|||
&self,
|
||||
operation: vk::DeferredOperationKHR,
|
||||
) -> u32 {
|
||||
self.fp
|
||||
.get_deferred_operation_max_concurrency_khr(self.handle, operation)
|
||||
(self.fp.get_deferred_operation_max_concurrency_khr)(self.handle, operation)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeferredOperationResultKHR.html>
|
||||
|
@ -72,9 +68,7 @@ impl DeferredHostOperations {
|
|||
&self,
|
||||
operation: vk::DeferredOperationKHR,
|
||||
) -> VkResult<()> {
|
||||
self.fp
|
||||
.get_deferred_operation_result_khr(self.handle, operation)
|
||||
.result()
|
||||
(self.fp.get_deferred_operation_result_khr)(self.handle, operation).result()
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -26,8 +26,7 @@ impl Display {
|
|||
physical_device: vk::PhysicalDevice,
|
||||
) -> VkResult<Vec<vk::DisplayPropertiesKHR>> {
|
||||
read_into_uninitialized_vector(|count, data| {
|
||||
self.fp
|
||||
.get_physical_device_display_properties_khr(physical_device, count, data)
|
||||
(self.fp.get_physical_device_display_properties_khr)(physical_device, count, data)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -37,8 +36,7 @@ impl Display {
|
|||
physical_device: vk::PhysicalDevice,
|
||||
) -> VkResult<Vec<vk::DisplayPlanePropertiesKHR>> {
|
||||
read_into_uninitialized_vector(|count, data| {
|
||||
self.fp
|
||||
.get_physical_device_display_plane_properties_khr(physical_device, count, data)
|
||||
(self.fp.get_physical_device_display_plane_properties_khr)(physical_device, count, data)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -49,7 +47,7 @@ impl Display {
|
|||
plane_index: u32,
|
||||
) -> VkResult<Vec<vk::DisplayKHR>> {
|
||||
read_into_uninitialized_vector(|count, data| {
|
||||
self.fp.get_display_plane_supported_displays_khr(
|
||||
(self.fp.get_display_plane_supported_displays_khr)(
|
||||
physical_device,
|
||||
plane_index,
|
||||
count,
|
||||
|
@ -65,8 +63,7 @@ impl Display {
|
|||
display: vk::DisplayKHR,
|
||||
) -> VkResult<Vec<vk::DisplayModePropertiesKHR>> {
|
||||
read_into_uninitialized_vector(|count, data| {
|
||||
self.fp
|
||||
.get_display_mode_properties_khr(physical_device, display, count, data)
|
||||
(self.fp.get_display_mode_properties_khr)(physical_device, display, count, data)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -79,15 +76,14 @@ impl Display {
|
|||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<vk::DisplayModeKHR> {
|
||||
let mut display_mode = mem::MaybeUninit::zeroed();
|
||||
self.fp
|
||||
.create_display_mode_khr(
|
||||
physical_device,
|
||||
display,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
display_mode.as_mut_ptr(),
|
||||
)
|
||||
.result_with_success(display_mode.assume_init())
|
||||
(self.fp.create_display_mode_khr)(
|
||||
physical_device,
|
||||
display,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
display_mode.as_mut_ptr(),
|
||||
)
|
||||
.result_with_success(display_mode.assume_init())
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDisplayPlaneCapabilitiesKHR.html>
|
||||
|
@ -98,14 +94,13 @@ impl Display {
|
|||
plane_index: u32,
|
||||
) -> VkResult<vk::DisplayPlaneCapabilitiesKHR> {
|
||||
let mut display_plane_capabilities = mem::MaybeUninit::zeroed();
|
||||
self.fp
|
||||
.get_display_plane_capabilities_khr(
|
||||
physical_device,
|
||||
mode,
|
||||
plane_index,
|
||||
display_plane_capabilities.as_mut_ptr(),
|
||||
)
|
||||
.result_with_success(display_plane_capabilities.assume_init())
|
||||
(self.fp.get_display_plane_capabilities_khr)(
|
||||
physical_device,
|
||||
mode,
|
||||
plane_index,
|
||||
display_plane_capabilities.as_mut_ptr(),
|
||||
)
|
||||
.result_with_success(display_plane_capabilities.assume_init())
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateDisplayPlaneSurfaceKHR.html>
|
||||
|
@ -115,14 +110,13 @@ impl Display {
|
|||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<vk::SurfaceKHR> {
|
||||
let mut surface = mem::MaybeUninit::zeroed();
|
||||
self.fp
|
||||
.create_display_plane_surface_khr(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
surface.as_mut_ptr(),
|
||||
)
|
||||
.result_with_success(surface.assume_init())
|
||||
(self.fp.create_display_plane_surface_khr)(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
surface.as_mut_ptr(),
|
||||
)
|
||||
.result_with_success(surface.assume_init())
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -27,7 +27,7 @@ impl DisplaySwapchain {
|
|||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<Vec<vk::SwapchainKHR>> {
|
||||
let mut swapchains = Vec::with_capacity(create_infos.len());
|
||||
let err_code = self.fp.create_shared_swapchains_khr(
|
||||
let err_code = (self.fp.create_shared_swapchains_khr)(
|
||||
self.handle,
|
||||
create_infos.len() as u32,
|
||||
create_infos.as_ptr(),
|
||||
|
|
|
@ -27,7 +27,7 @@ impl DrawIndirectCount {
|
|||
max_draw_count: u32,
|
||||
stride: u32,
|
||||
) {
|
||||
self.fp.cmd_draw_indexed_indirect_count_khr(
|
||||
(self.fp.cmd_draw_indexed_indirect_count_khr)(
|
||||
command_buffer,
|
||||
buffer,
|
||||
offset,
|
||||
|
@ -49,7 +49,7 @@ impl DrawIndirectCount {
|
|||
max_draw_count: u32,
|
||||
stride: u32,
|
||||
) {
|
||||
self.fp.cmd_draw_indexed_indirect_count_khr(
|
||||
(self.fp.cmd_draw_indexed_indirect_count_khr)(
|
||||
command_buffer,
|
||||
buffer,
|
||||
offset,
|
||||
|
|
|
@ -22,13 +22,12 @@ impl DynamicRendering {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
rendering_info: &vk::RenderingInfoKHR,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_begin_rendering_khr(command_buffer, rendering_info)
|
||||
(self.fp.cmd_begin_rendering_khr)(command_buffer, rendering_info)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdEndRenderingKHR.html>
|
||||
pub unsafe fn cmd_end_rendering(&self, command_buffer: vk::CommandBuffer) {
|
||||
self.fp.cmd_end_rendering_khr(command_buffer)
|
||||
(self.fp.cmd_end_rendering_khr)(command_buffer)
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -21,17 +21,13 @@ impl ExternalFenceFd {
|
|||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkImportFenceFdKHR.html>
|
||||
pub unsafe fn import_fence_fd(&self, import_info: &vk::ImportFenceFdInfoKHR) -> VkResult<()> {
|
||||
self.fp
|
||||
.import_fence_fd_khr(self.handle, import_info)
|
||||
.result()
|
||||
(self.fp.import_fence_fd_khr)(self.handle, import_info).result()
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetFenceFdKHR.html>
|
||||
pub unsafe fn get_fence_fd(&self, get_info: &vk::FenceGetFdInfoKHR) -> VkResult<i32> {
|
||||
let mut fd = -1;
|
||||
self.fp
|
||||
.get_fence_fd_khr(self.handle, get_info, &mut fd)
|
||||
.result_with_success(fd)
|
||||
(self.fp.get_fence_fd_khr)(self.handle, get_info, &mut fd).result_with_success(fd)
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -26,9 +26,7 @@ impl ExternalFenceWin32 {
|
|||
&self,
|
||||
import_info: &vk::ImportFenceWin32HandleInfoKHR,
|
||||
) -> VkResult<()> {
|
||||
self.fp
|
||||
.import_fence_win32_handle_khr(self.handle, import_info)
|
||||
.result()
|
||||
(self.fp.import_fence_win32_handle_khr)(self.handle, import_info).result()
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetFenceWin32HandleKHR.html>
|
||||
|
@ -37,8 +35,7 @@ impl ExternalFenceWin32 {
|
|||
get_info: &vk::FenceGetWin32HandleInfoKHR,
|
||||
) -> VkResult<vk::HANDLE> {
|
||||
let mut handle = ptr::null_mut();
|
||||
self.fp
|
||||
.get_fence_win32_handle_khr(self.handle, get_info, &mut handle)
|
||||
(self.fp.get_fence_win32_handle_khr)(self.handle, get_info, &mut handle)
|
||||
.result_with_success(handle)
|
||||
}
|
||||
|
||||
|
|
|
@ -22,9 +22,7 @@ impl ExternalMemoryFd {
|
|||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetMemoryFdKHR.html>
|
||||
pub unsafe fn get_memory_fd(&self, create_info: &vk::MemoryGetFdInfoKHR) -> VkResult<i32> {
|
||||
let mut fd = -1;
|
||||
self.fp
|
||||
.get_memory_fd_khr(self.handle, create_info, &mut fd)
|
||||
.result_with_success(fd)
|
||||
(self.fp.get_memory_fd_khr)(self.handle, create_info, &mut fd).result_with_success(fd)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetMemoryFdPropertiesKHR.html>
|
||||
|
@ -34,9 +32,13 @@ impl ExternalMemoryFd {
|
|||
fd: i32,
|
||||
) -> VkResult<vk::MemoryFdPropertiesKHR> {
|
||||
let mut memory_fd_properties = Default::default();
|
||||
self.fp
|
||||
.get_memory_fd_properties_khr(self.handle, handle_type, fd, &mut memory_fd_properties)
|
||||
.result_with_success(memory_fd_properties)
|
||||
(self.fp.get_memory_fd_properties_khr)(
|
||||
self.handle,
|
||||
handle_type,
|
||||
fd,
|
||||
&mut memory_fd_properties,
|
||||
)
|
||||
.result_with_success(memory_fd_properties)
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -27,8 +27,7 @@ impl ExternalMemoryWin32 {
|
|||
create_info: &vk::MemoryGetWin32HandleInfoKHR,
|
||||
) -> VkResult<vk::HANDLE> {
|
||||
let mut handle = ptr::null_mut();
|
||||
self.fp
|
||||
.get_memory_win32_handle_khr(self.handle, create_info, &mut handle)
|
||||
(self.fp.get_memory_win32_handle_khr)(self.handle, create_info, &mut handle)
|
||||
.result_with_success(handle)
|
||||
}
|
||||
|
||||
|
@ -39,14 +38,13 @@ impl ExternalMemoryWin32 {
|
|||
handle: vk::HANDLE,
|
||||
) -> VkResult<vk::MemoryWin32HandlePropertiesKHR> {
|
||||
let mut memory_win32_handle_properties = Default::default();
|
||||
self.fp
|
||||
.get_memory_win32_handle_properties_khr(
|
||||
self.handle,
|
||||
handle_type,
|
||||
handle,
|
||||
&mut memory_win32_handle_properties,
|
||||
)
|
||||
.result_with_success(memory_win32_handle_properties)
|
||||
(self.fp.get_memory_win32_handle_properties_khr)(
|
||||
self.handle,
|
||||
handle_type,
|
||||
handle,
|
||||
&mut memory_win32_handle_properties,
|
||||
)
|
||||
.result_with_success(memory_win32_handle_properties)
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -24,17 +24,13 @@ impl ExternalSemaphoreFd {
|
|||
&self,
|
||||
import_info: &vk::ImportSemaphoreFdInfoKHR,
|
||||
) -> VkResult<()> {
|
||||
self.fp
|
||||
.import_semaphore_fd_khr(self.handle, import_info)
|
||||
.result()
|
||||
(self.fp.import_semaphore_fd_khr)(self.handle, import_info).result()
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetSemaphoreFdKHR.html>
|
||||
pub unsafe fn get_semaphore_fd(&self, get_info: &vk::SemaphoreGetFdInfoKHR) -> VkResult<i32> {
|
||||
let mut fd = -1;
|
||||
self.fp
|
||||
.get_semaphore_fd_khr(self.handle, get_info, &mut fd)
|
||||
.result_with_success(fd)
|
||||
(self.fp.get_semaphore_fd_khr)(self.handle, get_info, &mut fd).result_with_success(fd)
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -26,9 +26,7 @@ impl ExternalSemaphoreWin32 {
|
|||
&self,
|
||||
import_info: &vk::ImportSemaphoreWin32HandleInfoKHR,
|
||||
) -> VkResult<()> {
|
||||
self.fp
|
||||
.import_semaphore_win32_handle_khr(self.handle, import_info)
|
||||
.result()
|
||||
(self.fp.import_semaphore_win32_handle_khr)(self.handle, import_info).result()
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetSemaphoreWin32HandleKHR.html>
|
||||
|
@ -37,8 +35,7 @@ impl ExternalSemaphoreWin32 {
|
|||
get_info: &vk::SemaphoreGetWin32HandleInfoKHR,
|
||||
) -> VkResult<vk::HANDLE> {
|
||||
let mut handle = ptr::null_mut();
|
||||
self.fp
|
||||
.get_semaphore_win32_handle_khr(self.handle, get_info, &mut handle)
|
||||
(self.fp.get_semaphore_win32_handle_khr)(self.handle, get_info, &mut handle)
|
||||
.result_with_success(handle)
|
||||
}
|
||||
|
||||
|
|
|
@ -25,8 +25,7 @@ impl GetMemoryRequirements2 {
|
|||
info: &vk::BufferMemoryRequirementsInfo2KHR,
|
||||
memory_requirements: &mut vk::MemoryRequirements2KHR,
|
||||
) {
|
||||
self.fp
|
||||
.get_buffer_memory_requirements2_khr(self.handle, info, memory_requirements);
|
||||
(self.fp.get_buffer_memory_requirements2_khr)(self.handle, info, memory_requirements);
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetImageMemoryRequirements2KHR.html>
|
||||
|
@ -35,8 +34,7 @@ impl GetMemoryRequirements2 {
|
|||
info: &vk::ImageMemoryRequirementsInfo2KHR,
|
||||
memory_requirements: &mut vk::MemoryRequirements2KHR,
|
||||
) {
|
||||
self.fp
|
||||
.get_image_memory_requirements2_khr(self.handle, info, memory_requirements);
|
||||
(self.fp.get_image_memory_requirements2_khr)(self.handle, info, memory_requirements);
|
||||
}
|
||||
|
||||
/// Retrieve the number of elements to pass to [`get_image_sparse_memory_requirements2()`][Self::get_image_sparse_memory_requirements2()]
|
||||
|
@ -45,7 +43,7 @@ impl GetMemoryRequirements2 {
|
|||
info: &vk::ImageSparseMemoryRequirementsInfo2KHR,
|
||||
) -> usize {
|
||||
let mut count = 0;
|
||||
self.fp.get_image_sparse_memory_requirements2_khr(
|
||||
(self.fp.get_image_sparse_memory_requirements2_khr)(
|
||||
self.handle,
|
||||
info,
|
||||
&mut count,
|
||||
|
@ -64,7 +62,7 @@ impl GetMemoryRequirements2 {
|
|||
out: &mut [vk::SparseImageMemoryRequirements2KHR],
|
||||
) {
|
||||
let mut count = out.len() as u32;
|
||||
self.fp.get_image_sparse_memory_requirements2_khr(
|
||||
(self.fp.get_image_sparse_memory_requirements2_khr)(
|
||||
self.handle,
|
||||
info,
|
||||
&mut count,
|
||||
|
|
|
@ -24,8 +24,7 @@ impl GetPhysicalDeviceProperties2 {
|
|||
physical_device: vk::PhysicalDevice,
|
||||
features: &mut vk::PhysicalDeviceFeatures2KHR,
|
||||
) {
|
||||
self.fp
|
||||
.get_physical_device_features2_khr(physical_device, features);
|
||||
(self.fp.get_physical_device_features2_khr)(physical_device, features);
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceFormatProperties2KHR.html>
|
||||
|
@ -35,7 +34,7 @@ impl GetPhysicalDeviceProperties2 {
|
|||
format: vk::Format,
|
||||
format_properties: &mut vk::FormatProperties2KHR,
|
||||
) {
|
||||
self.fp.get_physical_device_format_properties2_khr(
|
||||
(self.fp.get_physical_device_format_properties2_khr)(
|
||||
physical_device,
|
||||
format,
|
||||
format_properties,
|
||||
|
@ -49,13 +48,12 @@ impl GetPhysicalDeviceProperties2 {
|
|||
image_format_info: &vk::PhysicalDeviceImageFormatInfo2KHR,
|
||||
image_format_properties: &mut vk::ImageFormatProperties2KHR,
|
||||
) -> VkResult<()> {
|
||||
self.fp
|
||||
.get_physical_device_image_format_properties2_khr(
|
||||
physical_device,
|
||||
image_format_info,
|
||||
image_format_properties,
|
||||
)
|
||||
.result()
|
||||
(self.fp.get_physical_device_image_format_properties2_khr)(
|
||||
physical_device,
|
||||
image_format_info,
|
||||
image_format_properties,
|
||||
)
|
||||
.result()
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceMemoryProperties2KHR.html>
|
||||
|
@ -64,8 +62,7 @@ impl GetPhysicalDeviceProperties2 {
|
|||
physical_device: vk::PhysicalDevice,
|
||||
memory_properties: &mut vk::PhysicalDeviceMemoryProperties2KHR,
|
||||
) {
|
||||
self.fp
|
||||
.get_physical_device_memory_properties2_khr(physical_device, memory_properties);
|
||||
(self.fp.get_physical_device_memory_properties2_khr)(physical_device, memory_properties);
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceProperties2KHR.html>
|
||||
|
@ -74,8 +71,7 @@ impl GetPhysicalDeviceProperties2 {
|
|||
physical_device: vk::PhysicalDevice,
|
||||
properties: &mut vk::PhysicalDeviceProperties2KHR,
|
||||
) {
|
||||
self.fp
|
||||
.get_physical_device_properties2_khr(physical_device, properties);
|
||||
(self.fp.get_physical_device_properties2_khr)(physical_device, properties);
|
||||
}
|
||||
|
||||
/// Retrieve the number of elements to pass to [`get_physical_device_queue_family_properties2()`][Self::get_physical_device_queue_family_properties2()]
|
||||
|
@ -84,7 +80,7 @@ impl GetPhysicalDeviceProperties2 {
|
|||
physical_device: vk::PhysicalDevice,
|
||||
) -> usize {
|
||||
let mut count = 0;
|
||||
self.fp.get_physical_device_queue_family_properties2_khr(
|
||||
(self.fp.get_physical_device_queue_family_properties2_khr)(
|
||||
physical_device,
|
||||
&mut count,
|
||||
ptr::null_mut(),
|
||||
|
@ -102,7 +98,7 @@ impl GetPhysicalDeviceProperties2 {
|
|||
out: &mut [vk::QueueFamilyProperties2KHR],
|
||||
) {
|
||||
let mut count = out.len() as u32;
|
||||
self.fp.get_physical_device_queue_family_properties2_khr(
|
||||
(self.fp.get_physical_device_queue_family_properties2_khr)(
|
||||
physical_device,
|
||||
&mut count,
|
||||
out.as_mut_ptr(),
|
||||
|
@ -117,13 +113,14 @@ impl GetPhysicalDeviceProperties2 {
|
|||
format_info: &vk::PhysicalDeviceSparseImageFormatInfo2KHR,
|
||||
) -> usize {
|
||||
let mut count = 0;
|
||||
self.fp
|
||||
.get_physical_device_sparse_image_format_properties2_khr(
|
||||
physical_device,
|
||||
format_info,
|
||||
&mut count,
|
||||
ptr::null_mut(),
|
||||
);
|
||||
(self
|
||||
.fp
|
||||
.get_physical_device_sparse_image_format_properties2_khr)(
|
||||
physical_device,
|
||||
format_info,
|
||||
&mut count,
|
||||
ptr::null_mut(),
|
||||
);
|
||||
count as usize
|
||||
}
|
||||
|
||||
|
@ -138,13 +135,14 @@ impl GetPhysicalDeviceProperties2 {
|
|||
out: &mut [vk::SparseImageFormatProperties2KHR],
|
||||
) {
|
||||
let mut count = out.len() as u32;
|
||||
self.fp
|
||||
.get_physical_device_sparse_image_format_properties2_khr(
|
||||
physical_device,
|
||||
format_info,
|
||||
&mut count,
|
||||
out.as_mut_ptr(),
|
||||
);
|
||||
(self
|
||||
.fp
|
||||
.get_physical_device_sparse_image_format_properties2_khr)(
|
||||
physical_device,
|
||||
format_info,
|
||||
&mut count,
|
||||
out.as_mut_ptr(),
|
||||
);
|
||||
assert_eq!(count as usize, out.len());
|
||||
}
|
||||
|
||||
|
|
|
@ -24,13 +24,12 @@ impl GetSurfaceCapabilities2 {
|
|||
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR,
|
||||
) -> VkResult<vk::SurfaceCapabilities2KHR> {
|
||||
let mut surface_capabilities = Default::default();
|
||||
self.fp
|
||||
.get_physical_device_surface_capabilities2_khr(
|
||||
physical_device,
|
||||
surface_info,
|
||||
&mut surface_capabilities,
|
||||
)
|
||||
.result_with_success(surface_capabilities)
|
||||
(self.fp.get_physical_device_surface_capabilities2_khr)(
|
||||
physical_device,
|
||||
surface_info,
|
||||
&mut surface_capabilities,
|
||||
)
|
||||
.result_with_success(surface_capabilities)
|
||||
}
|
||||
|
||||
/// Retrieve the number of elements to pass to [`get_physical_device_surface_formats2()`][Self::get_physical_device_surface_formats2()]
|
||||
|
@ -40,7 +39,7 @@ impl GetSurfaceCapabilities2 {
|
|||
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR,
|
||||
) -> VkResult<usize> {
|
||||
let mut count = 0;
|
||||
let err_code = self.fp.get_physical_device_surface_formats2_khr(
|
||||
let err_code = (self.fp.get_physical_device_surface_formats2_khr)(
|
||||
physical_device,
|
||||
surface_info,
|
||||
&mut count,
|
||||
|
@ -60,7 +59,7 @@ impl GetSurfaceCapabilities2 {
|
|||
out: &mut [vk::SurfaceFormat2KHR],
|
||||
) -> VkResult<()> {
|
||||
let mut count = out.len() as u32;
|
||||
let err_code = self.fp.get_physical_device_surface_formats2_khr(
|
||||
let err_code = (self.fp.get_physical_device_surface_formats2_khr)(
|
||||
physical_device,
|
||||
surface_info,
|
||||
&mut count,
|
||||
|
|
|
@ -24,8 +24,7 @@ impl Maintenance1 {
|
|||
command_pool: vk::CommandPool,
|
||||
flags: vk::CommandPoolTrimFlagsKHR,
|
||||
) {
|
||||
self.fp
|
||||
.trim_command_pool_khr(self.handle, command_pool, flags);
|
||||
(self.fp.trim_command_pool_khr)(self.handle, command_pool, flags);
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -24,8 +24,7 @@ impl Maintenance3 {
|
|||
create_info: &vk::DescriptorSetLayoutCreateInfo,
|
||||
out: &mut vk::DescriptorSetLayoutSupportKHR,
|
||||
) {
|
||||
self.fp
|
||||
.get_descriptor_set_layout_support_khr(self.handle, create_info, out);
|
||||
(self.fp.get_descriptor_set_layout_support_khr)(self.handle, create_info, out);
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -24,8 +24,7 @@ impl Maintenance4 {
|
|||
create_info: &vk::DeviceBufferMemoryRequirementsKHR,
|
||||
out: &mut vk::MemoryRequirements2,
|
||||
) {
|
||||
self.fp
|
||||
.get_device_buffer_memory_requirements_khr(self.handle, create_info, out)
|
||||
(self.fp.get_device_buffer_memory_requirements_khr)(self.handle, create_info, out)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceImageMemoryRequirementsKHR.html>
|
||||
|
@ -34,8 +33,7 @@ impl Maintenance4 {
|
|||
create_info: &vk::DeviceImageMemoryRequirementsKHR,
|
||||
out: &mut vk::MemoryRequirements2,
|
||||
) {
|
||||
self.fp
|
||||
.get_device_image_memory_requirements_khr(self.handle, create_info, out)
|
||||
(self.fp.get_device_image_memory_requirements_khr)(self.handle, create_info, out)
|
||||
}
|
||||
|
||||
/// Retrieve the number of elements to pass to [`get_device_image_sparse_memory_requirements()`][Self::get_device_image_sparse_memory_requirements()]
|
||||
|
@ -44,7 +42,7 @@ impl Maintenance4 {
|
|||
create_info: &vk::DeviceImageMemoryRequirementsKHR,
|
||||
) -> usize {
|
||||
let mut count = 0;
|
||||
self.fp.get_device_image_sparse_memory_requirements_khr(
|
||||
(self.fp.get_device_image_sparse_memory_requirements_khr)(
|
||||
self.handle,
|
||||
create_info,
|
||||
&mut count,
|
||||
|
@ -63,7 +61,7 @@ impl Maintenance4 {
|
|||
out: &mut [vk::SparseImageMemoryRequirements2],
|
||||
) {
|
||||
let mut count = out.len() as u32;
|
||||
self.fp.get_device_image_sparse_memory_requirements_khr(
|
||||
(self.fp.get_device_image_sparse_memory_requirements_khr)(
|
||||
self.handle,
|
||||
create_info,
|
||||
&mut count,
|
||||
|
|
|
@ -25,13 +25,12 @@ impl PipelineExecutableProperties {
|
|||
executable_info: &vk::PipelineExecutableInfoKHR,
|
||||
) -> VkResult<Vec<vk::PipelineExecutableInternalRepresentationKHR>> {
|
||||
read_into_defaulted_vector(|count, data| {
|
||||
self.fp
|
||||
.get_pipeline_executable_internal_representations_khr(
|
||||
self.handle,
|
||||
executable_info,
|
||||
count,
|
||||
data,
|
||||
)
|
||||
(self.fp.get_pipeline_executable_internal_representations_khr)(
|
||||
self.handle,
|
||||
executable_info,
|
||||
count,
|
||||
data,
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -41,8 +40,12 @@ impl PipelineExecutableProperties {
|
|||
pipeline_info: &vk::PipelineInfoKHR,
|
||||
) -> VkResult<Vec<vk::PipelineExecutablePropertiesKHR>> {
|
||||
read_into_defaulted_vector(|count, data| {
|
||||
self.fp
|
||||
.get_pipeline_executable_properties_khr(self.handle, pipeline_info, count, data)
|
||||
(self.fp.get_pipeline_executable_properties_khr)(
|
||||
self.handle,
|
||||
pipeline_info,
|
||||
count,
|
||||
data,
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -52,7 +55,7 @@ impl PipelineExecutableProperties {
|
|||
executable_info: &vk::PipelineExecutableInfoKHR,
|
||||
) -> VkResult<Vec<vk::PipelineExecutableStatisticKHR>> {
|
||||
read_into_defaulted_vector(|count, data| {
|
||||
self.fp.get_pipeline_executable_statistics_khr(
|
||||
(self.fp.get_pipeline_executable_statistics_khr)(
|
||||
self.handle,
|
||||
executable_info,
|
||||
count,
|
||||
|
|
|
@ -26,9 +26,7 @@ impl PresentWait {
|
|||
present_id: u64,
|
||||
timeout: u64,
|
||||
) -> VkResult<()> {
|
||||
self.fp
|
||||
.wait_for_present_khr(self.handle, swapchain, present_id, timeout)
|
||||
.result()
|
||||
(self.fp.wait_for_present_khr)(self.handle, swapchain, present_id, timeout).result()
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -26,7 +26,7 @@ impl PushDescriptor {
|
|||
set: u32,
|
||||
descriptor_writes: &[vk::WriteDescriptorSet],
|
||||
) {
|
||||
self.fp.cmd_push_descriptor_set_khr(
|
||||
(self.fp.cmd_push_descriptor_set_khr)(
|
||||
command_buffer,
|
||||
pipeline_bind_point,
|
||||
layout,
|
||||
|
@ -45,7 +45,7 @@ impl PushDescriptor {
|
|||
set: u32,
|
||||
p_data: *const c_void,
|
||||
) {
|
||||
self.fp.cmd_push_descriptor_set_with_template_khr(
|
||||
(self.fp.cmd_push_descriptor_set_with_template_khr)(
|
||||
command_buffer,
|
||||
descriptor_update_template,
|
||||
layout,
|
||||
|
|
|
@ -44,7 +44,7 @@ impl RayTracingPipeline {
|
|||
height: u32,
|
||||
depth: u32,
|
||||
) {
|
||||
self.fp.cmd_trace_rays_khr(
|
||||
(self.fp.cmd_trace_rays_khr)(
|
||||
command_buffer,
|
||||
raygen_shader_binding_tables,
|
||||
miss_shader_binding_tables,
|
||||
|
@ -65,17 +65,16 @@ impl RayTracingPipeline {
|
|||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<Vec<vk::Pipeline>> {
|
||||
let mut pipelines = vec![mem::zeroed(); create_info.len()];
|
||||
self.fp
|
||||
.create_ray_tracing_pipelines_khr(
|
||||
self.handle,
|
||||
deferred_operation,
|
||||
pipeline_cache,
|
||||
create_info.len() as u32,
|
||||
create_info.as_ptr(),
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
pipelines.as_mut_ptr(),
|
||||
)
|
||||
.result_with_success(pipelines)
|
||||
(self.fp.create_ray_tracing_pipelines_khr)(
|
||||
self.handle,
|
||||
deferred_operation,
|
||||
pipeline_cache,
|
||||
create_info.len() as u32,
|
||||
create_info.as_ptr(),
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
pipelines.as_mut_ptr(),
|
||||
)
|
||||
.result_with_success(pipelines)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetRayTracingShaderGroupHandlesKHR.html>
|
||||
|
@ -87,7 +86,7 @@ impl RayTracingPipeline {
|
|||
data_size: usize,
|
||||
) -> VkResult<Vec<u8>> {
|
||||
let mut data = Vec::<u8>::with_capacity(data_size);
|
||||
let err_code = self.fp.get_ray_tracing_shader_group_handles_khr(
|
||||
let err_code = (self.fp.get_ray_tracing_shader_group_handles_khr)(
|
||||
self.handle,
|
||||
pipeline,
|
||||
first_group,
|
||||
|
@ -109,16 +108,17 @@ impl RayTracingPipeline {
|
|||
) -> VkResult<Vec<u8>> {
|
||||
let mut data: Vec<u8> = Vec::with_capacity(data_size);
|
||||
|
||||
self.fp
|
||||
.get_ray_tracing_capture_replay_shader_group_handles_khr(
|
||||
self.handle,
|
||||
pipeline,
|
||||
first_group,
|
||||
group_count,
|
||||
data_size,
|
||||
data.as_mut_ptr() as *mut _,
|
||||
)
|
||||
.result_with_success(data)
|
||||
(self
|
||||
.fp
|
||||
.get_ray_tracing_capture_replay_shader_group_handles_khr)(
|
||||
self.handle,
|
||||
pipeline,
|
||||
first_group,
|
||||
group_count,
|
||||
data_size,
|
||||
data.as_mut_ptr() as *mut _,
|
||||
)
|
||||
.result_with_success(data)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdTraceRaysIndirectKHR.html>
|
||||
|
@ -131,7 +131,7 @@ impl RayTracingPipeline {
|
|||
callable_shader_binding_table: &[vk::StridedDeviceAddressRegionKHR],
|
||||
indirect_device_address: vk::DeviceAddress,
|
||||
) {
|
||||
self.fp.cmd_trace_rays_indirect_khr(
|
||||
(self.fp.cmd_trace_rays_indirect_khr)(
|
||||
command_buffer,
|
||||
raygen_shader_binding_table.as_ptr(),
|
||||
miss_shader_binding_table.as_ptr(),
|
||||
|
@ -148,7 +148,7 @@ impl RayTracingPipeline {
|
|||
group: u32,
|
||||
group_shader: vk::ShaderGroupShaderKHR,
|
||||
) -> vk::DeviceSize {
|
||||
self.fp.get_ray_tracing_shader_group_stack_size_khr(
|
||||
(self.fp.get_ray_tracing_shader_group_stack_size_khr)(
|
||||
self.handle,
|
||||
pipeline,
|
||||
group,
|
||||
|
@ -162,8 +162,7 @@ impl RayTracingPipeline {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
pipeline_stack_size: u32,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_set_ray_tracing_pipeline_stack_size_khr(command_buffer, pipeline_stack_size);
|
||||
(self.fp.cmd_set_ray_tracing_pipeline_stack_size_khr)(command_buffer, pipeline_stack_size);
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -28,14 +28,13 @@ impl Surface {
|
|||
surface: vk::SurfaceKHR,
|
||||
) -> VkResult<bool> {
|
||||
let mut b = 0;
|
||||
self.fp
|
||||
.get_physical_device_surface_support_khr(
|
||||
physical_device,
|
||||
queue_family_index,
|
||||
surface,
|
||||
&mut b,
|
||||
)
|
||||
.result_with_success(b > 0)
|
||||
(self.fp.get_physical_device_surface_support_khr)(
|
||||
physical_device,
|
||||
queue_family_index,
|
||||
surface,
|
||||
&mut b,
|
||||
)
|
||||
.result_with_success(b > 0)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSurfacePresentModesKHR.html>
|
||||
|
@ -45,7 +44,7 @@ impl Surface {
|
|||
surface: vk::SurfaceKHR,
|
||||
) -> VkResult<Vec<vk::PresentModeKHR>> {
|
||||
read_into_uninitialized_vector(|count, data| {
|
||||
self.fp.get_physical_device_surface_present_modes_khr(
|
||||
(self.fp.get_physical_device_surface_present_modes_khr)(
|
||||
physical_device,
|
||||
surface,
|
||||
count,
|
||||
|
@ -61,13 +60,12 @@ impl Surface {
|
|||
surface: vk::SurfaceKHR,
|
||||
) -> VkResult<vk::SurfaceCapabilitiesKHR> {
|
||||
let mut surface_capabilities = mem::zeroed();
|
||||
self.fp
|
||||
.get_physical_device_surface_capabilities_khr(
|
||||
physical_device,
|
||||
surface,
|
||||
&mut surface_capabilities,
|
||||
)
|
||||
.result_with_success(surface_capabilities)
|
||||
(self.fp.get_physical_device_surface_capabilities_khr)(
|
||||
physical_device,
|
||||
surface,
|
||||
&mut surface_capabilities,
|
||||
)
|
||||
.result_with_success(surface_capabilities)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSurfaceFormatsKHR.html>
|
||||
|
@ -77,8 +75,7 @@ impl Surface {
|
|||
surface: vk::SurfaceKHR,
|
||||
) -> VkResult<Vec<vk::SurfaceFormatKHR>> {
|
||||
read_into_uninitialized_vector(|count, data| {
|
||||
self.fp
|
||||
.get_physical_device_surface_formats_khr(physical_device, surface, count, data)
|
||||
(self.fp.get_physical_device_surface_formats_khr)(physical_device, surface, count, data)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -88,8 +85,7 @@ impl Surface {
|
|||
surface: vk::SurfaceKHR,
|
||||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) {
|
||||
self.fp
|
||||
.destroy_surface_khr(self.handle, surface, allocation_callbacks.as_raw_ptr());
|
||||
(self.fp.destroy_surface_khr)(self.handle, surface, allocation_callbacks.as_raw_ptr());
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -26,8 +26,7 @@ impl Swapchain {
|
|||
swapchain: vk::SwapchainKHR,
|
||||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) {
|
||||
self.fp
|
||||
.destroy_swapchain_khr(self.handle, swapchain, allocation_callbacks.as_raw_ptr());
|
||||
(self.fp.destroy_swapchain_khr)(self.handle, swapchain, allocation_callbacks.as_raw_ptr());
|
||||
}
|
||||
|
||||
/// On success, returns the next image's index and whether the swapchain is suboptimal for the surface.
|
||||
|
@ -40,7 +39,7 @@ impl Swapchain {
|
|||
fence: vk::Fence,
|
||||
) -> VkResult<(u32, bool)> {
|
||||
let mut index = 0;
|
||||
let err_code = self.fp.acquire_next_image_khr(
|
||||
let err_code = (self.fp.acquire_next_image_khr)(
|
||||
self.handle,
|
||||
swapchain,
|
||||
timeout,
|
||||
|
@ -62,14 +61,13 @@ impl Swapchain {
|
|||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<vk::SwapchainKHR> {
|
||||
let mut swapchain = mem::zeroed();
|
||||
self.fp
|
||||
.create_swapchain_khr(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut swapchain,
|
||||
)
|
||||
.result_with_success(swapchain)
|
||||
(self.fp.create_swapchain_khr)(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut swapchain,
|
||||
)
|
||||
.result_with_success(swapchain)
|
||||
}
|
||||
|
||||
/// On success, returns whether the swapchain is suboptimal for the surface.
|
||||
|
@ -79,7 +77,7 @@ impl Swapchain {
|
|||
queue: vk::Queue,
|
||||
present_info: &vk::PresentInfoKHR,
|
||||
) -> VkResult<bool> {
|
||||
let err_code = self.fp.queue_present_khr(queue, present_info);
|
||||
let err_code = (self.fp.queue_present_khr)(queue, present_info);
|
||||
match err_code {
|
||||
vk::Result::SUCCESS => Ok(false),
|
||||
vk::Result::SUBOPTIMAL_KHR => Ok(true),
|
||||
|
@ -93,8 +91,7 @@ impl Swapchain {
|
|||
swapchain: vk::SwapchainKHR,
|
||||
) -> VkResult<Vec<vk::Image>> {
|
||||
read_into_uninitialized_vector(|count, data| {
|
||||
self.fp
|
||||
.get_swapchain_images_khr(self.handle, swapchain, count, data)
|
||||
(self.fp.get_swapchain_images_khr)(self.handle, swapchain, count, data)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -23,8 +23,7 @@ impl Synchronization2 {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
dependency_info: &vk::DependencyInfoKHR,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_pipeline_barrier2_khr(command_buffer, dependency_info)
|
||||
(self.fp.cmd_pipeline_barrier2_khr)(command_buffer, dependency_info)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdResetEvent2KHR.html>
|
||||
|
@ -34,8 +33,7 @@ impl Synchronization2 {
|
|||
event: vk::Event,
|
||||
stage_mask: vk::PipelineStageFlags2KHR,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_reset_event2_khr(command_buffer, event, stage_mask)
|
||||
(self.fp.cmd_reset_event2_khr)(command_buffer, event, stage_mask)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetEvent2KHR.html>
|
||||
|
@ -45,8 +43,7 @@ impl Synchronization2 {
|
|||
event: vk::Event,
|
||||
dependency_info: &vk::DependencyInfoKHR,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_set_event2_khr(command_buffer, event, dependency_info)
|
||||
(self.fp.cmd_set_event2_khr)(command_buffer, event, dependency_info)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdWaitEvents2KHR.html>
|
||||
|
@ -57,7 +54,7 @@ impl Synchronization2 {
|
|||
dependency_infos: &[vk::DependencyInfoKHR],
|
||||
) {
|
||||
assert_eq!(events.len(), dependency_infos.len());
|
||||
self.fp.cmd_wait_events2_khr(
|
||||
(self.fp.cmd_wait_events2_khr)(
|
||||
command_buffer,
|
||||
events.len() as u32,
|
||||
events.as_ptr(),
|
||||
|
@ -73,8 +70,7 @@ impl Synchronization2 {
|
|||
query_pool: vk::QueryPool,
|
||||
query: u32,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_write_timestamp2_khr(command_buffer, stage, query_pool, query)
|
||||
(self.fp.cmd_write_timestamp2_khr)(command_buffer, stage, query_pool, query)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueueSubmit2KHR.html>
|
||||
|
@ -84,9 +80,7 @@ impl Synchronization2 {
|
|||
submits: &[vk::SubmitInfo2KHR],
|
||||
fence: vk::Fence,
|
||||
) -> VkResult<()> {
|
||||
self.fp
|
||||
.queue_submit2_khr(queue, submits.len() as u32, submits.as_ptr(), fence)
|
||||
.result()
|
||||
(self.fp.queue_submit2_khr)(queue, submits.len() as u32, submits.as_ptr(), fence).result()
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -22,8 +22,7 @@ impl TimelineSemaphore {
|
|||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetSemaphoreCounterValue.html>
|
||||
pub unsafe fn get_semaphore_counter_value(&self, semaphore: vk::Semaphore) -> VkResult<u64> {
|
||||
let mut value = 0;
|
||||
self.fp
|
||||
.get_semaphore_counter_value_khr(self.handle, semaphore, &mut value)
|
||||
(self.fp.get_semaphore_counter_value_khr)(self.handle, semaphore, &mut value)
|
||||
.result_with_success(value)
|
||||
}
|
||||
|
||||
|
@ -33,16 +32,12 @@ impl TimelineSemaphore {
|
|||
wait_info: &vk::SemaphoreWaitInfo,
|
||||
timeout: u64,
|
||||
) -> VkResult<()> {
|
||||
self.fp
|
||||
.wait_semaphores_khr(self.handle, wait_info, timeout)
|
||||
.result()
|
||||
(self.fp.wait_semaphores_khr)(self.handle, wait_info, timeout).result()
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkSignalSemaphore.html>
|
||||
pub unsafe fn signal_semaphore(&self, signal_info: &vk::SemaphoreSignalInfo) -> VkResult<()> {
|
||||
self.fp
|
||||
.signal_semaphore_khr(self.handle, signal_info)
|
||||
.result()
|
||||
(self.fp.signal_semaphore_khr)(self.handle, signal_info).result()
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -27,14 +27,13 @@ impl WaylandSurface {
|
|||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<vk::SurfaceKHR> {
|
||||
let mut surface = mem::zeroed();
|
||||
self.fp
|
||||
.create_wayland_surface_khr(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut surface,
|
||||
)
|
||||
.result_with_success(surface)
|
||||
(self.fp.create_wayland_surface_khr)(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut surface,
|
||||
)
|
||||
.result_with_success(surface)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceWaylandPresentationSupportKHR.html>
|
||||
|
@ -44,13 +43,11 @@ impl WaylandSurface {
|
|||
queue_family_index: u32,
|
||||
wl_display: &mut vk::wl_display,
|
||||
) -> bool {
|
||||
let b = self
|
||||
.fp
|
||||
.get_physical_device_wayland_presentation_support_khr(
|
||||
physical_device,
|
||||
queue_family_index,
|
||||
wl_display,
|
||||
);
|
||||
let b = (self.fp.get_physical_device_wayland_presentation_support_khr)(
|
||||
physical_device,
|
||||
queue_family_index,
|
||||
wl_display,
|
||||
);
|
||||
|
||||
b > 0
|
||||
}
|
||||
|
|
|
@ -27,14 +27,13 @@ impl Win32Surface {
|
|||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<vk::SurfaceKHR> {
|
||||
let mut surface = mem::zeroed();
|
||||
self.fp
|
||||
.create_win32_surface_khr(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut surface,
|
||||
)
|
||||
.result_with_success(surface)
|
||||
(self.fp.create_win32_surface_khr)(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut surface,
|
||||
)
|
||||
.result_with_success(surface)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceWin32PresentationSupportKHR.html>
|
||||
|
@ -43,7 +42,7 @@ impl Win32Surface {
|
|||
physical_device: vk::PhysicalDevice,
|
||||
queue_family_index: u32,
|
||||
) -> bool {
|
||||
let b = self.fp.get_physical_device_win32_presentation_support_khr(
|
||||
let b = (self.fp.get_physical_device_win32_presentation_support_khr)(
|
||||
physical_device,
|
||||
queue_family_index,
|
||||
);
|
||||
|
|
|
@ -27,14 +27,13 @@ impl XcbSurface {
|
|||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<vk::SurfaceKHR> {
|
||||
let mut surface = mem::zeroed();
|
||||
self.fp
|
||||
.create_xcb_surface_khr(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut surface,
|
||||
)
|
||||
.result_with_success(surface)
|
||||
(self.fp.create_xcb_surface_khr)(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut surface,
|
||||
)
|
||||
.result_with_success(surface)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceXcbPresentationSupportKHR.html>
|
||||
|
@ -45,7 +44,7 @@ impl XcbSurface {
|
|||
connection: &mut vk::xcb_connection_t,
|
||||
visual_id: vk::xcb_visualid_t,
|
||||
) -> bool {
|
||||
let b = self.fp.get_physical_device_xcb_presentation_support_khr(
|
||||
let b = (self.fp.get_physical_device_xcb_presentation_support_khr)(
|
||||
physical_device,
|
||||
queue_family_index,
|
||||
connection,
|
||||
|
|
|
@ -27,14 +27,13 @@ impl XlibSurface {
|
|||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<vk::SurfaceKHR> {
|
||||
let mut surface = mem::zeroed();
|
||||
self.fp
|
||||
.create_xlib_surface_khr(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut surface,
|
||||
)
|
||||
.result_with_success(surface)
|
||||
(self.fp.create_xlib_surface_khr)(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut surface,
|
||||
)
|
||||
.result_with_success(surface)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceXlibPresentationSupportKHR.html>
|
||||
|
@ -45,7 +44,7 @@ impl XlibSurface {
|
|||
display: &mut vk::Display,
|
||||
visual_id: vk::VisualID,
|
||||
) -> bool {
|
||||
let b = self.fp.get_physical_device_xlib_presentation_support_khr(
|
||||
let b = (self.fp.get_physical_device_xlib_presentation_support_khr)(
|
||||
physical_device,
|
||||
queue_family_index,
|
||||
display,
|
||||
|
|
|
@ -27,14 +27,13 @@ impl IOSSurface {
|
|||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<vk::SurfaceKHR> {
|
||||
let mut surface = mem::zeroed();
|
||||
self.fp
|
||||
.create_ios_surface_mvk(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut surface,
|
||||
)
|
||||
.result_with_success(surface)
|
||||
(self.fp.create_ios_surface_mvk)(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut surface,
|
||||
)
|
||||
.result_with_success(surface)
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -27,14 +27,13 @@ impl MacOSSurface {
|
|||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<vk::SurfaceKHR> {
|
||||
let mut surface = mem::zeroed();
|
||||
self.fp
|
||||
.create_mac_os_surface_mvk(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut surface,
|
||||
)
|
||||
.result_with_success(surface)
|
||||
(self.fp.create_mac_os_surface_mvk)(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut surface,
|
||||
)
|
||||
.result_with_success(surface)
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -27,14 +27,13 @@ impl ViSurface {
|
|||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<vk::SurfaceKHR> {
|
||||
let mut surface = mem::zeroed();
|
||||
self.fp
|
||||
.create_vi_surface_nn(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut surface,
|
||||
)
|
||||
.result_with_success(surface)
|
||||
(self.fp.create_vi_surface_nn)(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut surface,
|
||||
)
|
||||
.result_with_success(surface)
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -23,21 +23,20 @@ impl DeviceDiagnosticCheckpoints {
|
|||
command_buffer: vk::CommandBuffer,
|
||||
p_checkpoint_marker: *const c_void,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_set_checkpoint_nv(command_buffer, p_checkpoint_marker);
|
||||
(self.fp.cmd_set_checkpoint_nv)(command_buffer, p_checkpoint_marker);
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetQueueCheckpointDataNV.html>
|
||||
pub unsafe fn get_queue_checkpoint_data(&self, queue: vk::Queue) -> Vec<vk::CheckpointDataNV> {
|
||||
let mut checkpoint_data_count: u32 = 0;
|
||||
self.fp.get_queue_checkpoint_data_nv(
|
||||
(self.fp.get_queue_checkpoint_data_nv)(
|
||||
queue,
|
||||
&mut checkpoint_data_count,
|
||||
std::ptr::null_mut(),
|
||||
);
|
||||
let mut checkpoint_data: Vec<vk::CheckpointDataNV> =
|
||||
vec![vk::CheckpointDataNV::default(); checkpoint_data_count as _];
|
||||
self.fp.get_queue_checkpoint_data_nv(
|
||||
(self.fp.get_queue_checkpoint_data_nv)(
|
||||
queue,
|
||||
&mut checkpoint_data_count,
|
||||
checkpoint_data.as_mut_ptr(),
|
||||
|
|
|
@ -23,8 +23,7 @@ impl MeshShader {
|
|||
task_count: u32,
|
||||
first_task: u32,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_draw_mesh_tasks_nv(command_buffer, task_count, first_task);
|
||||
(self.fp.cmd_draw_mesh_tasks_nv)(command_buffer, task_count, first_task);
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDrawMeshTasksIndirectNV.html>
|
||||
|
@ -36,8 +35,13 @@ impl MeshShader {
|
|||
draw_count: u32,
|
||||
stride: u32,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_draw_mesh_tasks_indirect_nv(command_buffer, buffer, offset, draw_count, stride);
|
||||
(self.fp.cmd_draw_mesh_tasks_indirect_nv)(
|
||||
command_buffer,
|
||||
buffer,
|
||||
offset,
|
||||
draw_count,
|
||||
stride,
|
||||
);
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDrawMeshTasksIndirectCountNV.html>
|
||||
|
@ -51,7 +55,7 @@ impl MeshShader {
|
|||
max_draw_count: u32,
|
||||
stride: u32,
|
||||
) {
|
||||
self.fp.cmd_draw_mesh_tasks_indirect_count_nv(
|
||||
(self.fp.cmd_draw_mesh_tasks_indirect_count_nv)(
|
||||
command_buffer,
|
||||
buffer,
|
||||
offset,
|
||||
|
|
|
@ -39,14 +39,13 @@ impl RayTracing {
|
|||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<vk::AccelerationStructureNV> {
|
||||
let mut accel_struct = mem::zeroed();
|
||||
self.fp
|
||||
.create_acceleration_structure_nv(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut accel_struct,
|
||||
)
|
||||
.result_with_success(accel_struct)
|
||||
(self.fp.create_acceleration_structure_nv)(
|
||||
self.handle,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut accel_struct,
|
||||
)
|
||||
.result_with_success(accel_struct)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyAccelerationStructureNV.html>
|
||||
|
@ -55,7 +54,7 @@ impl RayTracing {
|
|||
accel_struct: vk::AccelerationStructureNV,
|
||||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) {
|
||||
self.fp.destroy_acceleration_structure_nv(
|
||||
(self.fp.destroy_acceleration_structure_nv)(
|
||||
self.handle,
|
||||
accel_struct,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
|
@ -68,7 +67,7 @@ impl RayTracing {
|
|||
info: &vk::AccelerationStructureMemoryRequirementsInfoNV,
|
||||
) -> vk::MemoryRequirements2KHR {
|
||||
let mut requirements = mem::zeroed();
|
||||
self.fp.get_acceleration_structure_memory_requirements_nv(
|
||||
(self.fp.get_acceleration_structure_memory_requirements_nv)(
|
||||
self.handle,
|
||||
info,
|
||||
&mut requirements,
|
||||
|
@ -81,13 +80,12 @@ impl RayTracing {
|
|||
&self,
|
||||
bind_info: &[vk::BindAccelerationStructureMemoryInfoNV],
|
||||
) -> VkResult<()> {
|
||||
self.fp
|
||||
.bind_acceleration_structure_memory_nv(
|
||||
self.handle,
|
||||
bind_info.len() as u32,
|
||||
bind_info.as_ptr(),
|
||||
)
|
||||
.result()
|
||||
(self.fp.bind_acceleration_structure_memory_nv)(
|
||||
self.handle,
|
||||
bind_info.len() as u32,
|
||||
bind_info.as_ptr(),
|
||||
)
|
||||
.result()
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBuildAccelerationStructureNV.html>
|
||||
|
@ -103,7 +101,7 @@ impl RayTracing {
|
|||
scratch: vk::Buffer,
|
||||
scratch_offset: vk::DeviceSize,
|
||||
) {
|
||||
self.fp.cmd_build_acceleration_structure_nv(
|
||||
(self.fp.cmd_build_acceleration_structure_nv)(
|
||||
command_buffer,
|
||||
info,
|
||||
instance_data,
|
||||
|
@ -124,8 +122,7 @@ impl RayTracing {
|
|||
src: vk::AccelerationStructureNV,
|
||||
mode: vk::CopyAccelerationStructureModeNV,
|
||||
) {
|
||||
self.fp
|
||||
.cmd_copy_acceleration_structure_nv(command_buffer, dst, src, mode);
|
||||
(self.fp.cmd_copy_acceleration_structure_nv)(command_buffer, dst, src, mode);
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdTraceRaysNV.html>
|
||||
|
@ -147,7 +144,7 @@ impl RayTracing {
|
|||
height: u32,
|
||||
depth: u32,
|
||||
) {
|
||||
self.fp.cmd_trace_rays_nv(
|
||||
(self.fp.cmd_trace_rays_nv)(
|
||||
command_buffer,
|
||||
raygen_shader_binding_table_buffer,
|
||||
raygen_shader_binding_offset,
|
||||
|
@ -174,16 +171,15 @@ impl RayTracing {
|
|||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<Vec<vk::Pipeline>> {
|
||||
let mut pipelines = vec![mem::zeroed(); create_info.len()];
|
||||
self.fp
|
||||
.create_ray_tracing_pipelines_nv(
|
||||
self.handle,
|
||||
pipeline_cache,
|
||||
create_info.len() as u32,
|
||||
create_info.as_ptr(),
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
pipelines.as_mut_ptr(),
|
||||
)
|
||||
.result_with_success(pipelines)
|
||||
(self.fp.create_ray_tracing_pipelines_nv)(
|
||||
self.handle,
|
||||
pipeline_cache,
|
||||
create_info.len() as u32,
|
||||
create_info.as_ptr(),
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
pipelines.as_mut_ptr(),
|
||||
)
|
||||
.result_with_success(pipelines)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetRayTracingShaderGroupHandlesNV.html>
|
||||
|
@ -194,16 +190,15 @@ impl RayTracing {
|
|||
group_count: u32,
|
||||
data: &mut [u8],
|
||||
) -> VkResult<()> {
|
||||
self.fp
|
||||
.get_ray_tracing_shader_group_handles_nv(
|
||||
self.handle,
|
||||
pipeline,
|
||||
first_group,
|
||||
group_count,
|
||||
data.len(),
|
||||
data.as_mut_ptr() as *mut std::ffi::c_void,
|
||||
)
|
||||
.result()
|
||||
(self.fp.get_ray_tracing_shader_group_handles_nv)(
|
||||
self.handle,
|
||||
pipeline,
|
||||
first_group,
|
||||
group_count,
|
||||
data.len(),
|
||||
data.as_mut_ptr() as *mut std::ffi::c_void,
|
||||
)
|
||||
.result()
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetAccelerationStructureHandleNV.html>
|
||||
|
@ -213,14 +208,13 @@ impl RayTracing {
|
|||
) -> VkResult<u64> {
|
||||
let mut handle: u64 = 0;
|
||||
let handle_ptr: *mut u64 = &mut handle;
|
||||
self.fp
|
||||
.get_acceleration_structure_handle_nv(
|
||||
self.handle,
|
||||
accel_struct,
|
||||
std::mem::size_of::<u64>(),
|
||||
handle_ptr as *mut std::ffi::c_void,
|
||||
)
|
||||
.result_with_success(handle)
|
||||
(self.fp.get_acceleration_structure_handle_nv)(
|
||||
self.handle,
|
||||
accel_struct,
|
||||
std::mem::size_of::<u64>(),
|
||||
handle_ptr as *mut std::ffi::c_void,
|
||||
)
|
||||
.result_with_success(handle)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdWriteAccelerationStructuresPropertiesNV.html>
|
||||
|
@ -232,7 +226,7 @@ impl RayTracing {
|
|||
query_pool: vk::QueryPool,
|
||||
first_query: u32,
|
||||
) {
|
||||
self.fp.cmd_write_acceleration_structures_properties_nv(
|
||||
(self.fp.cmd_write_acceleration_structures_properties_nv)(
|
||||
command_buffer,
|
||||
structures.len() as u32,
|
||||
structures.as_ptr(),
|
||||
|
@ -244,9 +238,7 @@ impl RayTracing {
|
|||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCompileDeferredNV.html>
|
||||
pub unsafe fn compile_deferred(&self, pipeline: vk::Pipeline, shader: u32) -> VkResult<()> {
|
||||
self.fp
|
||||
.compile_deferred_nv(self.handle, pipeline, shader)
|
||||
.result()
|
||||
(self.fp.compile_deferred_nv)(self.handle, pipeline, shader).result()
|
||||
}
|
||||
|
||||
pub const fn name() -> &'static CStr {
|
||||
|
|
|
@ -20,7 +20,7 @@ pub struct Instance {
|
|||
impl Instance {
|
||||
pub unsafe fn load(static_fn: &vk::StaticFn, instance: vk::Instance) -> Self {
|
||||
let load_fn = |name: &std::ffi::CStr| {
|
||||
mem::transmute(static_fn.get_instance_proc_addr(instance, name.as_ptr()))
|
||||
mem::transmute((static_fn.get_instance_proc_addr)(instance, name.as_ptr()))
|
||||
};
|
||||
|
||||
Self {
|
||||
|
@ -51,9 +51,12 @@ impl Instance {
|
|||
physical_device: vk::PhysicalDevice,
|
||||
) -> VkResult<usize> {
|
||||
let mut count = 0;
|
||||
self.instance_fn_1_3
|
||||
.get_physical_device_tool_properties(physical_device, &mut count, ptr::null_mut())
|
||||
.result_with_success(count as usize)
|
||||
(self.instance_fn_1_3.get_physical_device_tool_properties)(
|
||||
physical_device,
|
||||
&mut count,
|
||||
ptr::null_mut(),
|
||||
)
|
||||
.result_with_success(count as usize)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceToolProperties.html>
|
||||
|
@ -66,9 +69,12 @@ impl Instance {
|
|||
out: &mut [vk::PhysicalDeviceToolProperties],
|
||||
) -> VkResult<()> {
|
||||
let mut count = out.len() as u32;
|
||||
self.instance_fn_1_3
|
||||
.get_physical_device_tool_properties(physical_device, &mut count, out.as_mut_ptr())
|
||||
.result()?;
|
||||
(self.instance_fn_1_3.get_physical_device_tool_properties)(
|
||||
physical_device,
|
||||
&mut count,
|
||||
out.as_mut_ptr(),
|
||||
)
|
||||
.result()?;
|
||||
assert_eq!(count as usize, out.len());
|
||||
Ok(())
|
||||
}
|
||||
|
@ -92,9 +98,12 @@ impl Instance {
|
|||
/// Retrieve the number of elements to pass to [`enumerate_physical_device_groups()`][Self::enumerate_physical_device_groups()]
|
||||
pub unsafe fn enumerate_physical_device_groups_len(&self) -> VkResult<usize> {
|
||||
let mut group_count = 0;
|
||||
self.instance_fn_1_1
|
||||
.enumerate_physical_device_groups(self.handle(), &mut group_count, ptr::null_mut())
|
||||
.result_with_success(group_count as usize)
|
||||
(self.instance_fn_1_1.enumerate_physical_device_groups)(
|
||||
self.handle(),
|
||||
&mut group_count,
|
||||
ptr::null_mut(),
|
||||
)
|
||||
.result_with_success(group_count as usize)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkEnumeratePhysicalDeviceGroups.html>
|
||||
|
@ -106,9 +115,12 @@ impl Instance {
|
|||
out: &mut [vk::PhysicalDeviceGroupProperties],
|
||||
) -> VkResult<()> {
|
||||
let mut count = out.len() as u32;
|
||||
self.instance_fn_1_1
|
||||
.enumerate_physical_device_groups(self.handle(), &mut count, out.as_mut_ptr())
|
||||
.result()?;
|
||||
(self.instance_fn_1_1.enumerate_physical_device_groups)(
|
||||
self.handle(),
|
||||
&mut count,
|
||||
out.as_mut_ptr(),
|
||||
)
|
||||
.result()?;
|
||||
assert_eq!(count as usize, out.len());
|
||||
Ok(())
|
||||
}
|
||||
|
@ -119,8 +131,7 @@ impl Instance {
|
|||
physical_device: vk::PhysicalDevice,
|
||||
features: &mut vk::PhysicalDeviceFeatures2,
|
||||
) {
|
||||
self.instance_fn_1_1
|
||||
.get_physical_device_features2(physical_device, features);
|
||||
(self.instance_fn_1_1.get_physical_device_features2)(physical_device, features);
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceProperties2.html>
|
||||
|
@ -129,8 +140,7 @@ impl Instance {
|
|||
physical_device: vk::PhysicalDevice,
|
||||
prop: &mut vk::PhysicalDeviceProperties2,
|
||||
) {
|
||||
self.instance_fn_1_1
|
||||
.get_physical_device_properties2(physical_device, prop);
|
||||
(self.instance_fn_1_1.get_physical_device_properties2)(physical_device, prop);
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceFormatProperties2.html>
|
||||
|
@ -140,8 +150,7 @@ impl Instance {
|
|||
format: vk::Format,
|
||||
out: &mut vk::FormatProperties2,
|
||||
) {
|
||||
self.instance_fn_1_1
|
||||
.get_physical_device_format_properties2(physical_device, format, out);
|
||||
(self.instance_fn_1_1.get_physical_device_format_properties2)(physical_device, format, out);
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceImageFormatProperties2.html>
|
||||
|
@ -151,13 +160,14 @@ impl Instance {
|
|||
format_info: &vk::PhysicalDeviceImageFormatInfo2,
|
||||
image_format_prop: &mut vk::ImageFormatProperties2,
|
||||
) -> VkResult<()> {
|
||||
self.instance_fn_1_1
|
||||
.get_physical_device_image_format_properties2(
|
||||
physical_device,
|
||||
format_info,
|
||||
image_format_prop,
|
||||
)
|
||||
.result()
|
||||
(self
|
||||
.instance_fn_1_1
|
||||
.get_physical_device_image_format_properties2)(
|
||||
physical_device,
|
||||
format_info,
|
||||
image_format_prop,
|
||||
)
|
||||
.result()
|
||||
}
|
||||
|
||||
/// Retrieve the number of elements to pass to [`get_physical_device_queue_family_properties2()`][Self::get_physical_device_queue_family_properties2()]
|
||||
|
@ -166,12 +176,13 @@ impl Instance {
|
|||
physical_device: vk::PhysicalDevice,
|
||||
) -> usize {
|
||||
let mut queue_count = 0;
|
||||
self.instance_fn_1_1
|
||||
.get_physical_device_queue_family_properties2(
|
||||
physical_device,
|
||||
&mut queue_count,
|
||||
ptr::null_mut(),
|
||||
);
|
||||
(self
|
||||
.instance_fn_1_1
|
||||
.get_physical_device_queue_family_properties2)(
|
||||
physical_device,
|
||||
&mut queue_count,
|
||||
ptr::null_mut(),
|
||||
);
|
||||
queue_count as usize
|
||||
}
|
||||
|
||||
|
@ -185,12 +196,13 @@ impl Instance {
|
|||
out: &mut [vk::QueueFamilyProperties2],
|
||||
) {
|
||||
let mut count = out.len() as u32;
|
||||
self.instance_fn_1_1
|
||||
.get_physical_device_queue_family_properties2(
|
||||
physical_device,
|
||||
&mut count,
|
||||
out.as_mut_ptr(),
|
||||
);
|
||||
(self
|
||||
.instance_fn_1_1
|
||||
.get_physical_device_queue_family_properties2)(
|
||||
physical_device,
|
||||
&mut count,
|
||||
out.as_mut_ptr(),
|
||||
);
|
||||
assert_eq!(count as usize, out.len());
|
||||
}
|
||||
|
||||
|
@ -200,8 +212,7 @@ impl Instance {
|
|||
physical_device: vk::PhysicalDevice,
|
||||
out: &mut vk::PhysicalDeviceMemoryProperties2,
|
||||
) {
|
||||
self.instance_fn_1_1
|
||||
.get_physical_device_memory_properties2(physical_device, out);
|
||||
(self.instance_fn_1_1.get_physical_device_memory_properties2)(physical_device, out);
|
||||
}
|
||||
|
||||
/// Retrieve the number of elements to pass to [`get_physical_device_sparse_image_format_properties2()`][Self::get_physical_device_sparse_image_format_properties2()]
|
||||
|
@ -211,13 +222,14 @@ impl Instance {
|
|||
format_info: &vk::PhysicalDeviceSparseImageFormatInfo2,
|
||||
) -> usize {
|
||||
let mut format_count = 0;
|
||||
self.instance_fn_1_1
|
||||
.get_physical_device_sparse_image_format_properties2(
|
||||
physical_device,
|
||||
format_info,
|
||||
&mut format_count,
|
||||
ptr::null_mut(),
|
||||
);
|
||||
(self
|
||||
.instance_fn_1_1
|
||||
.get_physical_device_sparse_image_format_properties2)(
|
||||
physical_device,
|
||||
format_info,
|
||||
&mut format_count,
|
||||
ptr::null_mut(),
|
||||
);
|
||||
format_count as usize
|
||||
}
|
||||
|
||||
|
@ -232,13 +244,14 @@ impl Instance {
|
|||
out: &mut [vk::SparseImageFormatProperties2],
|
||||
) {
|
||||
let mut count = out.len() as u32;
|
||||
self.instance_fn_1_1
|
||||
.get_physical_device_sparse_image_format_properties2(
|
||||
physical_device,
|
||||
format_info,
|
||||
&mut count,
|
||||
out.as_mut_ptr(),
|
||||
);
|
||||
(self
|
||||
.instance_fn_1_1
|
||||
.get_physical_device_sparse_image_format_properties2)(
|
||||
physical_device,
|
||||
format_info,
|
||||
&mut count,
|
||||
out.as_mut_ptr(),
|
||||
);
|
||||
assert_eq!(count as usize, out.len());
|
||||
}
|
||||
|
||||
|
@ -249,12 +262,13 @@ impl Instance {
|
|||
external_buffer_info: &vk::PhysicalDeviceExternalBufferInfo,
|
||||
out: &mut vk::ExternalBufferProperties,
|
||||
) {
|
||||
self.instance_fn_1_1
|
||||
.get_physical_device_external_buffer_properties(
|
||||
physical_device,
|
||||
external_buffer_info,
|
||||
out,
|
||||
);
|
||||
(self
|
||||
.instance_fn_1_1
|
||||
.get_physical_device_external_buffer_properties)(
|
||||
physical_device,
|
||||
external_buffer_info,
|
||||
out,
|
||||
);
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceExternalFenceProperties.html>
|
||||
|
@ -264,12 +278,13 @@ impl Instance {
|
|||
external_fence_info: &vk::PhysicalDeviceExternalFenceInfo,
|
||||
out: &mut vk::ExternalFenceProperties,
|
||||
) {
|
||||
self.instance_fn_1_1
|
||||
.get_physical_device_external_fence_properties(
|
||||
physical_device,
|
||||
external_fence_info,
|
||||
out,
|
||||
);
|
||||
(self
|
||||
.instance_fn_1_1
|
||||
.get_physical_device_external_fence_properties)(
|
||||
physical_device,
|
||||
external_fence_info,
|
||||
out,
|
||||
);
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceExternalSemaphoreProperties.html>
|
||||
|
@ -279,12 +294,13 @@ impl Instance {
|
|||
external_semaphore_info: &vk::PhysicalDeviceExternalSemaphoreInfo,
|
||||
out: &mut vk::ExternalSemaphoreProperties,
|
||||
) {
|
||||
self.instance_fn_1_1
|
||||
.get_physical_device_external_semaphore_properties(
|
||||
physical_device,
|
||||
external_semaphore_info,
|
||||
out,
|
||||
);
|
||||
(self
|
||||
.instance_fn_1_1
|
||||
.get_physical_device_external_semaphore_properties)(
|
||||
physical_device,
|
||||
external_semaphore_info,
|
||||
out,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -308,14 +324,13 @@ impl Instance {
|
|||
allocation_callbacks: Option<&vk::AllocationCallbacks>,
|
||||
) -> VkResult<Device> {
|
||||
let mut device = mem::zeroed();
|
||||
self.instance_fn_1_0
|
||||
.create_device(
|
||||
physical_device,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut device,
|
||||
)
|
||||
.result()?;
|
||||
(self.instance_fn_1_0.create_device)(
|
||||
physical_device,
|
||||
create_info,
|
||||
allocation_callbacks.as_raw_ptr(),
|
||||
&mut device,
|
||||
)
|
||||
.result()?;
|
||||
Ok(Device::load(&self.instance_fn_1_0, device))
|
||||
}
|
||||
|
||||
|
@ -325,13 +340,12 @@ impl Instance {
|
|||
device: vk::Device,
|
||||
p_name: *const c_char,
|
||||
) -> vk::PFN_vkVoidFunction {
|
||||
self.instance_fn_1_0.get_device_proc_addr(device, p_name)
|
||||
(self.instance_fn_1_0.get_device_proc_addr)(device, p_name)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyInstance.html>
|
||||
pub unsafe fn destroy_instance(&self, allocation_callbacks: Option<&vk::AllocationCallbacks>) {
|
||||
self.instance_fn_1_0
|
||||
.destroy_instance(self.handle(), allocation_callbacks.as_raw_ptr());
|
||||
(self.instance_fn_1_0.destroy_instance)(self.handle(), allocation_callbacks.as_raw_ptr());
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceFormatProperties.html>
|
||||
|
@ -341,7 +355,7 @@ impl Instance {
|
|||
format: vk::Format,
|
||||
) -> vk::FormatProperties {
|
||||
let mut format_prop = mem::zeroed();
|
||||
self.instance_fn_1_0.get_physical_device_format_properties(
|
||||
(self.instance_fn_1_0.get_physical_device_format_properties)(
|
||||
physical_device,
|
||||
format,
|
||||
&mut format_prop,
|
||||
|
@ -360,17 +374,18 @@ impl Instance {
|
|||
flags: vk::ImageCreateFlags,
|
||||
) -> VkResult<vk::ImageFormatProperties> {
|
||||
let mut image_format_prop = mem::zeroed();
|
||||
self.instance_fn_1_0
|
||||
.get_physical_device_image_format_properties(
|
||||
physical_device,
|
||||
format,
|
||||
typ,
|
||||
tiling,
|
||||
usage,
|
||||
flags,
|
||||
&mut image_format_prop,
|
||||
)
|
||||
.result_with_success(image_format_prop)
|
||||
(self
|
||||
.instance_fn_1_0
|
||||
.get_physical_device_image_format_properties)(
|
||||
physical_device,
|
||||
format,
|
||||
typ,
|
||||
tiling,
|
||||
usage,
|
||||
flags,
|
||||
&mut image_format_prop,
|
||||
)
|
||||
.result_with_success(image_format_prop)
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceMemoryProperties.html>
|
||||
|
@ -379,8 +394,10 @@ impl Instance {
|
|||
physical_device: vk::PhysicalDevice,
|
||||
) -> vk::PhysicalDeviceMemoryProperties {
|
||||
let mut memory_prop = mem::zeroed();
|
||||
self.instance_fn_1_0
|
||||
.get_physical_device_memory_properties(physical_device, &mut memory_prop);
|
||||
(self.instance_fn_1_0.get_physical_device_memory_properties)(
|
||||
physical_device,
|
||||
&mut memory_prop,
|
||||
);
|
||||
memory_prop
|
||||
}
|
||||
|
||||
|
@ -390,8 +407,7 @@ impl Instance {
|
|||
physical_device: vk::PhysicalDevice,
|
||||
) -> vk::PhysicalDeviceProperties {
|
||||
let mut prop = mem::zeroed();
|
||||
self.instance_fn_1_0
|
||||
.get_physical_device_properties(physical_device, &mut prop);
|
||||
(self.instance_fn_1_0.get_physical_device_properties)(physical_device, &mut prop);
|
||||
prop
|
||||
}
|
||||
|
||||
|
@ -401,8 +417,11 @@ impl Instance {
|
|||
physical_device: vk::PhysicalDevice,
|
||||
) -> Vec<vk::QueueFamilyProperties> {
|
||||
read_into_uninitialized_vector(|count, data| {
|
||||
self.instance_fn_1_0
|
||||
.get_physical_device_queue_family_properties(physical_device, count, data);
|
||||
(self
|
||||
.instance_fn_1_0
|
||||
.get_physical_device_queue_family_properties)(
|
||||
physical_device, count, data
|
||||
);
|
||||
vk::Result::SUCCESS
|
||||
})
|
||||
// The closure always returns SUCCESS
|
||||
|
@ -415,16 +434,14 @@ impl Instance {
|
|||
physical_device: vk::PhysicalDevice,
|
||||
) -> vk::PhysicalDeviceFeatures {
|
||||
let mut prop = mem::zeroed();
|
||||
self.instance_fn_1_0
|
||||
.get_physical_device_features(physical_device, &mut prop);
|
||||
(self.instance_fn_1_0.get_physical_device_features)(physical_device, &mut prop);
|
||||
prop
|
||||
}
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkEnumeratePhysicalDevices.html>
|
||||
pub unsafe fn enumerate_physical_devices(&self) -> VkResult<Vec<vk::PhysicalDevice>> {
|
||||
read_into_uninitialized_vector(|count, data| {
|
||||
self.instance_fn_1_0
|
||||
.enumerate_physical_devices(self.handle(), count, data)
|
||||
(self.instance_fn_1_0.enumerate_physical_devices)(self.handle(), count, data)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -434,7 +451,7 @@ impl Instance {
|
|||
device: vk::PhysicalDevice,
|
||||
) -> VkResult<Vec<vk::ExtensionProperties>> {
|
||||
read_into_uninitialized_vector(|count, data| {
|
||||
self.instance_fn_1_0.enumerate_device_extension_properties(
|
||||
(self.instance_fn_1_0.enumerate_device_extension_properties)(
|
||||
device,
|
||||
ptr::null(),
|
||||
count,
|
||||
|
@ -449,8 +466,7 @@ impl Instance {
|
|||
device: vk::PhysicalDevice,
|
||||
) -> VkResult<Vec<vk::LayerProperties>> {
|
||||
read_into_uninitialized_vector(|count, data| {
|
||||
self.instance_fn_1_0
|
||||
.enumerate_device_layer_properties(device, count, data)
|
||||
(self.instance_fn_1_0.enumerate_device_layer_properties)(device, count, data)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -465,17 +481,18 @@ impl Instance {
|
|||
tiling: vk::ImageTiling,
|
||||
) -> Vec<vk::SparseImageFormatProperties> {
|
||||
read_into_uninitialized_vector(|count, data| {
|
||||
self.instance_fn_1_0
|
||||
.get_physical_device_sparse_image_format_properties(
|
||||
physical_device,
|
||||
format,
|
||||
typ,
|
||||
samples,
|
||||
usage,
|
||||
tiling,
|
||||
count,
|
||||
data,
|
||||
);
|
||||
(self
|
||||
.instance_fn_1_0
|
||||
.get_physical_device_sparse_image_format_properties)(
|
||||
physical_device,
|
||||
format,
|
||||
typ,
|
||||
samples,
|
||||
usage,
|
||||
tiling,
|
||||
count,
|
||||
data,
|
||||
);
|
||||
vk::Result::SUCCESS
|
||||
})
|
||||
// The closure always returns SUCCESS
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -725,7 +725,6 @@ fn generate_function_pointers<'a>(
|
|||
type_name: Ident,
|
||||
function_name_c: String,
|
||||
function_name_rust: Ident,
|
||||
parameter_names: TokenStream,
|
||||
parameters: TokenStream,
|
||||
parameters_unused: TokenStream,
|
||||
returns: TokenStream,
|
||||
|
@ -760,9 +759,6 @@ fn generate_function_pointers<'a>(
|
|||
})
|
||||
.collect();
|
||||
|
||||
let params_iter = params.iter().map(|(param_name, _)| param_name);
|
||||
let parameter_names = quote!(#(#params_iter,)*);
|
||||
|
||||
let params_iter = params
|
||||
.iter()
|
||||
.map(|(param_name, param_ty)| quote!(#param_name: #param_ty));
|
||||
|
@ -781,7 +777,6 @@ fn generate_function_pointers<'a>(
|
|||
type_name,
|
||||
function_name_c,
|
||||
function_name_rust,
|
||||
parameter_names,
|
||||
parameters,
|
||||
parameters_unused,
|
||||
returns: if cmd.return_type.is_void() {
|
||||
|
@ -852,31 +847,12 @@ fn generate_function_pointers<'a>(
|
|||
}
|
||||
}
|
||||
|
||||
struct CommandToBody<'a>(&'a Command);
|
||||
impl<'a> quote::ToTokens for CommandToBody<'a> {
|
||||
fn to_tokens(&self, tokens: &mut TokenStream) {
|
||||
let function_name_rust = &self.0.function_name_rust;
|
||||
let parameters = &self.0.parameters;
|
||||
let parameter_names = &self.0.parameter_names;
|
||||
let returns = &self.0.returns;
|
||||
let khronos_link = khronos_link(&self.0.function_name_c);
|
||||
quote!(
|
||||
#[doc = #khronos_link]
|
||||
pub unsafe fn #function_name_rust(&self, #parameters) #returns {
|
||||
(self.#function_name_rust)(#parameter_names)
|
||||
}
|
||||
)
|
||||
.to_tokens(tokens)
|
||||
}
|
||||
}
|
||||
|
||||
let pfn_typedefs = commands
|
||||
.iter()
|
||||
.filter(|pfn| pfn.type_needs_defining)
|
||||
.map(CommandToType);
|
||||
let members = commands.iter().map(CommandToMember);
|
||||
let loaders = commands.iter().map(CommandToLoader);
|
||||
let bodies = commands.iter().map(CommandToBody);
|
||||
|
||||
quote! {
|
||||
#(#pfn_typedefs)*
|
||||
|
@ -897,7 +873,6 @@ fn generate_function_pointers<'a>(
|
|||
#(#loaders,)*
|
||||
}
|
||||
}
|
||||
#(#bodies)*
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue