CultMath: cycles_ramp_index casts its int operands explicitly (GLSL ES 3.00 has no implicit int to float); README and GLSL file-contract tests name the Cycles files
Builds. The oracle fixtures and CultMath.Cycles.glsl are still to come, so the oracle and golden tests fail here. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
99884cc34c
commit
355cfa2a3d
5 changed files with 40 additions and 10 deletions
|
|
@ -361,8 +361,9 @@ public static partial class math
|
|||
/// </summary>
|
||||
public static float2 cycles_ramp_index(float t, int size)
|
||||
{
|
||||
var f = (t > 0.0f ? (t < 1.0f ? t : 1.0f) : 0.0f) * (size - 1);
|
||||
var f = (t > 0.0f ? (t < 1.0f ? t : 1.0f) : 0.0f) * (float)(size - 1);
|
||||
var index = clamp((int)f, 0, size - 1);
|
||||
return new float2(index, f - index);
|
||||
var lower = (float)index;
|
||||
return new float2(lower, f - lower);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue