Skip to content

Commit

Permalink
Fix Direct3D12 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
papadanku committed Jan 6, 2022
1 parent 7baf9a2 commit a16f387
Show file tree
Hide file tree
Showing 30 changed files with 155 additions and 152 deletions.
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ kVignette | Natural vignetting effect
+ Prefix `_` to uniform objects and variables (except for user functions)
+ Suffix `VS` for `VertexShader`, `PS` for `PixelShader`
+ Use **ALLCAPS** semantics and state parameters
+ Use **Pascal_Case** for System-Value Semantics (`SV_Position`)
+ Use **PascalCase** for
+ Namespaces
+ Structs
Expand Down
4 changes: 2 additions & 2 deletions shaders/cAbberation.fx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ sampler2D _SampleColor

/* [Vertex Shaders] */

void PostProcessVS(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float2 TexCoord : TEXCOORD)
void PostProcessVS(in uint ID : SV_VertexID, out float4 Position : SV_Position, out float2 TexCoord : TEXCOORD)
{
TexCoord.x = (ID == 2) ? 2.0 : 0.0;
TexCoord.y = (ID == 1) ? 2.0 : 0.0;
Expand All @@ -39,7 +39,7 @@ void PostProcessVS(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION
Thus, just doing TexCoord + 1.0 moves the texture to the window's other sides, rendering it out of sight
*/

void AbberationPS(float4 Position : SV_POSITION, float2 TexCoord : TEXCOORD0, out float4 OutputColor0 : SV_TARGET0)
void AbberationPS(in float4 Position : SV_Position, in float2 TexCoord : TEXCOORD0, out float4 OutputColor0 : SV_Target0)
{
const float2 PixelSize = float2(BUFFER_RCP_WIDTH, BUFFER_RCP_HEIGHT);
// Shift red channel
Expand Down
6 changes: 3 additions & 3 deletions shaders/cAutoExposure.fx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ sampler2D _SampleLumaLOD

/* [Vertex Shaders] */

void PostProcessVS(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float2 TexCoord : TEXCOORD)
void PostProcessVS(in uint ID : SV_VertexID, out float4 Position : SV_Position, out float2 TexCoord : TEXCOORD)
{
TexCoord.x = (ID == 2) ? 2.0 : 0.0;
TexCoord.y = (ID == 1) ? 2.0 : 0.0;
Expand All @@ -54,7 +54,7 @@ void PostProcessVS(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION

/* [Pixel Shaders] */

void BlitPS(float4 Position : SV_POSITION, float2 TexCoord : TEXCOORD0, out float4 OutputColor0 : SV_Target0)
void BlitPS(in float4 Position : SV_Position, in float2 TexCoord : TEXCOORD0, out float4 OutputColor0 : SV_Target0)
{
float4 Color = tex2D(_SampleColor, TexCoord);

Expand All @@ -63,7 +63,7 @@ void BlitPS(float4 Position : SV_POSITION, float2 TexCoord : TEXCOORD0, out floa
OutputColor0 = float4(max(Color.r, max(Color.g, Color.b)).rrr, _TimeRate);
}

void ExposurePS(float4 Position : SV_POSITION, float2 TexCoord : TEXCOORD0, out float4 OutputColor0 : SV_TARGET0)
void ExposurePS(in float4 Position : SV_Position, in float2 TexCoord : TEXCOORD0, out float4 OutputColor0 : SV_Target0)
{
// Average Luma = Average value (1x1) for all of the pixels
float AverageLuma = tex2Dlod(_SampleLumaLOD, float4(TexCoord, 0.0, 8.0)).r;
Expand Down
66 changes: 33 additions & 33 deletions shaders/cBloom.fx
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,14 @@ sampler2D _SampleBloom8

/* [ Vertex Shaders ] */

void PostProcessVS(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float2 TexCoord : TEXCOORD0)
void PostProcessVS(in uint ID : SV_VertexID, out float4 Position : SV_Position, out float2 TexCoord : TEXCOORD0)
{
TexCoord.x = (ID == 2) ? 2.0 : 0.0;
TexCoord.y = (ID == 1) ? 2.0 : 0.0;
Position = float4(TexCoord * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0);
}

void DownsampleVS(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float4 TexCoord[4] : TEXCOORD0, float Factor)
void DownsampleVS(in uint ID : SV_VertexID, out float4 Position : SV_Position, out float4 TexCoord[4] : TEXCOORD0, float Factor)
{
float2 TexCoord0;
PostProcessVS(ID, Position, TexCoord0);
Expand All @@ -170,7 +170,7 @@ void DownsampleVS(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION,
TexCoord[3] = TexCoord0.xyyy + float4(2.0, 2.0, 0.0, -2.0) * pSize.xyyy;
}

void UpsampleVS(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float4 TexCoord[3] : TEXCOORD0, float Factor)
void UpsampleVS(in uint ID : SV_VertexID, out float4 Position : SV_Position, out float4 TexCoord[3] : TEXCOORD0, float Factor)
{
float2 TexCoord0;
PostProcessVS(ID, Position, TexCoord0);
Expand All @@ -183,72 +183,72 @@ void UpsampleVS(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, i
TexCoord[2] = TexCoord0.xyyy + float4(1.0, 1.0, 0.0, -1.0) * pSize.xyyy;
}

void DownsampleVS1(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float4 TexCoord[4] : TEXCOORD0)
void DownsampleVS1(in uint ID : SV_VertexID, out float4 Position : SV_Position, out float4 TexCoord[4] : TEXCOORD0)
{
DownsampleVS(ID, Position, TexCoord, 1.0);
}

void DownsampleVS2(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float4 TexCoord[4] : TEXCOORD0)
void DownsampleVS2(in uint ID : SV_VertexID, out float4 Position : SV_Position, out float4 TexCoord[4] : TEXCOORD0)
{
DownsampleVS(ID, Position, TexCoord, 2.0);
}

void DownsampleVS3(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float4 TexCoord[4] : TEXCOORD0)
void DownsampleVS3(in uint ID : SV_VertexID, out float4 Position : SV_Position, out float4 TexCoord[4] : TEXCOORD0)
{
DownsampleVS(ID, Position, TexCoord, 3.0);
}

void DownsampleVS4(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float4 TexCoord[4] : TEXCOORD0)
void DownsampleVS4(in uint ID : SV_VertexID, out float4 Position : SV_Position, out float4 TexCoord[4] : TEXCOORD0)
{
DownsampleVS(ID, Position, TexCoord, 4.0);
}

void DownsampleVS5(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float4 TexCoord[4] : TEXCOORD0)
void DownsampleVS5(in uint ID : SV_VertexID, out float4 Position : SV_Position, out float4 TexCoord[4] : TEXCOORD0)
{
DownsampleVS(ID, Position, TexCoord, 5.0);
}

void DownsampleVS6(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float4 TexCoord[4] : TEXCOORD0)
void DownsampleVS6(in uint ID : SV_VertexID, out float4 Position : SV_Position, out float4 TexCoord[4] : TEXCOORD0)
{
DownsampleVS(ID, Position, TexCoord, 6.0);
}

void DownsampleVS7(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float4 TexCoord[4] : TEXCOORD0)
void DownsampleVS7(in uint ID : SV_VertexID, out float4 Position : SV_Position, out float4 TexCoord[4] : TEXCOORD0)
{
DownsampleVS(ID, Position, TexCoord, 7.0);
}

void UpsampleVS8(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float4 TexCoord[3] : TEXCOORD0)
void UpsampleVS8(in uint ID : SV_VertexID, out float4 Position : SV_Position, out float4 TexCoord[3] : TEXCOORD0)
{
UpsampleVS(ID, Position, TexCoord, 8.0);
}

void UpsampleVS7(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float4 TexCoord[3] : TEXCOORD0)
void UpsampleVS7(in uint ID : SV_VertexID, out float4 Position : SV_Position, out float4 TexCoord[3] : TEXCOORD0)
{
UpsampleVS(ID, Position, TexCoord, 7.0);
}

void UpsampleVS6(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float4 TexCoord[3] : TEXCOORD0)
void UpsampleVS6(in uint ID : SV_VertexID, out float4 Position : SV_Position, out float4 TexCoord[3] : TEXCOORD0)
{
UpsampleVS(ID, Position, TexCoord, 6.0);
}

void UpsampleVS5(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float4 TexCoord[3] : TEXCOORD0)
void UpsampleVS5(in uint ID : SV_VertexID, out float4 Position : SV_Position, out float4 TexCoord[3] : TEXCOORD0)
{
UpsampleVS(ID, Position, TexCoord, 5.0);
}

void UpsampleVS4(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float4 TexCoord[3] : TEXCOORD0)
void UpsampleVS4(in uint ID : SV_VertexID, out float4 Position : SV_Position, out float4 TexCoord[3] : TEXCOORD0)
{
UpsampleVS(ID, Position, TexCoord, 4.0);
}

void UpsampleVS3(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float4 TexCoord[3] : TEXCOORD0)
void UpsampleVS3(in uint ID : SV_VertexID, out float4 Position : SV_Position, out float4 TexCoord[3] : TEXCOORD0)
{
UpsampleVS(ID, Position, TexCoord, 3.0);
}

void UpsampleVS2(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float4 TexCoord[3] : TEXCOORD0)
void UpsampleVS2(in uint ID : SV_VertexID, out float4 Position : SV_Position, out float4 TexCoord[3] : TEXCOORD0)
{
UpsampleVS(ID, Position, TexCoord, 2.0);
}
Expand Down Expand Up @@ -324,7 +324,7 @@ float Med3(float x, float y, float z)
return max(min(x, y), min(max(x, y), z));
}

void PrefilterPS(float4 Position : SV_POSITION, float2 TexCoord : TEXCOORD0, out float4 OutputColor0 : SV_TARGET0)
void PrefilterPS(in float4 Position : SV_Position, in float2 TexCoord : TEXCOORD0, out float4 OutputColor0 : SV_Target0)
{
const float Knee = mad(_Threshold, _Smooth, 1e-5f);
const float3 Curve = float3(_Threshold - Knee, Knee * 2.0, 0.25 / Knee);
Expand Down Expand Up @@ -365,77 +365,77 @@ float3 RRTAndODTFit(float3 v)
return a / b;
}

void DownsamplePS1(float4 Position : SV_POSITION, float4 TexCoord[4] : TEXCOORD0, out float4 OutputColor0 : SV_TARGET0)
void DownsamplePS1(in float4 Position : SV_Position, in float4 TexCoord[4] : TEXCOORD0, out float4 OutputColor0 : SV_Target0)
{
OutputColor0 = DownsamplePS(_SampleBloom1, TexCoord);
}

void DownsamplePS2(float4 Position : SV_POSITION, float4 TexCoord[4] : TEXCOORD0, out float4 OutputColor0 : SV_TARGET0)
void DownsamplePS2(in float4 Position : SV_Position, in float4 TexCoord[4] : TEXCOORD0, out float4 OutputColor0 : SV_Target0)
{
OutputColor0 = DownsamplePS(_SampleBloom2, TexCoord);
}

void DownsamplePS3(float4 Position : SV_POSITION, float4 TexCoord[4] : TEXCOORD0, out float4 OutputColor0 : SV_TARGET0)
void DownsamplePS3(in float4 Position : SV_Position, in float4 TexCoord[4] : TEXCOORD0, out float4 OutputColor0 : SV_Target0)
{
OutputColor0 = DownsamplePS(_SampleBloom3, TexCoord);
}

void DownsamplePS4(float4 Position : SV_POSITION, float4 TexCoord[4] : TEXCOORD0, out float4 OutputColor0 : SV_TARGET0)
void DownsamplePS4(in float4 Position : SV_Position, in float4 TexCoord[4] : TEXCOORD0, out float4 OutputColor0 : SV_Target0)
{
OutputColor0 = DownsamplePS(_SampleBloom4, TexCoord);
}

void DownsamplePS5(float4 Position : SV_POSITION, float4 TexCoord[4] : TEXCOORD0, out float4 OutputColor0 : SV_TARGET0)
void DownsamplePS5(in float4 Position : SV_Position, in float4 TexCoord[4] : TEXCOORD0, out float4 OutputColor0 : SV_Target0)
{
OutputColor0 = DownsamplePS(_SampleBloom5, TexCoord);
}

void DownsamplePS6(float4 Position : SV_POSITION, float4 TexCoord[4] : TEXCOORD0, out float4 OutputColor0 : SV_TARGET0)
void DownsamplePS6(in float4 Position : SV_Position, in float4 TexCoord[4] : TEXCOORD0, out float4 OutputColor0 : SV_Target0)
{
OutputColor0 = DownsamplePS(_SampleBloom6, TexCoord);
}

void DownsamplePS7(float4 Position : SV_POSITION, float4 TexCoord[4] : TEXCOORD0, out float4 OutputColor0 : SV_TARGET0)
void DownsamplePS7(in float4 Position : SV_Position, in float4 TexCoord[4] : TEXCOORD0, out float4 OutputColor0 : SV_Target0)
{
OutputColor0 = DownsamplePS(_SampleBloom7, TexCoord);
}

void UpsamplePS8(float4 Position : SV_POSITION, float4 TexCoord[3] : TEXCOORD0, out float4 OutputColor0 : SV_TARGET0)
void UpsamplePS8(in float4 Position : SV_Position, in float4 TexCoord[3] : TEXCOORD0, out float4 OutputColor0 : SV_Target0)
{
OutputColor0 = UpsamplePS(_SampleBloom8, TexCoord);
}

void UpsamplePS7(float4 Position : SV_POSITION, float4 TexCoord[3] : TEXCOORD0, out float4 OutputColor0 : SV_TARGET0)
void UpsamplePS7(in float4 Position : SV_Position, in float4 TexCoord[3] : TEXCOORD0, out float4 OutputColor0 : SV_Target0)
{
OutputColor0 = UpsamplePS(_SampleBloom7, TexCoord);
}

void UpsamplePS6(float4 Position : SV_POSITION, float4 TexCoord[3] : TEXCOORD0, out float4 OutputColor0 : SV_TARGET0)
void UpsamplePS6(in float4 Position : SV_Position, in float4 TexCoord[3] : TEXCOORD0, out float4 OutputColor0 : SV_Target0)
{
OutputColor0 = UpsamplePS(_SampleBloom6, TexCoord);
}

void UpsamplePS5(float4 Position : SV_POSITION, float4 TexCoord[3] : TEXCOORD0, out float4 OutputColor0 : SV_TARGET0)
void UpsamplePS5(in float4 Position : SV_Position, in float4 TexCoord[3] : TEXCOORD0, out float4 OutputColor0 : SV_Target0)
{
OutputColor0 = UpsamplePS(_SampleBloom5, TexCoord);
}

void UpsamplePS4(float4 Position : SV_POSITION, float4 TexCoord[3] : TEXCOORD0, out float4 OutputColor0 : SV_TARGET0)
void UpsamplePS4(in float4 Position : SV_Position, in float4 TexCoord[3] : TEXCOORD0, out float4 OutputColor0 : SV_Target0)
{
OutputColor0 = UpsamplePS(_SampleBloom4, TexCoord);
}

void UpsamplePS3(float4 Position : SV_POSITION, float4 TexCoord[3] : TEXCOORD0, out float4 OutputColor0 : SV_TARGET0)
void UpsamplePS3(in float4 Position : SV_Position, in float4 TexCoord[3] : TEXCOORD0, out float4 OutputColor0 : SV_Target0)
{
OutputColor0 = UpsamplePS(_SampleBloom3, TexCoord);
}

void UpsamplePS2(float4 Position : SV_POSITION, float4 TexCoord[3] : TEXCOORD0, out float4 OutputColor0 : SV_TARGET0)
void UpsamplePS2(in float4 Position : SV_Position, in float4 TexCoord[3] : TEXCOORD0, out float4 OutputColor0 : SV_Target0)
{
OutputColor0 = UpsamplePS(_SampleBloom2, TexCoord);
}

void CompositePS(float4 Position : SV_POSITION, float2 TexCoord : TEXCOORD0, out float4 OutputColor0 : SV_TARGET0)
void CompositePS(in float4 Position : SV_Position, in float2 TexCoord : TEXCOORD0, out float4 OutputColor0 : SV_Target0)
{
float4 Src = tex2D(_SampleBloom1, TexCoord);
Src *= _Intensity;
Expand Down
4 changes: 2 additions & 2 deletions shaders/cCheckerBoard.fx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ uniform bool _InvertCheckerboard <
ui_label = "Invert Checkerboard Pattern";
> = false;

void PostProcessVS(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float2 TexCoord : TEXCOORD)
void PostProcessVS(in uint ID : SV_VertexID, out float4 Position : SV_Position, out float2 TexCoord : TEXCOORD)
{
TexCoord.x = (ID == 2) ? 2.0 : 0.0;
TexCoord.y = (ID == 1) ? 2.0 : 0.0;
Expand All @@ -27,7 +27,7 @@ void PostProcessVS(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION

/* [Pixel Shaders] */

void CheckerBoardPS(float4 Position : SV_POSITION, float2 TexCoord : TEXCOORD0, out float4 OutputColor0 : SV_TARGET0)
void CheckerBoardPS(in float4 Position : SV_Position, in float2 TexCoord : TEXCOORD0, out float4 OutputColor0 : SV_Target0)
{
float CheckerBoard = frac(dot(Position.xy, 0.5)) * 2.0;
CheckerBoard = _InvertCheckerboard ? 1.0 - CheckerBoard : CheckerBoard;
Expand Down
5 changes: 3 additions & 2 deletions shaders/cColorBlendOp.fx
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ uniform float4 _Color <

/* [Vertex Shaders] */

void PostProcessVS(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float2 TexCoord : TEXCOORD0)
void PostProcessVS(in uint ID : SV_VertexID, out float4 Position : SV_Position)
{
// Clip a triangle twice the screen's size to make a quad
float2 TexCoord = 0.0;
TexCoord.x = (ID == 2) ? 2.0 : 0.0;
TexCoord.y = (ID == 1) ? 2.0 : 0.0;
Position = float4(TexCoord * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0);
}

/* [Pixel Shaders] */

void ColorPS(float4 Position : SV_Position, out float4 OutputColor0 : SV_Target0)
void ColorPS(in float4 Position : SV_Position, out float4 OutputColor0 : SV_Target0)
{
// Fill this quad with a color
OutputColor0 = _Color;
Expand Down
4 changes: 2 additions & 2 deletions shaders/cColorNormalization.fx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ sampler2D _SampleColor

/* [Vertex Shaders] */

void PostProcessVS(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float2 TexCoord : TEXCOORD0)
void PostProcessVS(in uint ID : SV_VertexID, out float4 Position : SV_Position, out float2 TexCoord : TEXCOORD0)
{
TexCoord.x = (ID == 2) ? 2.0 : 0.0;
TexCoord.y = (ID == 1) ? 2.0 : 0.0;
Expand All @@ -43,7 +43,7 @@ void PostProcessVS(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION

/* [Pixel Shaders] */

void NormalizationPS(float4 Position : SV_POSITION, float2 TexCoord : TEXCOORD0, out float3 OutputColor0 : SV_TARGET0)
void NormalizationPS(in float4 Position : SV_Position, in float2 TexCoord : TEXCOORD0, out float3 OutputColor0 : SV_Target0)
{
OutputColor0 = 0.0;
float3 Color = tex2D(_SampleColor, TexCoord).rgb;
Expand Down
4 changes: 2 additions & 2 deletions shaders/cDefault.fx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
Placeholder shader to initialize the pipeline for comparing shaders
*/

void PostProcessVS(out float4 Position : SV_POSITION)
void PostProcessVS(out float4 Position : SV_Position)
{
Position = 0.0;
}

void PostProcessPS(out float4 OutputColor0 : SV_TARGET0)
void PostProcessPS(out float4 OutputColor0 : SV_Target0)
{
OutputColor0 = 0.0;
}
Expand Down
8 changes: 4 additions & 4 deletions shaders/cFilmGrain.fx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ uniform float _Intensity <

uniform float _Time < source = "timer"; >;

void PostProcessVS(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float2 TexCoord : TEXCOORD0)
void PostProcessVS(in uint ID : SV_VertexID, out float4 Position : SV_Position, out float2 TexCoord : TEXCOORD0)
{
TexCoord.x = (ID == 2) ? 2.0 : 0.0;
TexCoord.y = (ID == 1) ? 2.0 : 0.0;
Expand All @@ -37,20 +37,20 @@ float GaussianWeight(float x, float Sigma)
return rsqrt(Pi * Sigma) * exp(-((x * x) / (2.0 * Sigma)));
}

float4 VignettePS(float4 Position : SV_POSITION, float2 TexCoord : TEXCOORD0) : SV_Target
void FilmGrainPS(in float4 Position : SV_Position, in float2 TexCoord : TEXCOORD0, out float4 OutputColor0 : SV_Target0)
{
float Time = rcp(1e+3 / _Time) * _Speed;
float Seed = dot(Position.xy, float2(12.9898, 78.233));
float Noise = frac(sin(Seed) * 43758.5453 + Time);
return GaussianWeight(Noise, _Variance) * _Intensity;
OutputColor0 = GaussianWeight(Noise, _Variance) * _Intensity;
}

technique cFilmGrain
{
pass
{
VertexShader = PostProcessVS;
PixelShader = VignettePS;
PixelShader = FilmGrainPS;
// (Shader[Src] * SrcBlend) + (Buffer[Dest] * DestBlend)
// This shader: (Shader[Src] * (1.0 - Buffer[Dest])) + Buffer[Dest]
BlendEnable = TRUE;
Expand Down
6 changes: 3 additions & 3 deletions shaders/cFrameBlending.fx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ sampler2D _SampleCopy

/* [Vertex Shaders] */

void PostProcessVS(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float2 TexCoord : TEXCOORD0)
void PostProcessVS(in uint ID : SV_VertexID, out float4 Position : SV_Position, out float2 TexCoord : TEXCOORD0)
{
TexCoord.x = (ID == 2) ? 2.0 : 0.0;
TexCoord.y = (ID == 1) ? 2.0 : 0.0;
Expand All @@ -45,13 +45,13 @@ void PostProcessVS(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION

/* [Pixel Shaders] */

void BlendPS(float4 Position : SV_POSITION, float2 TexCoord : TEXCOORD0, out float4 OutputColor0 : SV_TARGET0)
void BlendPS(in float4 Position : SV_Position, in float2 TexCoord : TEXCOORD0, out float4 OutputColor0 : SV_Target0)
{
// Copy backbuffer to a that continuously blends with its previous result
OutputColor0 = float4(tex2D(_SampleColor, TexCoord).rgb, _BlendFactor);
}

void DisplayPS(float4 Position : SV_POSITION, float2 TexCoord : TEXCOORD0, out float4 OutputColor0 : SV_TARGET0)
void DisplayPS(in float4 Position : SV_Position, in float2 TexCoord : TEXCOORD0, out float4 OutputColor0 : SV_Target0)
{
// Display the buffer
OutputColor0 = tex2D(_SampleCopy, TexCoord);
Expand Down
Loading

0 comments on commit a16f387

Please sign in to comment.