mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-09-01 18:57:21 +00:00
shader-rt: initial
This commit is contained in:
parent
2c2fce1e90
commit
bc4969a6ab
10 changed files with 260 additions and 7 deletions
|
@ -19,7 +19,7 @@ pub fn modify_cfg(attributes: &NodeFnAttributes) -> TokenStream {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, VariantNames)]
|
||||
#[derive(Debug, Clone, VariantNames)]
|
||||
pub(crate) enum ShaderNodeType {
|
||||
PerPixelAdjust(PerPixelAdjust),
|
||||
}
|
||||
|
@ -36,6 +36,7 @@ impl Parse for ShaderNodeType {
|
|||
|
||||
pub trait CodegenShaderEntryPoint {
|
||||
fn codegen_shader_entry_point(&self, parsed: &ParsedNodeFn) -> syn::Result<TokenStream>;
|
||||
fn codegen_gpu_node(&self, parsed: &ParsedNodeFn) -> syn::Result<TokenStream>;
|
||||
}
|
||||
|
||||
impl CodegenShaderEntryPoint for ShaderNodeType {
|
||||
|
@ -48,4 +49,10 @@ impl CodegenShaderEntryPoint for ShaderNodeType {
|
|||
ShaderNodeType::PerPixelAdjust(x) => x.codegen_shader_entry_point(parsed),
|
||||
}
|
||||
}
|
||||
|
||||
fn codegen_gpu_node(&self, parsed: &ParsedNodeFn) -> syn::Result<TokenStream> {
|
||||
match self {
|
||||
ShaderNodeType::PerPixelAdjust(x) => x.codegen_gpu_node(parsed),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue