-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathlib.rs
More file actions
33 lines (28 loc) · 993 Bytes
/
lib.rs
File metadata and controls
33 lines (28 loc) · 993 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use ::bevy::utils::HashMap;
use bevy_reflect::Reflect;
use serde::{Deserialize, Serialize};
/// Module binary data container.
#[derive(Debug, Clone, Serialize, Deserialize, Reflect)]
pub enum RustGpuBuilderModules {
/// Contains a single unnamed module.
Single(Vec<u8>),
/// Contains multiple named modules.
Multi(HashMap<String, Vec<u8>>),
}
/// Compile output from `rust-gpu-builder`,
/// includes SPIR-V binary modules and entry point metadata.
#[derive(Debug, Clone, Serialize, Deserialize, Reflect)]
pub struct RustGpuBuilderOutput {
pub entry_points: Vec<String>,
pub modules: RustGpuBuilderModules,
}
#[cfg(feature = "bevy")]
mod bevy {
use super::RustGpuBuilderOutput;
use bevy::{reflect::TypeUuid, utils::Uuid};
/// Implementing TypeUuid allows use as a `bevy` asset
impl TypeUuid for RustGpuBuilderOutput {
const TYPE_UUID: Uuid =
Uuid::from_fields(1664188495, 11437, 8530, &[15, 75, 77, 14, 32, 11, 25, 52]);
}
}