#[solved] `acos` undefined in wgsl

2 messages · Page 1 of 1 (latest)

worn adder
#

i cant make a global constant like this

const PI = acos(-1.);

error: no definition in scope for identifier: 'acos'
┌─ wgsl:260:12

260 │ const PI = acos(-1.);
│ ^^^^ unknown identifier

true scroll
#

Not yet yeah. Naga (the shader parser bevy uses) does not yet support const expressions. Calculate the value manually and stick it in the const.