use core::ptr::NonNull;
use objc2::{extern_protocol, runtime::ProtocolObject};
use objc2_foundation::NSRange;
use crate::{MTLFunctionHandle, MTLResource, MTLResourceID};
extern_protocol!(
pub unsafe trait MTLVisibleFunctionTable: MTLResource {
#[unsafe(method(gpuResourceID))]
#[unsafe(method_family = none)]
fn gpu_resource_id(&self) -> MTLResourceID;
#[unsafe(method(setFunction:atIndex:))]
#[unsafe(method_family = none)]
fn set_function_at_index(
&self,
function: Option<&ProtocolObject<dyn MTLFunctionHandle>>,
index: usize,
);
#[unsafe(method(setFunctions:withRange:))]
#[unsafe(method_family = none)]
fn set_functions_with_range(
&self,
functions: NonNull<*const ProtocolObject<dyn MTLFunctionHandle>>,
range: NSRange,
);
}
);