Skip to main content

ursus_core/assets/
upload.rs

1use crate::assets::mesh::Vertex;
2use crate::assets::registry::TextureHandle;
3use crate::render::gfx::types::Format;
4use ursus_ecs::components::mesh::MeshHandle;
5use ursus_materials::MaterialHandle;
6
7pub enum GpuUploadRequest {
8    Mesh {
9        handle: MeshHandle,
10        vertices: Vec<Vertex>,
11        indices: Vec<u32>,
12        name: String,
13    },
14    Texture {
15        handle: TextureHandle,
16        pixels: Vec<u8>,
17        width: u32,
18        height: u32,
19        format: Format,
20        name: String,
21    },
22    /// Packed material bytes ready to be written into GPU-visible storage.
23    /// `bytes.len()` is this material's stride under whichever
24    /// `MaterialLayout` produced them (see `ursus_materials::pack::aos`).
25    Material { handle: MaterialHandle, bytes: Vec<u8> },
26}