mtl_gpu/encoder/compute_encoder/
pipeline.rs1use std::ffi::c_void;
4
5use mtl_foundation::Referencing;
6use mtl_sys::{msg_send_0, msg_send_1, sel};
7
8use crate::enums::DispatchType;
9
10use super::ComputeCommandEncoder;
11
12impl ComputeCommandEncoder {
13 #[inline]
17 pub fn set_compute_pipeline_state(&self, state: &crate::ComputePipelineState) {
18 unsafe {
19 msg_send_1::<(), *const c_void>(
20 self.as_ptr(),
21 sel!(setComputePipelineState:),
22 state.as_ptr(),
23 );
24 }
25 }
26
27 #[inline]
31 pub fn dispatch_type(&self) -> DispatchType {
32 unsafe { msg_send_0(self.as_ptr(), sel!(dispatchType)) }
33 }
34}