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

Shader macro not recompiling on change #1349

Closed
WSeegers opened this issue Apr 27, 2020 · 6 comments
Closed

Shader macro not recompiling on change #1349

WSeegers opened this issue Apr 27, 2020 · 6 comments

Comments

@WSeegers
Copy link

[dependencies]
vulkano = "0.18"
vulkano-shaders = "0.18"

Issue

When compiling shaders using the path.

vulkano_shaders::shader! {
    ty: "compute",
    path: "somepath/someshder.glsl"
}

The compilation seems to be cached and does not detect changes to the file. This results in shaders not being updated in subsequent runs.

The same is does not happen when using src: "some glsl".

@AustinJ235
Copy link
Member

I recall some previous issues about this. But if you use the include! macro just to have the compiler watch it that seems to be a workaround.

@SamHSmith
Copy link
Contributor

@WSeegers Surely this is a rust issue and not a vulkano one? As in it is up to the rust compiler and cargo to recompile the file at which point you shader gets recompiled.

@AustinJ235
Copy link
Member

AustinJ235 commented May 11, 2020 via email

@SamHSmith
Copy link
Contributor

I'm not so sure. If the compilation has been done and none of the rust source code has changed then a cargo run will completely side-step the compilation stage and run the executable it compiled last time. Fixing this would involve loading and compiling the shaders at runtime. Which may be a feature that someone wants to implement, dynamic runtime spirv compilation. If it isn't already implemented upstream.

@est31
Copy link

est31 commented Sep 12, 2020

cc rust-lang/rust#73921 and #890

@Rua
Copy link
Contributor

Rua commented May 14, 2022

I believe this is now fixed?

@Rua Rua closed this as completed May 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants