#[cfg(feature = "rafx-metal")]
use crate::metal::RafxRootSignatureMetal;
#[cfg(feature = "rafx-vulkan")]
use crate::vulkan::RafxRootSignatureVulkan;
#[derive(Clone, Debug)]
pub enum RafxRootSignature {
#[cfg(feature = "rafx-vulkan")]
Vk(RafxRootSignatureVulkan),
#[cfg(feature = "rafx-metal")]
Metal(RafxRootSignatureMetal),
}
impl RafxRootSignature {
#[cfg(feature = "rafx-vulkan")]
pub fn vk_root_signature(&self) -> Option<&RafxRootSignatureVulkan> {
match self {
#[cfg(feature = "rafx-vulkan")]
RafxRootSignature::Vk(inner) => Some(inner),
#[cfg(feature = "rafx-metal")]
RafxRootSignature::Metal(_inner) => None,
}
}
#[cfg(feature = "rafx-metal")]
pub fn metal_root_signature(&self) -> Option<&RafxRootSignatureMetal> {
match self {
#[cfg(feature = "rafx-vulkan")]
RafxRootSignature::Vk(_inner) => None,
#[cfg(feature = "rafx-metal")]
RafxRootSignature::Metal(inner) => Some(inner),
}
}
}