Move shader entrypoints to separate crate (#3157)

This commit is contained in:
Timon 2025-09-10 10:20:45 +00:00 committed by GitHub
parent 50be13522b
commit 9411612d7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 27 additions and 5 deletions

7
Cargo.lock generated
View File

@ -2207,6 +2207,13 @@ dependencies = [
"env_logger",
]
[[package]]
name = "graphene-raster-nodes-shaders-entrypoint"
version = "0.1.0"
dependencies = [
"graphene-raster-nodes",
]
[[package]]
name = "graphene-std"
version = "0.1.0"

View File

@ -18,6 +18,7 @@ members = [
"node-graph/graphene-cli",
"node-graph/graster-nodes",
"node-graph/graster-nodes/shaders",
"node-graph/graster-nodes/shaders/entrypoint",
"node-graph/gstd",
"node-graph/gsvg-renderer",
"node-graph/interpreted-executor",

View File

@ -6,9 +6,6 @@ description = "graphene raster data format"
authors = ["Graphite Authors <contact@graphite.rs>"]
license = "MIT OR Apache-2.0"
[lib]
crate-type = ["rlib", "dylib"]
[lints]
workspace = true

View File

@ -6,6 +6,9 @@ description = "graphene raster data format"
authors = ["Graphite Authors <contact@graphite.rs>"]
license = "MIT OR Apache-2.0"
[lib]
crate-type = ["rlib", "dylib"]
[dependencies]
[build-dependencies]

View File

@ -23,7 +23,7 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
}
}
let shader_crate = PathBuf::from(concat!(env!("CARGO_MANIFEST_DIR"), "/.."));
let shader_crate = PathBuf::from(concat!(env!("CARGO_MANIFEST_DIR"), "/entrypoint"));
println!("cargo:rerun-if-env-changed=RUSTC_CODEGEN_SPIRV_PATH");
let rustc_codegen_spirv_path = std::env::var("RUSTC_CODEGEN_SPIRV_PATH").unwrap_or_default();
@ -43,7 +43,6 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut builder = backend.to_spirv_builder(shader_crate, "spirv-unknown-naga-wgsl");
builder.print_metadata = MetadataPrintout::DependencyOnly;
builder.spirv_metadata = SpirvMetadata::Full;
builder.shader_crate_features.default_features = false;
let wgsl_result = builder.build()?;
let path_to_spv = wgsl_result.module.unwrap_single();

View File

@ -0,0 +1,13 @@
[package]
name = "graphene-raster-nodes-shaders-entrypoint"
version = "0.1.0"
edition = "2024"
description = "graphene raster nodes shaders entrypoint"
authors = ["Graphite Authors <contact@graphite.rs>"]
license = "MIT OR Apache-2.0"
[lib]
crate-type = ["rlib", "dylib"]
[dependencies]
graphene-raster-nodes = { path = "../..", default-features = false }

View File

@ -0,0 +1,2 @@
#![no_std]
pub use graphene_raster_nodes::*;