Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More the build.rs scripts into the shaders #181

Closed

Conversation

expenses
Copy link
Contributor

As discussed on discord, this allows us to simply add the shader crate as a dependency and pull the compiled shader out of a const.

@@ -71,6 +71,10 @@ impl SpirvBuilder {
/// you usually don't have to inspect the path, as the environment variable will already be
/// set.
pub fn build(self) -> Result<PathBuf, SpirvBuilderError> {
if std::env::var("TARGETING_SPIRV").is_ok() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to stop the build script from being called recursively.

Comment on lines -11 to +12
use-installed-tools = ["spirv-builder/use-installed-tools"]
use-compiled-tools = ["spirv-builder/use-compiled-tools"]
use-installed-tools = ["example-shader/use-installed-tools"]
use-compiled-tools = ["example-shader/use-compiled-tools"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really a fan of having to propagate these features, but I don't see a different way at the moment.

@XAMPPRocky XAMPPRocky added the s: waiting on review PRs that blocked on a team member's review. label Oct 30, 2020
@khyperia
Copy link
Contributor

Thanks so much for the PR! However, I think we still have too many unresolved questions with the build system and what direction we want to move in before we're able to accept this PR. Hopefully we can figure things out soon, but it's going to be a long exploratory process with a lot of prototypes, discussion, and debate before we decide where we want to go.

@khyperia khyperia closed this Oct 30, 2020
@repi
Copy link
Contributor

repi commented Oct 30, 2020

Linking #48 which is our bigger tracking issue to try and figure out the overall path forward.

It may be that we go with this specific approach, but there are some challenges also and considerations to support both for initial embedded GPU binaries in single pass, CPU shader evaluation and hotswapping/local fast iteration of shader crates, which makes all of this quite tricky with the constraints of Cargo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s: waiting on review PRs that blocked on a team member's review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants