Skip to content

Commit

Permalink
Manual fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
MarijnS95 committed Aug 28, 2023
1 parent cc1c114 commit bf94149
Show file tree
Hide file tree
Showing 77 changed files with 225 additions and 241 deletions.
4 changes: 2 additions & 2 deletions ash/src/extensions/amd/buffer_marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ use crate::{Device, Instance};
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::amd_buffer_marker::NAME;

/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_AMD_buffer_marker.html>
#[derive(Clone)]
pub struct BufferMarker {
Expand Down Expand Up @@ -36,8 +38,6 @@ impl BufferMarker {
)
}

pub const NAME: &'static CStr = vk::amd_buffer_marker::DeviceFn::NAME;

#[inline]
pub fn fp(&self) -> &vk::amd_buffer_marker::DeviceFn {
&self.fp
Expand Down
4 changes: 2 additions & 2 deletions ash/src/extensions/amd/shader_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use crate::{Device, Instance};
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::amd_shader_info::NAME;

/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_AMD_shader_info.html>
#[derive(Clone)]
pub struct ShaderInfo {
Expand Down Expand Up @@ -64,8 +66,6 @@ impl ShaderInfo {
}
}

pub const NAME: &'static CStr = vk::amd_shader_info::DeviceFn::NAME;

#[inline]
pub fn fp(&self) -> &vk::amd_shader_info::DeviceFn {
&self.fp
Expand Down
4 changes: 2 additions & 2 deletions ash/src/extensions/amdx/shader_enqueue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ use crate::{Device, Instance};
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::amdx_shader_enqueue::NAME;

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VK_AMDX_shader_enqueue.html>
#[derive(Clone)]
pub struct ShaderEnqueue {
Expand Down Expand Up @@ -116,8 +118,6 @@ impl ShaderEnqueue {
(self.fp.cmd_dispatch_graph_indirect_count_amdx)(command_buffer, scratch, count_info)
}

pub const NAME: &'static CStr = vk::amdx_shader_enqueue::DeviceFn::NAME;

#[inline]
pub fn fp(&self) -> &vk::amdx_shader_enqueue::DeviceFn {
&self.fp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use crate::{Device, Instance};
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::android_external_memory_android_hardware_buffer::NAME;

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VK_ANDROID_external_memory_android_hardware_buffer.html>
#[derive(Clone)]
pub struct ExternalMemoryAndroidHardwareBuffer {
Expand Down Expand Up @@ -43,9 +45,6 @@ impl ExternalMemoryAndroidHardwareBuffer {
.result_with_success(buffer)
}

pub const NAME: &'static CStr =
vk::android_external_memory_android_hardware_buffer::DeviceFn::NAME;

#[inline]
pub fn fp(&self) -> &vk::android_external_memory_android_hardware_buffer::DeviceFn {
&self.fp
Expand Down
10 changes: 5 additions & 5 deletions ash/src/extensions/ext/acquire_drm_display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ use crate::{Entry, Instance};
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::ext_acquire_drm_display::NAME;

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VK_EXT_acquire_drm_display.html>
#[derive(Clone)]
pub struct AcquireDrmDisplay {
fp: vk::ext_acquire_drm_display::DeviceFn,
fp: vk::ext_acquire_drm_display::InstanceFn,
}

impl AcquireDrmDisplay {
pub fn new(entry: &Entry, instance: &Instance) -> Self {
let handle = instance.handle();
let fp = vk::ext_acquire_drm_display::DeviceFn::load(|name| unsafe {
let fp = vk::ext_acquire_drm_display::InstanceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(handle, name.as_ptr()))
});
Self { fp }
Expand Down Expand Up @@ -43,10 +45,8 @@ impl AcquireDrmDisplay {
.assume_init_on_success(display)
}

pub const NAME: &'static CStr = vk::ext_acquire_drm_display::DeviceFn::NAME;

#[inline]
pub fn fp(&self) -> &vk::ext_acquire_drm_display::DeviceFn {
pub fn fp(&self) -> &vk::ext_acquire_drm_display::InstanceFn {
&self.fp
}
}
5 changes: 3 additions & 2 deletions ash/src/extensions/ext/buffer_device_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ use crate::{Device, Instance};
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::ext_buffer_device_address::NAME;

/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_buffer_device_address.html>
#[derive(Clone)]
pub struct BufferDeviceAddress {
handle: vk::Device,
Expand All @@ -27,8 +30,6 @@ impl BufferDeviceAddress {
(self.fp.get_buffer_device_address_ext)(self.handle, info)
}

pub const NAME: &'static CStr = vk::ext_buffer_device_address::DeviceFn::NAME;

#[inline]
pub fn fp(&self) -> &vk::ext_buffer_device_address::DeviceFn {
&self.fp
Expand Down
2 changes: 1 addition & 1 deletion ash/src/extensions/ext/calibrated_timestamps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::{Device, Entry, Instance};
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::ext_calibrated_timestamps::InstanceFn::NAME;
pub const NAME: &CStr = vk::ext_calibrated_timestamps::NAME;

/// High-level device function wrapper for
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_calibrated_timestamps.html>
Expand Down
4 changes: 2 additions & 2 deletions ash/src/extensions/ext/debug_marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use crate::{Device, Instance};
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::ext_debug_marker::NAME;

#[derive(Clone)]
pub struct DebugMarker {
handle: vk::Device,
Expand Down Expand Up @@ -54,8 +56,6 @@ impl DebugMarker {
(self.fp.cmd_debug_marker_insert_ext)(command_buffer, marker_info);
}

pub const NAME: &'static CStr = vk::ext_debug_marker::DeviceFn::NAME;

#[inline]
pub fn fp(&self) -> &vk::ext_debug_marker::DeviceFn {
&self.fp
Expand Down
11 changes: 6 additions & 5 deletions ash/src/extensions/ext/debug_report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@ use crate::{Entry, Instance};
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::ext_debug_report::NAME;

/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_debug_report.html>
#[derive(Clone)]
pub struct DebugReport {
handle: vk::Instance,
fp: vk::ext_debug_report::DeviceFn,
fp: vk::ext_debug_report::InstanceFn,
}

impl DebugReport {
pub fn new(entry: &Entry, instance: &Instance) -> Self {
let handle = instance.handle();
let fp = vk::ext_debug_report::DeviceFn::load(|name| unsafe {
let fp = vk::ext_debug_report::InstanceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(handle, name.as_ptr()))
});
Self { handle, fp }
Expand Down Expand Up @@ -51,10 +54,8 @@ impl DebugReport {
.result_with_success(debug_cb)
}

pub const NAME: &'static CStr = vk::ext_debug_report::DeviceFn::NAME;

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

Expand Down
2 changes: 1 addition & 1 deletion ash/src/extensions/ext/debug_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl DebugUtilsInstance {
}

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

Expand Down
4 changes: 2 additions & 2 deletions ash/src/extensions/ext/descriptor_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use crate::{Device, Instance};
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::ext_descriptor_buffer::NAME;

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VK_EXT_descriptor_buffer.html>
#[derive(Clone)]
pub struct DescriptorBuffer {
Expand Down Expand Up @@ -194,8 +196,6 @@ impl DescriptorBuffer {
.result()
}

pub const NAME: &'static CStr = vk::ext_descriptor_buffer::DeviceFn::NAME;

#[inline]
pub fn fp(&self) -> &vk::ext_descriptor_buffer::DeviceFn {
&self.fp
Expand Down
4 changes: 2 additions & 2 deletions ash/src/extensions/ext/extended_dynamic_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use std::ffi::CStr;
use std::mem;
use std::ptr;

pub const NAME: &CStr = vk::ext_extended_dynamic_state::NAME;

#[derive(Clone)]
pub struct ExtendedDynamicState {
fp: vk::ext_extended_dynamic_state::DeviceFn,
Expand Down Expand Up @@ -184,8 +186,6 @@ impl ExtendedDynamicState {
)
}

pub const NAME: &'static CStr = vk::ext_extended_dynamic_state::DeviceFn::NAME;

#[inline]
pub fn fp(&self) -> &vk::ext_extended_dynamic_state::DeviceFn {
&self.fp
Expand Down
4 changes: 2 additions & 2 deletions ash/src/extensions/ext/extended_dynamic_state2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ use crate::{Device, Instance};
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::ext_extended_dynamic_state2::NAME;

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VK_EXT_extended_dynamic_state2.html>
#[derive(Clone)]
pub struct ExtendedDynamicState2 {
Expand Down Expand Up @@ -73,8 +75,6 @@ impl ExtendedDynamicState2 {
)
}

pub const NAME: &'static CStr = vk::ext_extended_dynamic_state2::DeviceFn::NAME;

#[inline]
pub fn fp(&self) -> &vk::ext_extended_dynamic_state2::DeviceFn {
&self.fp
Expand Down
5 changes: 2 additions & 3 deletions ash/src/extensions/ext/extended_dynamic_state3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ use crate::{Device, Instance};
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::ext_extended_dynamic_state3::NAME;

/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_extended_dynamic_state3.html>
#[derive(Clone)]
pub struct ExtendedDynamicState3 {
Expand Down Expand Up @@ -396,9 +398,6 @@ impl ExtendedDynamicState3 {
) {
(self.fp.cmd_set_coverage_reduction_mode_nv)(command_buffer, coverage_reduction_mode)
}

pub const NAME: &'static CStr = vk::ext_extended_dynamic_state3::DeviceFn::NAME;

#[inline]
pub fn fp(&self) -> &vk::ext_extended_dynamic_state3::DeviceFn {
&self.fp
Expand Down
10 changes: 5 additions & 5 deletions ash/src/extensions/ext/headless_surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@ use crate::{Entry, Instance};
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::ext_headless_surface::NAME;

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VK_EXT_headless_surface.html>
#[derive(Clone)]
pub struct HeadlessSurface {
handle: vk::Instance,
fp: vk::ext_headless_surface::DeviceFn,
fp: vk::ext_headless_surface::InstanceFn,
}

impl HeadlessSurface {
pub fn new(entry: &Entry, instance: &Instance) -> Self {
let handle = instance.handle();
let fp = vk::ext_headless_surface::DeviceFn::load(|name| unsafe {
let fp = vk::ext_headless_surface::InstanceFn::load(|name| unsafe {
mem::transmute(entry.get_instance_proc_addr(handle, name.as_ptr()))
});
Self { handle, fp }
Expand All @@ -38,10 +40,8 @@ impl HeadlessSurface {
.result_with_success(surface)
}

pub const NAME: &'static CStr = vk::ext_headless_surface::DeviceFn::NAME;

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

Expand Down
4 changes: 2 additions & 2 deletions ash/src/extensions/ext/host_image_copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ use crate::{Device, Instance};
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::ext_host_image_copy::NAME;

/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_host_image_copy.html>
#[derive(Clone)]
pub struct HostImageCopy {
Expand Down Expand Up @@ -83,8 +85,6 @@ impl HostImageCopy {
(self.fp.get_image_subresource_layout2_ext)(self.handle, image, subresource, layout)
}

pub const NAME: &'static CStr = vk::ext_host_image_copy::DeviceFn::NAME;

#[inline]
pub fn fp(&self) -> &vk::ext_host_image_copy::DeviceFn {
&self.fp
Expand Down
4 changes: 2 additions & 2 deletions ash/src/extensions/ext/image_compression_control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ use crate::{Device, Instance};
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::ext_image_compression_control::NAME;

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VK_EXT_image_compression_control.html>
#[derive(Clone)]
pub struct ImageCompressionControl {
Expand Down Expand Up @@ -41,8 +43,6 @@ impl ImageCompressionControl {
(self.fp.get_image_subresource_layout2_ext)(self.handle, image, subresource, layout)
}

pub const NAME: &'static CStr = vk::ext_image_compression_control::DeviceFn::NAME;

#[inline]
pub fn fp(&self) -> &vk::ext_image_compression_control::DeviceFn {
&self.fp
Expand Down
4 changes: 2 additions & 2 deletions ash/src/extensions/ext/image_drm_format_modifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use crate::{Device, Instance};
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::ext_image_drm_format_modifier::NAME;

/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VK_EXT_image_drm_format_modifier.html>
#[derive(Clone)]
pub struct ImageDrmFormatModifier {
Expand Down Expand Up @@ -31,8 +33,6 @@ impl ImageDrmFormatModifier {
.result()
}

pub const NAME: &'static CStr = vk::ext_image_drm_format_modifier::DeviceFn::NAME;

#[inline]
pub fn fp(&self) -> &vk::ext_image_drm_format_modifier::DeviceFn {
&self.fp
Expand Down
4 changes: 2 additions & 2 deletions ash/src/extensions/ext/mesh_shader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ use crate::{Device, Instance};
use std::ffi::CStr;
use std::mem;

pub const NAME: &CStr = vk::ext_mesh_shader::NAME;

/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_mesh_shader.html>
#[derive(Clone)]
pub struct MeshShader {
Expand Down Expand Up @@ -82,8 +84,6 @@ impl MeshShader {
);
}

pub const NAME: &'static CStr = vk::ext_mesh_shader::DeviceFn::NAME;

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

0 comments on commit bf94149

Please sign in to comment.