Преглед изворни кода

libobs: Fix shader fix not working on D3D11

In c8d95005c15, it was incorrect assumed that just because the fix
worked on OpenGL, that the fix would also work on D3D11. Automated tests
would be ideal here, although if there were automated tests, ironically,
it wouldn't have picked this up, because we (read: I) made D3D11 fall
back to OpenGL of D3D11 failed. Basically there is no one to blame but
myself again.

This time, we've removed the OpenGL fallback in a06d6893b931c (thank you
Rodney), and additionally I properly tested on both rendering backends.

(Lain note: I'm just going to go sit in the corner for a bit and
ruminate after this)
Lain пре 2 година
родитељ
комит
45e7334206
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      libobs/data/default.effect

+ 3 - 3
libobs/data/default.effect

@@ -31,14 +31,14 @@ float4 PSDrawBare(VertInOut vert_in) : TARGET
 float4 PSDrawAlphaDivide(VertInOut vert_in) : TARGET
 {
 	float4 rgba = image.Sample(def_sampler, vert_in.uv);
-	rgba.rgb = (rgba.a > 0.) ? (rgba.rgb / rgba.a) : float3(0.);
+	rgba.rgb = (rgba.a > 0.) ? (rgba.rgb / rgba.a) : float3(0., 0., 0.);
 	return rgba;
 }
 
 float4 PSDrawAlphaDivideTonemap(VertInOut vert_in) : TARGET
 {
 	float4 rgba = image.Sample(def_sampler, vert_in.uv);
-	rgba.rgb = (rgba.a > 0.) ? (rgba.rgb / rgba.a) : float3(0.);
+	rgba.rgb = (rgba.a > 0.) ? (rgba.rgb / rgba.a) : float3(0., 0., 0.);
 	rgba.rgb = rec709_to_rec2020(rgba.rgb);
 	rgba.rgb = reinhard(rgba.rgb);
 	rgba.rgb = rec2020_to_rec709(rgba.rgb);
@@ -48,7 +48,7 @@ float4 PSDrawAlphaDivideTonemap(VertInOut vert_in) : TARGET
 float4 PSDrawAlphaDivideR10L(VertInOut vert_in) : TARGET
 {
 	float4 rgba = image.Sample(def_sampler, vert_in.uv);
-	rgba.rgb = (rgba.a > 0.) ? (rgba.rgb / rgba.a) : float3(0.);
+	rgba.rgb = (rgba.a > 0.) ? (rgba.rgb / rgba.a) : float3(0., 0., 0.);
 	rgba.rgb *= multiplier;
 	rgba.rgb = rec709_to_rec2020(rgba.rgb);
 	rgba.rgb = linear_to_st2084(rgba.rgb);