extensions/khr: Add VK_KHR_cooperative_matrix (#782)
This commit is contained in:
parent
3fa908c70a
commit
39dc6d607c
|
@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- Added `VK_EXT_host_image_copy` device extension (#779)
|
||||
- Added `VK_KHR_maintenance5` device extension (#780)
|
||||
- Added `VK_NV_device_generated_commands_compute` device extension (#781)
|
||||
- Added `VK_KHR_cooperative_matrix` instance extension (#782)
|
||||
|
||||
### Changed
|
||||
|
||||
|
|
45
ash/src/extensions/khr/cooperative_matrix.rs
Normal file
45
ash/src/extensions/khr/cooperative_matrix.rs
Normal file
|
@ -0,0 +1,45 @@
|
|||
use crate::prelude::*;
|
||||
use crate::vk;
|
||||
use crate::{Entry, Instance};
|
||||
use std::ffi::CStr;
|
||||
use std::mem;
|
||||
|
||||
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VK_KHR_cooperative_matrix.html>
|
||||
#[derive(Clone)]
|
||||
pub struct CooperativeMatrix {
|
||||
fp: vk::KhrCooperativeMatrixFn,
|
||||
}
|
||||
|
||||
impl CooperativeMatrix {
|
||||
pub fn new(entry: &Entry, instance: &Instance) -> Self {
|
||||
let handle = instance.handle();
|
||||
let fp = vk::KhrCooperativeMatrixFn::load(|name| unsafe {
|
||||
mem::transmute(entry.get_instance_proc_addr(handle, name.as_ptr()))
|
||||
});
|
||||
Self { fp }
|
||||
}
|
||||
|
||||
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR.html>
|
||||
#[inline]
|
||||
pub unsafe fn get_physical_device_cooperative_matrix_properties(
|
||||
&self,
|
||||
physical_device: vk::PhysicalDevice,
|
||||
) -> VkResult<Vec<vk::CooperativeMatrixPropertiesKHR>> {
|
||||
read_into_defaulted_vector(|count, data| {
|
||||
(self
|
||||
.fp
|
||||
.get_physical_device_cooperative_matrix_properties_khr)(
|
||||
physical_device,
|
||||
count,
|
||||
data,
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
pub const NAME: &'static CStr = vk::KhrCooperativeMatrixFn::NAME;
|
||||
|
||||
#[inline]
|
||||
pub fn fp(&self) -> &vk::KhrCooperativeMatrixFn {
|
||||
&self.fp
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
pub use self::acceleration_structure::AccelerationStructure;
|
||||
pub use self::android_surface::AndroidSurface;
|
||||
pub use self::buffer_device_address::BufferDeviceAddress;
|
||||
pub use self::cooperative_matrix::CooperativeMatrix;
|
||||
pub use self::copy_commands2::CopyCommands2;
|
||||
pub use self::create_render_pass2::CreateRenderPass2;
|
||||
pub use self::deferred_host_operations::DeferredHostOperations;
|
||||
|
@ -41,6 +42,7 @@ pub use self::xlib_surface::XlibSurface;
|
|||
mod acceleration_structure;
|
||||
mod android_surface;
|
||||
mod buffer_device_address;
|
||||
mod cooperative_matrix;
|
||||
mod copy_commands2;
|
||||
mod create_render_pass2;
|
||||
mod deferred_host_operations;
|
||||
|
|
Loading…
Reference in a new issue