vulkano-rs / vulkano

Safe and rich Rust wrapper around the Vulkan API
Apache License 2.0
4.48k stars 433 forks source link

Impossible uniform struct. #2430

Closed coolcatcoder closed 9 months ago

coolcatcoder commented 9 months ago

I can create structs that are impossible to construct. As in, when I define a uniform struct in a vertex shader, sometimes it doesn't update properly. It will tell you upon constructing the struct that you are missing some field, but upon adding that field, it will tell you that no such field exists. I cannot tell you how to recreate this bug, because I have not managed to find a consistent way to recreate this bug. This is inconsistent and confusing, but it happens extremely often. The only way to fix it, is to rename the uniform or rename the fields in the uniform, but even this is inconsistent. image image image image

marc0246 commented 9 months ago

Can you reproduce this using cargo build? If not, it's most certainly a rust-analyzer issue. Wouldn't be the first time it trips up on macros.

coolcatcoder commented 9 months ago

Ah thanks, yep using cargo build and cargo run it works just fine! Thanks!

marc0246 commented 9 months ago

I suggest upgrading or downgrading your toolchain to a rust-analyzer that works, and make absolutely sure you installed rust-analyzer through rustup.

marc0246 commented 9 months ago

(That is, in particular, not having the vscode extension so "helpfully" install it's own version of rust-analyzer, which is not in sync with your toolchain.)

coolcatcoder commented 9 months ago

oh fascinating, thanks for the info!