From 136ea741e97b3783649c44c16935dbee7ae0150f Mon Sep 17 00:00:00 2001 From: brimson Date: Mon, 23 May 2022 00:51:52 -0700 Subject: [PATCH] Attempt fix --- shaders/cMotionBlur.fx | 9 ++++----- shaders/cOpticalFlow.fx | 7 +++---- shaders/kDatamosh.fx | 7 +++---- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/shaders/cMotionBlur.fx b/shaders/cMotionBlur.fx index 7afca5d..09773b6 100644 --- a/shaders/cMotionBlur.fx +++ b/shaders/cMotionBlur.fx @@ -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; @@ -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); @@ -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); \ } diff --git a/shaders/cOpticalFlow.fx b/shaders/cOpticalFlow.fx index e7decc0..14f8535 100644 --- a/shaders/cOpticalFlow.fx +++ b/shaders/cOpticalFlow.fx @@ -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); @@ -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); \ } diff --git a/shaders/kDatamosh.fx b/shaders/kDatamosh.fx index 59f47f8..e4c003f 100644 --- a/shaders/kDatamosh.fx +++ b/shaders/kDatamosh.fx @@ -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); @@ -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); \ }