-
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.
- Loading branch information
1 parent
abd1f3e
commit 853ecfa
Showing
12 changed files
with
117 additions
and
20 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,17 @@ | ||
[package] | ||
name = "gravylib-builder" | ||
version = "0.1.0-alpha" | ||
publish = false | ||
authors.workspace = true | ||
edition.workspace = true | ||
license.workspace = true | ||
repository.workspace = true | ||
|
||
# See rustc_codegen_spirv/Cargo.toml for details on these features | ||
[features] | ||
default = ["use-compiled-tools"] | ||
use-installed-tools = ["spirv-builder/use-installed-tools"] | ||
use-compiled-tools = ["spirv-builder/use-compiled-tools"] | ||
|
||
[dependencies] | ||
spirv-builder.workspace = true |
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,8 @@ | ||
use gravylib_builder::*; | ||
use std::error::Error; | ||
|
||
fn main() -> Result<(), Box<dyn Error>> { | ||
build_shader("../gravylib-helpers")?; | ||
build_shader("../examples/shaders")?; | ||
Ok(()) | ||
} |
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 spirv_builder::SpirvBuilder; | ||
use std::env; | ||
use std::error::Error; | ||
// use std::fs; | ||
use std::path::Path; | ||
|
||
pub fn build_shader(path_to_crate: &str, /*codegen_names: bool*/) -> Result<(), Box<dyn Error>> { | ||
let builder_dir = &Path::new(env!("CARGO_MANIFEST_DIR")); | ||
let path_to_crate = builder_dir.join(path_to_crate); | ||
let _result = SpirvBuilder::new(path_to_crate, "spirv-unknown-vulkan1.1").build()?; | ||
/* if codegen_names { | ||
let out_dir = env::var_os("OUT_DIR").unwrap(); | ||
let dest_path = Path::new(&out_dir).join("entry_points.rs"); | ||
fs::create_dir_all(&out_dir).unwrap(); | ||
fs::write(dest_path, result.codegen_entry_point_strings()).unwrap(); | ||
} // TODO: Look into dynamic loading of entry points */ | ||
Ok(()) | ||
} |
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
File renamed without changes.
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
File renamed without changes.