Skip to main content

nvidia_omm/
stub.rs

1use {
2    crate::{AlphaMip, BakeInput, BakeOutput},
3    anyhow::{Result, bail},
4    std::{marker::PhantomData, path::Path},
5};
6
7pub struct AlphaTexture<'a> {
8    _baker: PhantomData<&'a Baker>,
9}
10
11pub struct Baker;
12
13impl Baker {
14    /// Creates a CPU baker.
15    ///
16    /// # Errors
17    /// Always returns an error because the native backend is unavailable.
18    pub fn new(_library_path: &Path) -> Result<Self> {
19        bail!(
20            "native nvidia omm is unavailable; enable the nvidia-omm native feature on a supported host"
21        )
22    }
23
24    /// Copies alpha mips into an SDK texture.
25    ///
26    /// # Errors
27    /// Always returns an error because the native backend is unavailable.
28    pub fn create_texture<'a>(&'a self, _mips: &[AlphaMip<'_>]) -> Result<AlphaTexture<'a>> {
29        bail!("native nvidia omm is unavailable on this build")
30    }
31
32    /// Bakes opacity micromaps.
33    ///
34    /// # Errors
35    /// Always returns an error because the native backend is unavailable.
36    pub fn bake(&self, _texture: &AlphaTexture<'_>, _input: BakeInput<'_>) -> Result<BakeOutput> {
37        bail!("native nvidia omm is unavailable on this build")
38    }
39}