Shaders: runtime and shader node codegen (#2985)

* shader-rt: initial

* shader-rt: fix recursion when generating shader node

* shader-rt: replace gpu node's args and ret types with `Raster<GPU>`

* shader-rt: properly cfg out the gpu node

* shader-rt: fix `impl Context` in the wrong places

* shader-rt: disable gpu blend node, needs two images

* shader-rt: connect shader runtime

* shader-rt: pass WgpuExecutor by reference

* shader-rt: correct bindings with derpy arg buffer

* shader-rt: manual pipeline layout, fixing errors when bindings got DCE'd

* shader-rt: correct RT format, working invert gpu node

* shader-rt: cleanup codegen with common sym struct

* shader-rt: correct arg buffer handling

* shader-nodes feature: put shader nodes behind feature gate

* shader-nodes feature: rename any `gpu_node` to `shader-node`

* shaders-rt: fix wgpu label name

* shaders-rt: explain fullscreen_vertex coordinates with a drawing
This commit is contained in:
Firestar99
2025-09-05 08:33:53 +02:00
committed by GitHub
parent 7dc86b36ca
commit 5d441c2e18
15 changed files with 619 additions and 63 deletions

View File

@@ -39,7 +39,7 @@ pub(crate) struct ParsedNodeFn {
pub(crate) description: String,
}
#[derive(Debug, Default)]
#[derive(Debug, Default, Clone)]
pub(crate) struct NodeFnAttributes {
pub(crate) category: Option<LitStr>,
pub(crate) display_name: Option<LitStr>,
@@ -144,7 +144,7 @@ pub struct NodeParsedField {
pub implementations: Punctuated<Implementation, Comma>,
}
#[derive(Debug)]
#[derive(Clone, Debug)]
pub(crate) struct Input {
pub(crate) pat_ident: PatIdent,
pub(crate) ty: Type,
@@ -663,7 +663,7 @@ pub fn new_node_fn(attr: TokenStream2, item: TokenStream2) -> TokenStream2 {
}
impl ParsedNodeFn {
fn replace_impl_trait_in_input(&mut self) {
pub fn replace_impl_trait_in_input(&mut self) {
if let Type::ImplTrait(impl_trait) = self.input.ty.clone() {
let ident = Ident::new("_Input", impl_trait.span());
let mut bounds = impl_trait.bounds;