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

Reference entry arguments are not checked for mutability. #1008

Closed
eddyb opened this issue Mar 18, 2023 · 0 comments · Fixed by #1009
Closed

Reference entry arguments are not checked for mutability. #1008

eddyb opened this issue Mar 18, 2023 · 0 comments · Fixed by #1009
Labels
t: bug Something isn't working

Comments

@eddyb
Copy link
Contributor

eddyb commented Mar 18, 2023

Using &mut T instead of &T for immutable-only SPIR-V storage classes (PushConstant, Uniform, etc.),
e.g. this change to examples/shaders/sky-shader/src/lib.rs compiles:

 #[spirv(fragment)]
 pub fn main_fs(
     #[spirv(frag_coord)] in_frag_coord: Vec4,
-    #[spirv(push_constant)] constants: &ShaderConstants,
+    #[spirv(push_constant)] constants: &mut ShaderConstants,
     output: &mut Vec4,
 ) {

This is likely a regression introduced by:

(an if m == expected_mutbl was accidentally removed and I missed it during review)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant