diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-04-27 21:19:56 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-04-27 21:19:56 +0800 |
| commit | 2c32196bbc632411d4f6998a506ca262a805a666 (patch) | |
| tree | 62934fbda52b11bfff984030dbbe52a1926fb4ac /mingling_core/src/program.rs | |
| parent | ad10b82c1e6785cbf88562117b1609905cfeb6dc (diff) | |
Add global resource system to Program
Diffstat (limited to 'mingling_core/src/program.rs')
| -rw-r--r-- | mingling_core/src/program.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/mingling_core/src/program.rs b/mingling_core/src/program.rs index 949dd45..1505480 100644 --- a/mingling_core/src/program.rs +++ b/mingling_core/src/program.rs @@ -8,11 +8,15 @@ use crate::error::GeneralRendererSerializeError; use std::env; use crate::{ - AnyOutput, ChainProcess, RenderResult, + AnyOutput, ChainProcess, GlobalResources, RenderResult, asset::dispatcher::Dispatcher, error::{ChainProcessError, ProgramExecuteError}, }; -use std::{fmt::Display, sync::OnceLock}; +use std::{ + collections::HashMap, + fmt::Display, + sync::{Arc, Mutex, OnceLock}, +}; #[cfg(feature = "async")] use std::pin::Pin; @@ -66,6 +70,8 @@ where #[cfg(feature = "general_renderer")] pub general_renderer_name: GeneralRendererSetting, + + pub(crate) resources: GlobalResources, } impl<C> Program<C> @@ -101,6 +107,7 @@ where #[cfg(feature = "general_renderer")] general_renderer_name: GeneralRendererSetting::Disable, + resources: Arc::new(Mutex::new(HashMap::new())), } } |
