Skip to main content

pebble/wgpu/
cubemap.rs

1pub struct CubemapSpec {
2    pub size: u32, // cubemaps are square per face
3    pub format: wgpu::TextureFormat,
4    /// `Some` uploads 6 faces of pixel data up front (wgpu's expected
5    /// order: +X, -X, +Y, -Y, +Z, -Z). `None` allocates an empty cubemap
6    /// meant to be filled later by rendering into per-face views — e.g. an
7    /// environment-map capture pass — in which case [`wgpu_descriptor`](Self::wgpu_descriptor)
8    /// adds `RENDER_ATTACHMENT` usage instead of requiring upload data.
9    pub faces: Option<[Vec<u8>; 6]>,
10}
11
12impl CubemapSpec {
13    pub fn with_format(mut self, format: wgpu::TextureFormat) -> Self {
14        self.format = format;
15        self
16    }
17}