summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl
diff options
context:
space:
mode:
Diffstat (limited to 'hlsl')
-rw-r--r--hlsl/deconverge.fx6
-rw-r--r--hlsl/phosphor.fx4
-rw-r--r--hlsl/post.fx6
-rw-r--r--hlsl/yiq_decode.fx14
-rw-r--r--hlsl/yiq_encode.fx26
5 files changed, 28 insertions, 28 deletions
diff --git a/hlsl/deconverge.fx b/hlsl/deconverge.fx
index 178fbef578e..5b46ca1ddb6 100644
--- a/hlsl/deconverge.fx
+++ b/hlsl/deconverge.fx
@@ -114,9 +114,9 @@ float4 ps_main(PS_INPUT Input) : COLOR
float Deconverge = 1.0f - MagnetDistance / MagnetCenter;
Deconverge = clamp(Deconverge, 0.0f, 1.0f);
float Alpha = tex2D(DiffuseSampler, Input.TexCoord).a;
- float RedTexel = tex2D(DiffuseSampler, lerp(Input.TexCoord, Input.RedCoord, Deconverge)).r;
- float GrnTexel = tex2D(DiffuseSampler, lerp(Input.TexCoord, Input.GrnCoord, Deconverge)).g;
- float BluTexel = tex2D(DiffuseSampler, lerp(Input.TexCoord, Input.BluCoord, Deconverge)).b;
+ float RedTexel = tex2D(DiffuseSampler, lerp(Input.TexCoord, Input.RedCoord, Deconverge) + 0.5f / float2(RawWidth, RawHeight)).r;
+ float GrnTexel = tex2D(DiffuseSampler, lerp(Input.TexCoord, Input.GrnCoord, Deconverge) + 0.5f / float2(RawWidth, RawHeight)).g;
+ float BluTexel = tex2D(DiffuseSampler, lerp(Input.TexCoord, Input.BluCoord, Deconverge) + 0.5f / float2(RawWidth, RawHeight)).b;
return float4(RedTexel, GrnTexel, BluTexel, Alpha);
}
diff --git a/hlsl/phosphor.fx b/hlsl/phosphor.fx
index 6547e077f7b..fcfe6bdba53 100644
--- a/hlsl/phosphor.fx
+++ b/hlsl/phosphor.fx
@@ -79,8 +79,8 @@ VS_OUTPUT vs_main(VS_INPUT Input)
Output.Color = Input.Color;
float2 InvTexSize = float2(1.0f / TargetWidth, 1.0f / TargetHeight);
- Output.TexCoord = Input.TexCoord;
- Output.PrevCoord = Output.TexCoord;
+ Output.TexCoord = Input.TexCoord + 0.5f / float2(RawWidth, RawHeight);
+ Output.PrevCoord = Output.TexCoord + 0.5f / float2(RawWidth, RawHeight);
return Output;
}
diff --git a/hlsl/post.fx b/hlsl/post.fx
index 78fe988c26d..7dae7446dce 100644
--- a/hlsl/post.fx
+++ b/hlsl/post.fx
@@ -80,7 +80,7 @@ VS_OUTPUT vs_main(VS_INPUT Input)
Output.Position.y -= 0.5f;
Output.Position *= float4(2.0f, 2.0f, 1.0f, 1.0f);
Output.Color = Input.Color;
- Output.TexCoord = Input.TexCoord;
+ Output.TexCoord = Input.TexCoord + 0.5f / float2(RawWidth, RawHeight);
Output.ExtraInfo = Input.ExtraInfo;
//Output.TexCoord /= 16.0f;
@@ -151,8 +151,8 @@ float4 ps_main(PS_INPUT Input) : COLOR
float4 BaseTexel = tex2D(DiffuseSampler, BaseCoord);
// -- Alpha Clipping (1px border in drawd3d does not work for some reason) --
- clip((ScreenClipCoord.x < 0.0f / TargetWidth) ? -1 : 1);
- clip((ScreenClipCoord.y < 0.0f / TargetHeight) ? -1 : 1);
+ clip((ScreenClipCoord.x < 1.0f / TargetWidth) ? -1 : 1);
+ clip((ScreenClipCoord.y < 1.0f / TargetHeight) ? -1 : 1);
clip((ScreenClipCoord.x > 1.0f / WidthRatio) ? -1 : 1);
clip((ScreenClipCoord.y > 1.0f / HeightRatio) ? -1 : 1);
diff --git a/hlsl/yiq_decode.fx b/hlsl/yiq_decode.fx
index 4948250ebf8..e7a2b9344ee 100644
--- a/hlsl/yiq_decode.fx
+++ b/hlsl/yiq_decode.fx
@@ -123,9 +123,9 @@ uniform float BValue;
float4 ps_main(PS_INPUT Input) : COLOR
{
float2 RawDims = float2(RawWidth, RawHeight);
- float4 BaseTexel = tex2D(DiffuseSampler, Input.Coord0.xy);
- float4 OrigC = tex2D(CompositeSampler, Input.Coord0.xy);
- float4 OrigC2 = tex2D(CompositeSampler, Input.Coord4.xy);
+ float4 BaseTexel = tex2D(DiffuseSampler, Input.Coord0.xy + 0.5f / RawDims);
+ float4 OrigC = tex2D(CompositeSampler, Input.Coord0.xy + 0.5f / RawDims);
+ float4 OrigC2 = tex2D(CompositeSampler, Input.Coord4.xy + 0.5f / RawDims);
float4 C = OrigC;
float4 C2 = OrigC2;
@@ -166,10 +166,10 @@ float4 ps_main(PS_INPUT Input) : COLOR
}
float Yavg = Ytotal / (FscValue * 4.0f);
- float4 I = (C - Yavg) * sin(W * Tc);
- float4 Q = (C - Yavg) * cos(W * Tc);
- float4 I2 = (C2 - Yavg) * sin(W * Tc2);
- float4 Q2 = (C2 - Yavg) * cos(W * Tc2);
+ float4 I = C * sin(W * Tc);
+ float4 Q = C * cos(W * Tc);
+ float4 I2 = C2 * sin(W * Tc2);
+ float4 Q2 = C2 * cos(W * Tc2);
float Itotal = 0.0f;
float Qtotal = 0.0f;
diff --git a/hlsl/yiq_encode.fx b/hlsl/yiq_encode.fx
index e15e7ccb7d7..b4188e8b1fc 100644
--- a/hlsl/yiq_encode.fx
+++ b/hlsl/yiq_encode.fx
@@ -71,10 +71,10 @@ VS_OUTPUT vs_main(VS_INPUT Input)
Output.Position.y -= 0.5f;
Output.Position *= float4(2.0f, 2.0f, 1.0f, 1.0f);
Output.Color = Input.Color;
- Output.Coord0 = Input.TexCoord + float2(0.00f / RawWidth, 0.0f);
- Output.Coord1 = Input.TexCoord + float2(0.25f / RawWidth, 0.0f);
- Output.Coord2 = Input.TexCoord + float2(0.50f / RawWidth, 0.0f);
- Output.Coord3 = Input.TexCoord + float2(0.75f / RawWidth, 0.0f);
+ Output.Coord0 = Input.TexCoord;
+ Output.Coord1 = Input.TexCoord;
+ Output.Coord2 = Input.TexCoord;
+ Output.Coord3 = Input.TexCoord;
return Output;
}
@@ -95,17 +95,17 @@ uniform float FscScale;
float4 ps_main(PS_INPUT Input) : COLOR
{
+ float2 Scaler = float2(RawWidth, RawHeight);
float2 InvRatios = float2(1.0f / WidthRatio, 1.0f / HeightRatio);
- float3 Texel0 = tex2D(DiffuseSampler, Input.Coord0 - float2(0.0f, 0.5f / RawHeight)).rgb;
- float3 Texel1 = tex2D(DiffuseSampler, Input.Coord1 - float2(0.0f, 0.5f / RawHeight)).rgb;
- float3 Texel2 = tex2D(DiffuseSampler, Input.Coord2 - float2(0.0f, 0.5f / RawHeight)).rgb;
- float3 Texel3 = tex2D(DiffuseSampler, Input.Coord3 - float2(0.0f, 0.5f / RawHeight)).rgb;
+ float3 Texel0 = tex2D(DiffuseSampler, Input.Coord0 + float2(FscScale * 0.00f + 0.5f, 0.5f) / Scaler).rgb;
+ float3 Texel1 = tex2D(DiffuseSampler, Input.Coord1 + float2(FscScale * 0.25f + 0.5f, 0.5f) / Scaler).rgb;
+ float3 Texel2 = tex2D(DiffuseSampler, Input.Coord2 + float2(FscScale * 0.50f + 0.5f, 0.5f) / Scaler).rgb;
+ float3 Texel3 = tex2D(DiffuseSampler, Input.Coord3 + float2(FscScale * 0.75f + 0.5f, 0.5f) / Scaler).rgb;
- float2 Scaler = float2(RawWidth, RawHeight);
- float2 Coord0 = Input.Coord0.xy * Scaler;
- float2 Coord1 = Input.Coord1.xy * Scaler;
- float2 Coord2 = Input.Coord2.xy * Scaler;
- float2 Coord3 = Input.Coord3.xy * Scaler;
+ float2 Coord0 = (Input.Coord0.xy + float2(0.00f / RawWidth, 0.0f)) * Scaler;
+ float2 Coord1 = (Input.Coord1.xy + float2(0.25f / RawWidth, 0.0f)) * Scaler;
+ float2 Coord2 = (Input.Coord2.xy + float2(0.50f / RawWidth, 0.0f)) * Scaler;
+ float2 Coord3 = (Input.Coord3.xy + float2(0.75f / RawWidth, 0.0f)) * Scaler;
float W = WValue;
float T0 = Coord0.x + AValue * Coord0.y + BValue;