From c45826d102dc4f47c16c65d9837cc03b59534f23 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 5 Nov 2026 08:39:32 +0100 Subject: refactor(engine): make compile again --- engine/src/rendering/shader.rs | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'engine/src/rendering/shader.rs') diff --git a/engine/src/rendering/shader.rs b/engine/src/rendering/shader.rs index 3fdc2c1..2a2ac7a 100644 --- a/engine/src/rendering/shader.rs +++ b/engine/src/rendering/shader.rs @@ -13,6 +13,7 @@ use shader_slang::{ EntryPoint as SlangEntryPoint, GlobalSession as SlangGlobalSession, Module as SlangModule, + ObjectRc as SlangObjectRc, Session as SlangSession, }; @@ -73,7 +74,7 @@ bitflags! { #[derive(Clone)] pub struct Module { - inner: SlangModule, + inner: SlangObjectRc, } impl Module @@ -95,7 +96,7 @@ impl Module } #[must_use] - pub fn file_path(&self) -> &str + pub fn file_path(&self) -> Option<&str> { self.inner.file_path() } @@ -103,7 +104,7 @@ impl Module pub struct EntryPoint { - inner: SlangEntryPoint, + inner: SlangObjectRc, } impl EntryPoint @@ -120,7 +121,7 @@ impl EntryPoint #[derive(Clone)] pub struct Program { - inner: SlangComponentType, + inner: SlangObjectRc, metadata: ProgramMetadata, } @@ -202,7 +203,7 @@ impl Debug for Program pub struct Blob { - inner: SlangBlob, + inner: SlangObjectRc, } impl Blob @@ -233,8 +234,8 @@ pub struct Settings #[derive(Sole)] pub struct Context { - global_session: SlangGlobalSession, - session: Option, + global_session: SlangObjectRc, + session: Option>, programs: hashbrown::HashMap, } @@ -300,7 +301,7 @@ impl Context self.programs.get(asset_id) } - #[tracing::instrument(skip_all, fields(module_file = module.file_path()))] + #[tracing::instrument(skip_all)] pub fn compose_into_program( &self, module: Module, @@ -332,8 +333,10 @@ impl Context let components = entry_points .into_iter() - .map(|entry_point| SlangComponentType::from(entry_point.inner)) - .chain([SlangComponentType::from(module.inner)]) + .map(|entry_point| { + SlangObjectRc::::from(entry_point.inner) + }) + .chain([SlangObjectRc::::from(module.inner)]) .collect::>(); let program = session -- cgit v1.2.3-18-g5258