objc2_metal/generated/
MTL4CommitFeedback.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12/// Defines the block signature for a callback Metal invokes to provide your app feedback after completing a workload.
13///
14/// You register a commit feedback block with Metal by providing an instance of ``MTL4CommitOptions`` to
15/// the command queue's commit method, ``MTL4CommandQueue/commit:count:options:``. The commit options instance
16/// references your commit feedback handler after you add it via its ``MTL4CommitOptions/addFeedbackHandler:``
17/// method.
18///
19/// - Parameter commitFeedback: a commit feedback instance containing information about the workload.
20///
21/// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtl4commitfeedbackhandler?language=objc)
22#[cfg(feature = "block2")]
23pub type MTL4CommitFeedbackHandler =
24    *mut block2::DynBlock<dyn Fn(NonNull<ProtocolObject<dyn MTL4CommitFeedback>>)>;
25
26extern_protocol!(
27    /// Describes an object containing debug information from Metal to your app after completing a workload.
28    ///
29    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtl4commitfeedback?language=objc)
30    pub unsafe trait MTL4CommitFeedback: NSObjectProtocol {
31        /// A description of an error when the GPU encounters an issue as it runs the committed command buffers.
32        #[unsafe(method(error))]
33        #[unsafe(method_family = none)]
34        fn error(&self) -> Option<Retained<NSError>>;
35
36        #[cfg(feature = "objc2-core-foundation")]
37        /// The host time, in seconds, when the GPU starts execution of the committed command buffers.
38        #[unsafe(method(GPUStartTime))]
39        #[unsafe(method_family = none)]
40        fn GPUStartTime(&self) -> CFTimeInterval;
41
42        #[cfg(feature = "objc2-core-foundation")]
43        /// The host time, in seconds, when the GPU finishes execution of the committed command buffers.
44        #[unsafe(method(GPUEndTime))]
45        #[unsafe(method_family = none)]
46        fn GPUEndTime(&self) -> CFTimeInterval;
47    }
48);