extensions/amd: Add VK_AMD_buffer_marker (#772)
This commit is contained in:
parent
010df1b1b3
commit
884ac46e82
|
@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- Added `VK_NV_memory_decompression` device extension (#761)
|
||||
- Added `VK_GOOGLE_display_timing` device extension (#765)
|
||||
- Added `VK_ANDROID_external_memory_android_hardware_buffer` device extension (#769)
|
||||
- Added `VK_AMD_buffer_marker` device extension (#772)
|
||||
|
||||
### Changed
|
||||
|
||||
|
|
45
ash/src/extensions/amd/buffer_marker.rs
Normal file
45
ash/src/extensions/amd/buffer_marker.rs
Normal file
|
@ -0,0 +1,45 @@
|
|||
use crate::vk;
|
||||
use crate::{Device, Instance};
|
||||
use std::ffi::CStr;
|
||||
use std::mem;
|
||||
|
||||
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_AMD_buffer_marker.html>
|
||||
#[derive(Clone)]
|
||||
pub struct BufferMarker {
|
||||
fp: vk::AmdBufferMarkerFn,
|
||||
}
|
||||
|
||||
impl BufferMarker {
|
||||
pub fn new(instance: &Instance, device: &Device) -> Self {
|
||||
let fp = vk::AmdBufferMarkerFn::load(|name| unsafe {
|
||||
mem::transmute(instance.get_device_proc_addr(device.handle(), name.as_ptr()))
|
||||
});
|
||||
Self { fp }
|
||||
}
|
||||
|
||||
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdWriteBufferMarkerAMD.html>
|
||||
#[inline]
|
||||
pub unsafe fn cmd_write_buffer_marker(
|
||||
&self,
|
||||
command_buffer: vk::CommandBuffer,
|
||||
pipeline_stage: vk::PipelineStageFlags,
|
||||
dst_buffer: vk::Buffer,
|
||||
dst_offset: vk::DeviceSize,
|
||||
marker: u32,
|
||||
) {
|
||||
(self.fp.cmd_write_buffer_marker_amd)(
|
||||
command_buffer,
|
||||
pipeline_stage,
|
||||
dst_buffer,
|
||||
dst_offset,
|
||||
marker,
|
||||
)
|
||||
}
|
||||
|
||||
pub const NAME: &'static CStr = vk::AmdBufferMarkerFn::NAME;
|
||||
|
||||
#[inline]
|
||||
pub fn fp(&self) -> &vk::AmdBufferMarkerFn {
|
||||
&self.fp
|
||||
}
|
||||
}
|
3
ash/src/extensions/amd/mod.rs
Normal file
3
ash/src/extensions/amd/mod.rs
Normal file
|
@ -0,0 +1,3 @@
|
|||
pub use self::buffer_marker::BufferMarker;
|
||||
|
||||
mod buffer_marker;
|
|
@ -1,3 +1,4 @@
|
|||
pub mod amd;
|
||||
pub mod android;
|
||||
pub mod ext;
|
||||
pub mod google;
|
||||
|
|
Loading…
Reference in a new issue