Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extensions: Inline all trivial functions #638

Merged
merged 4 commits into from
Jul 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ash/src/extensions/ext/buffer_device_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,25 @@ impl BufferDeviceAddress {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetBufferDeviceAddressEXT.html>
#[inline]
pub unsafe fn get_buffer_device_address(
&self,
info: &vk::BufferDeviceAddressInfoEXT,
) -> vk::DeviceAddress {
(self.fp.get_buffer_device_address_ext)(self.handle, info)
}

#[inline]
pub const fn name() -> &'static CStr {
vk::ExtBufferDeviceAddressFn::name()
}

#[inline]
pub fn fp(&self) -> &vk::ExtBufferDeviceAddressFn {
&self.fp
}

#[inline]
pub fn device(&self) -> vk::Device {
self.handle
}
Expand Down
5 changes: 5 additions & 0 deletions ash/src/extensions/ext/calibrated_timestamps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ impl CalibratedTimestamps {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceCalibrateableTimeDomainsEXT.html>
#[inline]
pub unsafe fn get_physical_device_calibrateable_time_domains(
&self,
physical_device: vk::PhysicalDevice,
Expand All @@ -36,6 +37,7 @@ impl CalibratedTimestamps {
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetCalibratedTimestampsEXT.html>
///
/// Returns a tuple containing `(timestamps, max_deviation)`
#[inline]
pub unsafe fn get_calibrated_timestamps(
&self,
device: vk::Device,
Expand All @@ -53,14 +55,17 @@ impl CalibratedTimestamps {
.result_with_success((timestamps, max_deviation))
}

#[inline]
pub const fn name() -> &'static CStr {
vk::ExtCalibratedTimestampsFn::name()
}

#[inline]
pub fn fp(&self) -> &vk::ExtCalibratedTimestampsFn {
&self.fp
}

#[inline]
pub fn instance(&self) -> vk::Instance {
self.handle
}
Expand Down
7 changes: 7 additions & 0 deletions ash/src/extensions/ext/debug_marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ impl DebugMarker {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDebugMarkerSetObjectNameEXT.html>
#[inline]
pub unsafe fn debug_marker_set_object_name(
&self,
name_info: &vk::DebugMarkerObjectNameInfoEXT,
Expand All @@ -28,6 +29,7 @@ impl DebugMarker {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDebugMarkerBeginEXT.html>
#[inline]
pub unsafe fn cmd_debug_marker_begin(
&self,
command_buffer: vk::CommandBuffer,
Expand All @@ -37,11 +39,13 @@ impl DebugMarker {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDebugMarkerEndEXT.html>
#[inline]
pub unsafe fn cmd_debug_marker_end(&self, command_buffer: vk::CommandBuffer) {
(self.fp.cmd_debug_marker_end_ext)(command_buffer);
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDebugMarkerInsertEXT.html>
#[inline]
pub unsafe fn cmd_debug_marker_insert(
&self,
command_buffer: vk::CommandBuffer,
Expand All @@ -50,14 +54,17 @@ impl DebugMarker {
(self.fp.cmd_debug_marker_insert_ext)(command_buffer, marker_info);
}

#[inline]
pub const fn name() -> &'static CStr {
vk::ExtDebugMarkerFn::name()
}

#[inline]
pub fn fp(&self) -> &vk::ExtDebugMarkerFn {
&self.fp
}

#[inline]
pub fn device(&self) -> vk::Device {
self.handle
}
Expand Down
5 changes: 5 additions & 0 deletions ash/src/extensions/ext/debug_report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ impl DebugReport {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyDebugReportCallbackEXT.html>
#[inline]
pub unsafe fn destroy_debug_report_callback(
&self,
debug: vk::DebugReportCallbackEXT,
Expand All @@ -34,6 +35,7 @@ impl DebugReport {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateDebugReportCallbackEXT.html>
#[inline]
pub unsafe fn create_debug_report_callback(
&self,
create_info: &vk::DebugReportCallbackCreateInfoEXT,
Expand All @@ -49,14 +51,17 @@ impl DebugReport {
.result_with_success(debug_cb)
}

#[inline]
pub const fn name() -> &'static CStr {
vk::ExtDebugReportFn::name()
}

#[inline]
pub fn fp(&self) -> &vk::ExtDebugReportFn {
&self.fp
}

#[inline]
pub fn instance(&self) -> vk::Instance {
self.handle
}
Expand Down
14 changes: 14 additions & 0 deletions ash/src/extensions/ext/debug_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ impl DebugUtils {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkSetDebugUtilsObjectNameEXT.html>
#[inline]
pub unsafe fn debug_utils_set_object_name(
&self,
device: vk::Device,
Expand All @@ -29,6 +30,7 @@ impl DebugUtils {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkSetDebugUtilsObjectTagEXT.html>
#[inline]
pub unsafe fn debug_utils_set_object_tag(
&self,
device: vk::Device,
Expand All @@ -38,6 +40,7 @@ impl DebugUtils {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBeginDebugUtilsLabelEXT.html>
#[inline]
pub unsafe fn cmd_begin_debug_utils_label(
&self,
command_buffer: vk::CommandBuffer,
Expand All @@ -47,11 +50,13 @@ impl DebugUtils {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdEndDebugUtilsLabelEXT.html>
#[inline]
pub unsafe fn cmd_end_debug_utils_label(&self, command_buffer: vk::CommandBuffer) {
(self.fp.cmd_end_debug_utils_label_ext)(command_buffer);
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdInsertDebugUtilsLabelEXT.html>
#[inline]
pub unsafe fn cmd_insert_debug_utils_label(
&self,
command_buffer: vk::CommandBuffer,
Expand All @@ -61,6 +66,7 @@ impl DebugUtils {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueueBeginDebugUtilsLabelEXT.html>
#[inline]
pub unsafe fn queue_begin_debug_utils_label(
&self,
queue: vk::Queue,
Expand All @@ -70,11 +76,13 @@ impl DebugUtils {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueueEndDebugUtilsLabelEXT.html>
#[inline]
pub unsafe fn queue_end_debug_utils_label(&self, queue: vk::Queue) {
(self.fp.queue_end_debug_utils_label_ext)(queue);
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueueInsertDebugUtilsLabelEXT.html>
#[inline]
pub unsafe fn queue_insert_debug_utils_label(
&self,
queue: vk::Queue,
Expand All @@ -84,6 +92,7 @@ impl DebugUtils {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateDebugUtilsMessengerEXT.html>
#[inline]
pub unsafe fn create_debug_utils_messenger(
&self,
create_info: &vk::DebugUtilsMessengerCreateInfoEXT,
Expand All @@ -100,6 +109,7 @@ impl DebugUtils {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyDebugUtilsMessengerEXT.html>
#[inline]
pub unsafe fn destroy_debug_utils_messenger(
&self,
messenger: vk::DebugUtilsMessengerEXT,
Expand All @@ -109,6 +119,7 @@ impl DebugUtils {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkSubmitDebugUtilsMessageEXT.html>
#[inline]
pub unsafe fn submit_debug_utils_message(
&self,
message_severity: vk::DebugUtilsMessageSeverityFlagsEXT,
Expand All @@ -123,14 +134,17 @@ impl DebugUtils {
);
}

#[inline]
pub const fn name() -> &'static CStr {
vk::ExtDebugUtilsFn::name()
}

#[inline]
pub fn fp(&self) -> &vk::ExtDebugUtilsFn {
&self.fp
}

#[inline]
pub fn instance(&self) -> vk::Instance {
self.handle
}
Expand Down
14 changes: 14 additions & 0 deletions ash/src/extensions/ext/extended_dynamic_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ impl ExtendedDynamicState {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetCullModeEXT.html>
#[inline]
pub unsafe fn cmd_set_cull_mode(
&self,
command_buffer: vk::CommandBuffer,
Expand All @@ -27,6 +28,7 @@ impl ExtendedDynamicState {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetFrontFaceEXT.html>
#[inline]
pub unsafe fn cmd_set_front_face(
&self,
command_buffer: vk::CommandBuffer,
Expand All @@ -36,6 +38,7 @@ impl ExtendedDynamicState {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetPrimitiveTopologyEXT.html>
#[inline]
pub unsafe fn cmd_set_primitive_topology(
&self,
command_buffer: vk::CommandBuffer,
Expand All @@ -45,6 +48,7 @@ impl ExtendedDynamicState {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetViewportWithCountEXT.html>
#[inline]
pub unsafe fn cmd_set_viewport_with_count(
&self,
command_buffer: vk::CommandBuffer,
Expand All @@ -58,6 +62,7 @@ impl ExtendedDynamicState {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetScissorWithCountEXT.html>
#[inline]
pub unsafe fn cmd_set_scissor_with_count(
&self,
command_buffer: vk::CommandBuffer,
Expand All @@ -71,6 +76,7 @@ impl ExtendedDynamicState {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBindVertexBuffers2EXT.html>
#[inline]
pub unsafe fn cmd_bind_vertex_buffers2(
&self,
command_buffer: vk::CommandBuffer,
Expand Down Expand Up @@ -105,6 +111,7 @@ impl ExtendedDynamicState {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthTestEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_depth_test_enable(
&self,
command_buffer: vk::CommandBuffer,
Expand All @@ -114,6 +121,7 @@ impl ExtendedDynamicState {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthWriteEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_depth_write_enable(
&self,
command_buffer: vk::CommandBuffer,
Expand All @@ -123,6 +131,7 @@ impl ExtendedDynamicState {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthCompareOpEXT.html>
#[inline]
pub unsafe fn cmd_set_depth_compare_op(
&self,
command_buffer: vk::CommandBuffer,
Expand All @@ -132,6 +141,7 @@ impl ExtendedDynamicState {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthBoundsTestEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_depth_bounds_test_enable(
&self,
command_buffer: vk::CommandBuffer,
Expand All @@ -144,6 +154,7 @@ impl ExtendedDynamicState {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetStencilTestEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_stencil_test_enable(
&self,
command_buffer: vk::CommandBuffer,
Expand All @@ -153,6 +164,7 @@ impl ExtendedDynamicState {
}

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetStencilOpEXT.html>
#[inline]
pub unsafe fn cmd_set_stencil_op(
&self,
command_buffer: vk::CommandBuffer,
Expand All @@ -172,10 +184,12 @@ impl ExtendedDynamicState {
)
}

#[inline]
pub const fn name() -> &'static CStr {
vk::ExtExtendedDynamicStateFn::name()
}

#[inline]
pub fn fp(&self) -> &vk::ExtExtendedDynamicStateFn {
&self.fp
}
Expand Down
Loading