Closed
Description
Expected Behaviour
The function
#[inline(never)]
fn sdf(coord: Vec2, con: &PushConst) -> f32{
let result = (coord - Vec2::splat(200.0)).length() - 150.0;
result - con.color[0]
}
is expected to be emitted as a NoInline
tagged spirV function, but it gets inlined.
Fix
This can be fixed by cloning the constant, which results in the function actually being emitted like this:
#[inline(never)]
fn sdf(coord: Vec2, con: PushConst) -> f32{
let result = (coord - Vec2::splat(200.0)).length() - 150.0;
result - con.color[0]
}
compiles to
%19 = OpFunction %25 DontInline %34
%52 = OpFunctionParameter %32
%53 = OpFunctionParameter %18
%54 = OpLabel
OpLine %5 30 4