Skip to content

Commit

Permalink
Attempt fix
Browse files Browse the repository at this point in the history
  • Loading branch information
brimson committed May 23, 2022
1 parent 12f6db9 commit 136ea74
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
9 changes: 4 additions & 5 deletions shaders/cMotionBlur.fx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ namespace Motion_Blur
[Vertex Shaders]
*/

void Basic_VS(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float2 TexCoord : TEXCOORD0)
void Basic_VS(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 @@ -173,10 +173,10 @@ namespace Motion_Blur
float4(0.0, 13.416645, 15.404578, 17.392626)
};

void Blur_VS(in bool IsAlt, in float2 PixelSize, in uint ID, inout float4 Position, inout float4 TexCoords[7])
void Blur_VS(in bool IsAlt, in float2 PixelSize, in uint ID, out float4 Position, out float4 TexCoords[7])
{
TexCoords[0] = 0.0;
Basic_VS(ID, Position, TexCoords[0].xy);

if (!IsAlt)
{
TexCoords[1] = TexCoords[0].xyyy + (BlurOffsets[0].xyzw / PixelSize.xyyy);
Expand All @@ -195,11 +195,10 @@ namespace Motion_Blur
TexCoords[5] = TexCoords[0].xxxy - (BlurOffsets[1].yzwx / PixelSize.xxxy);
TexCoords[6] = TexCoords[0].xxxy - (BlurOffsets[2].yzwx / PixelSize.xxxy);
}

}

#define BLUR_VS(NAME, IS_ALT, PIXEL_SIZE) \
void NAME(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float4 TexCoords[7] : TEXCOORD0) \
void NAME(in uint ID : SV_VERTEXID, out float4 Position : SV_POSITION, out float4 TexCoords[7] : TEXCOORD0) \
{ \
Blur_VS(IS_ALT, PIXEL_SIZE, ID, Position, TexCoords); \
}
Expand Down
7 changes: 3 additions & 4 deletions shaders/cOpticalFlow.fx
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@ namespace OpticalFlow
float4(0.0, 13.416645, 15.404578, 17.392626)
};

void Blur_VS(in bool IsAlt, in float2 PixelSize, in uint ID, inout float4 Position, inout float4 TexCoords[7])
void Blur_VS(in bool IsAlt, in float2 PixelSize, in uint ID, out float4 Position, out float4 TexCoords[7])
{
TexCoords[0] = 0.0;
Basic_VS(ID, Position, TexCoords[0].xy);

if (!IsAlt)
{
TexCoords[1] = TexCoords[0].xyyy + (BlurOffsets[0].xyzw / PixelSize.xyyy);
Expand All @@ -240,11 +240,10 @@ namespace OpticalFlow
TexCoords[5] = TexCoords[0].xxxy - (BlurOffsets[1].yzwx / PixelSize.xxxy);
TexCoords[6] = TexCoords[0].xxxy - (BlurOffsets[2].yzwx / PixelSize.xxxy);
}

}

#define BLUR_VS(NAME, IS_ALT, PIXEL_SIZE) \
void NAME(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float4 TexCoords[7] : TEXCOORD0) \
void NAME(in uint ID : SV_VERTEXID, out float4 Position : SV_POSITION, out float4 TexCoords[7] : TEXCOORD0) \
{ \
Blur_VS(IS_ALT, PIXEL_SIZE, ID, Position, TexCoords); \
}
Expand Down
7 changes: 3 additions & 4 deletions shaders/kDatamosh.fx
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,10 @@ namespace Datamosh
float4(0.0, 13.416645, 15.404578, 17.392626)
};

void Blur_VS(in bool IsAlt, in float2 PixelSize, in uint ID, inout float4 Position, inout float4 TexCoords[7])
void Blur_VS(in bool IsAlt, in float2 PixelSize, in uint ID, out float4 Position, out float4 TexCoords[7])
{
TexCoords[0] = 0.0;
Basic_VS(ID, Position, TexCoords[0].xy);

if (!IsAlt)
{
TexCoords[1] = TexCoords[0].xyyy + (BlurOffsets[0].xyzw / PixelSize.xyyy);
Expand All @@ -226,11 +226,10 @@ namespace Datamosh
TexCoords[5] = TexCoords[0].xxxy - (BlurOffsets[1].yzwx / PixelSize.xxxy);
TexCoords[6] = TexCoords[0].xxxy - (BlurOffsets[2].yzwx / PixelSize.xxxy);
}

}

#define BLUR_VS(NAME, IS_ALT, PIXEL_SIZE) \
void NAME(in uint ID : SV_VERTEXID, inout float4 Position : SV_POSITION, inout float4 TexCoords[7] : TEXCOORD0) \
void NAME(in uint ID : SV_VERTEXID, out float4 Position : SV_POSITION, out float4 TexCoords[7] : TEXCOORD0) \
{ \
Blur_VS(IS_ALT, PIXEL_SIZE, ID, Position, TexCoords); \
}
Expand Down

0 comments on commit 136ea74

Please sign in to comment.