Browse Source

libobs: Update sharpness effect to enable compilation for Metal

A boolean comparison that involves at least one vector type will
result in a boolean vector (not a boolean scalar) for Direct3D and
Metal, whereas OpenGL returns a scalar boolean.

To avoid unnecessary code complexity, use the "distance" function
instead, which treats the color values as vectors and returns a
non-zero value if they are any different, achieving the same result.
PatTheMav 4 months ago
parent
commit
813c95f4ca
1 changed files with 1 additions and 1 deletions
  1. 1 1
      plugins/obs-filters/data/sharpness.effect

+ 1 - 1
plugins/obs-filters/data/sharpness.effect

@@ -61,7 +61,7 @@ float4 PSDrawBare(VertOut vert_in) : TARGET
 	color -= H;
 	color -= image.Sample(def_sampler, vert_in.t3.zw);
 
-	color = ((E!=F && E!=D) || (E!=B && E!=H)) ? saturate(E + color*sharpness) : E;
+	color = ( (distance(E,F) != 0.0 && distance(E,D) != 0.0) || (distance(E,B) != 0.0 && distance(E,H) != 0.0) ) ? saturate(E + color * sharpness) : E;
 
 	return color;
 }