crystal-api 0.0.6

Crystal API is a unified GPU API's wrapper
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::sync::{Arc, Mutex};

use crate::proxies;

/// Used for textures bindings in shaders
pub struct GpuSamplerSet {
    pub(crate) id: Mutex<usize>,
    pub(crate) textures: Vec<(u32, Arc<dyn proxies::TextureProxy>)>,
}

impl GpuSamplerSet {
    pub(crate) fn from_textures(textures: &[(u32, Arc<dyn proxies::TextureProxy>)]) -> Arc<Self> {
        Arc::new(Self {
            id: Mutex::new(usize::MAX),
            textures: textures.to_vec(),
        })
    }
}