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:
Meta Vens 2026-10-12 04:07:08 +02:00
commit 355cfa2a3d
5 changed files with 40 additions and 10 deletions

View file

@ -335,9 +335,10 @@ float cultmath_cycles_rgb_to_bw(float3 color)
// otherwise. The ramp table itself is the caller's.
float2 cultmath_cycles_ramp_index(float t, int size)
{
float f = (t > 0.0 ? (t < 1.0 ? t : 1.0) : 0.0) * (size - 1);
float f = (t > 0.0 ? (t < 1.0 ? t : 1.0) : 0.0) * (float)(size - 1);
int index = clamp((int)f, 0, size - 1);
return float2(index, f - index);
float lower = (float)index;
return float2(lower, f - lower);
}
#endif