-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start doing some work on shader uniforms
- Loading branch information
1 parent
fd33540
commit 78637be
Showing
15 changed files
with
117 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//! Asset management for the engine | ||
/// An error that can occur when loading an asset | ||
#[derive(Debug)] | ||
pub enum AssetError { | ||
/// The asset could not be found | ||
NotFound, | ||
/// The asset could not be loaded | ||
LoadFailed, | ||
/// The asset is not of the expected type | ||
TypeMismatch, | ||
} | ||
|
||
/// Represents an asset that can be loaded and used by the engine | ||
pub trait Asset {} | ||
|
||
/// An entry in the asset manager | ||
enum AssetEntry { | ||
Unloaded, | ||
Loaded(Box<dyn Asset>), | ||
} | ||
|
||
/// A manager for assets | ||
#[derive(Default)] | ||
pub struct AssetManager {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//! Shader language abstractions and templating. | ||
pub use glsl::*; | ||
pub use shady::*; | ||
|
||
use super::*; | ||
|
||
mod glsl; | ||
mod shady; | ||
|
||
/// Represents a language for [`ShaderKernel`]s. | ||
pub trait ShaderLanguage { | ||
/// Parses the given raw source code into one or more [`ShaderKernel`]s. | ||
fn parse_kernels(source_code: &str) -> Result<Vec<ShaderKernel>, ShaderError>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
use proc_macro::TokenStream; | ||
use quote::quote; | ||
use syn::{parse_macro_input, DeriveInput}; | ||
|
||
pub fn impl_uniform_set_trait(input: TokenStream) -> TokenStream { | ||
let input = parse_macro_input!(input as DeriveInput); | ||
let ident = &input.ident; | ||
|
||
let expanded = quote! { | ||
impl ToShaderUniformSet for #ident { | ||
fn apply_to(&self, set: &mut ShaderUniformSet) { | ||
// TODO: implement me | ||
} | ||
} | ||
}; | ||
|
||
expanded.into() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.