bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
33.71k stars 3.27k forks source link

The function `hsv_to_rgb` in wgsl is defined or called incorrectly #14139

Open jannik4 opened 2 days ago

jannik4 commented 2 days ago

Bevy version

0.14

Problem

The function is defined as followed:

fn hsv_to_rgb(hsv: vec3<f32>) -> vec3<f32> {
    ...
}

But is called with three arguments in multiple places in the code, like hsv_to_rgb(x, y, z).

Reproduce

Search for hsv_to_rgb.

rparrett commented 2 days ago

The bad calls seem to be limited to debug code, which is why this isn't causing obvious issues at the moment.

https://github.com/bevyengine/bevy/blob/5986d5d309512d69f0e1837f9164b23d934e094b/crates/bevy_pbr/src/render/clustered_forward.wgsl#L118

https://github.com/bevyengine/bevy/blob/5986d5d309512d69f0e1837f9164b23d934e094b/crates/bevy_pbr/src/render/shadows.wgsl#L197-L201

It would be good to verify that these debug visualizations still work while fixing this.