#[cfg(feature = "rafx-metal")]
use crate::metal::RafxShaderModuleMetal;
#[cfg(feature = "rafx-vulkan")]
use crate::vulkan::RafxShaderModuleVulkan;
#[derive(Clone, Debug)]
pub enum RafxShaderModule {
#[cfg(feature = "rafx-vulkan")]
Vk(RafxShaderModuleVulkan),
#[cfg(feature = "rafx-metal")]
Metal(RafxShaderModuleMetal),
}
impl RafxShaderModule {
#[cfg(feature = "rafx-vulkan")]
pub fn vk_shader_module(&self) -> Option<&RafxShaderModuleVulkan> {
match self {
#[cfg(feature = "rafx-vulkan")]
RafxShaderModule::Vk(shader_module) => Some(shader_module),
#[cfg(feature = "rafx-metal")]
RafxShaderModule::Metal(_shader_module) => None,
}
}
#[cfg(feature = "rafx-metal")]
pub fn metal_shader_module(&self) -> Option<&RafxShaderModuleMetal> {
match self {
#[cfg(feature = "rafx-vulkan")]
RafxShaderModule::Vk(_shader_module) => None,
#[cfg(feature = "rafx-metal")]
RafxShaderModule::Metal(shader_module) => Some(shader_module),
}
}
}