Fix Realtime Compositor: Broken keying node on MacOS

This was caused by `mod` not being available to integer
types. It isn't part of the GLSL stadard officially.
In this particular case, it is not needed. so replace it
with the `%` operator.
This commit is contained in:
Clément Foucault
2023-08-01 17:48:29 +02:00
parent de8ce4e34b
commit 1e7f27ec55
2 changed files with 2 additions and 2 deletions

View File

@@ -4,7 +4,7 @@
ivec3 compute_saturation_indices(vec3 v)
{
int index_of_max = ((v.x > v.y) ? ((v.x > v.z) ? 0 : 2) : ((v.y > v.z) ? 1 : 2));
ivec2 other_indices = ivec2(mod(ivec2(index_of_max) + ivec2(1, 2), ivec2(3)));
ivec2 other_indices = (ivec2(index_of_max) + ivec2(1, 2)) % 3;
int min_index = min(other_indices.x, other_indices.y);
int max_index = max(other_indices.x, other_indices.y);
return ivec3(index_of_max, max_index, min_index);

View File

@@ -5,7 +5,7 @@
ivec3 compute_saturation_indices(vec3 v)
{
int index_of_max = ((v.x > v.y) ? ((v.x > v.z) ? 0 : 2) : ((v.y > v.z) ? 1 : 2));
ivec2 other_indices = ivec2(mod(ivec2(index_of_max) + ivec2(1, 2), ivec2(3)));
ivec2 other_indices = (ivec2(index_of_max) + ivec2(1, 2)) % 3;
int min_index = min(other_indices.x, other_indices.y);
int max_index = max(other_indices.x, other_indices.y);
return ivec3(index_of_max, max_index, min_index);