Fix Realtime Compositor: Fix shader compilation on Metal

This commit is contained in:
Clément Foucault
2023-09-25 22:00:06 +02:00
parent ee03bb38cb
commit bea13af81a
2 changed files with 4 additions and 4 deletions

View File

@@ -51,7 +51,7 @@ void main()
accumulated_weight += weight;
/* Move the left texel one pixel in the clockwise tangent to the boundary. */
left_texel += normalize((left_texel - boundary_texel).yx * vec2(-1.0, 1.0));
left_texel += normalize((left_texel - vec2(boundary_texel)).yx * vec2(-1.0, 1.0));
}
/* When i is zero, we are accumulating the center pixel, which was already accumulated as the
@@ -63,7 +63,7 @@ void main()
accumulated_weight += weight;
/* Move the left texel one pixel in the anti-clockwise tangent to the boundary. */
right_texel += normalize((right_texel - boundary_texel).yx * vec2(1.0, -1.0));
right_texel += normalize((right_texel - vec2(boundary_texel)).yx * vec2(1.0, -1.0));
}
}

View File

@@ -14,10 +14,10 @@ bool is_jump_flooded(vec4 value)
/* Given the position of the closest seed, the distance to it, and whether the pixel is flooded,
* encode that information in a vec4 in a format expected by the algorithm and return it */
vec4 encode_jump_flooding_value(vec2 position_of_closest_seed, float distance, bool is_flooded)
vec4 encode_jump_flooding_value(vec2 position_of_closest_seed, float dist, bool is_flooded)
{
if (is_flooded) {
return vec4(position_of_closest_seed, distance, 0.0);
return vec4(position_of_closest_seed, dist, 0.0);
}
return JUMP_FLOODING_NON_FLOODED_VALUE;
}