diff options
author | CrystalP <CrystalP@xbmc.org> | 2011-01-24 00:18:57 -0500 |
---|---|---|
committer | CrystalP <CrystalP@xbmc.org> | 2011-09-01 22:29:46 -0400 |
commit | 40c333d65490f75b62d93db40960605be06a3e44 (patch) | |
tree | 94d15fc203706767b863870a08ba06905dbcda06 /system | |
parent | 5c66ec4bd2fde909adc98b5aeef02e7583627a75 (diff) |
Add multipass shader support to the CWinShader class: Execute() receives an array of render targets and uses different vertices for each pass.
The parameters are set once before rendering.
The shaders themselves haven't changed yet, the second pass is just a dummy copy of the source to the target.
Diffstat (limited to 'system')
-rw-r--r-- | system/shaders/convolutionsep-4x4_d3d.fx | 24 | ||||
-rw-r--r-- | system/shaders/convolutionsep-6x6_d3d.fx | 24 |
2 files changed, 44 insertions, 4 deletions
diff --git a/system/shaders/convolutionsep-4x4_d3d.fx b/system/shaders/convolutionsep-4x4_d3d.fx index 6d78d0ef40..d8700f16a2 100644 --- a/system/shaders/convolutionsep-4x4_d3d.fx +++ b/system/shaders/convolutionsep-4x4_d3d.fx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2010 Team XBMC + * Copyright (C) 2005-2011 Team XBMC * http://www.xbmc.org * * This Program is free software; you can redistribute it and/or modify @@ -21,6 +21,7 @@ texture g_Texture; texture g_KernelTexture; +texture g_IntermediateTexture; float2 g_StepXY; sampler RGBSampler = @@ -44,6 +45,16 @@ sampler KernelSampler = MagFilter = LINEAR; }; +sampler IntermediateSampler = + sampler_state { + Texture = <g_IntermediateTexture>; + AddressU = CLAMP; + AddressV = CLAMP; + MipFilter = LINEAR; + MinFilter = POINT; + MagFilter = POINT; + }; + struct VS_OUTPUT { float4 Position : POSITION; @@ -143,6 +154,15 @@ PS_OUTPUT CONVOLUTION4x4Vert(VS_OUTPUT In) return OUT; } +PS_OUTPUT Nothing(VS_OUTPUT In) +{ + PS_OUTPUT OUT; + + OUT.RGBColor.rgb = tex2D(IntermediateSampler, In.TextureUV).rgb; + OUT.RGBColor.a = 1.0; + return OUT; +} + technique SCALER_T { pass P0 @@ -154,7 +174,7 @@ technique SCALER_T } pass P1 { - PixelShader = compile ps_3_0 CONVOLUTION4x4Vert(); + PixelShader = compile ps_3_0 Nothing(); ZEnable = False; FillMode = Solid; FogEnable = False; diff --git a/system/shaders/convolutionsep-6x6_d3d.fx b/system/shaders/convolutionsep-6x6_d3d.fx index dbb67926b4..52cc641664 100644 --- a/system/shaders/convolutionsep-6x6_d3d.fx +++ b/system/shaders/convolutionsep-6x6_d3d.fx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2010 Team XBMC + * Copyright (C) 2005-2011 Team XBMC * http://www.xbmc.org * * This Program is free software; you can redistribute it and/or modify @@ -21,6 +21,7 @@ texture g_Texture; texture g_KernelTexture; +texture g_IntermediateTexture; float2 g_StepXY; sampler RGBSampler = @@ -44,6 +45,16 @@ sampler KernelSampler = MagFilter = LINEAR; }; +sampler IntermediateSampler = + sampler_state { + Texture = <g_IntermediateTexture>; + AddressU = CLAMP; + AddressV = CLAMP; + MipFilter = LINEAR; + MinFilter = POINT; + MagFilter = POINT; + }; + struct VS_OUTPUT { float4 Position : POSITION; @@ -157,6 +168,15 @@ PS_OUTPUT CONVOLUTION6x6Vert(VS_OUTPUT In) return OUT; } +PS_OUTPUT Nothing(VS_OUTPUT In) +{ + PS_OUTPUT OUT; + + OUT.RGBColor.rgb = tex2D(IntermediateSampler, In.TextureUV).rgb; + OUT.RGBColor.a = 1.0; + return OUT; +} + technique SCALER_T { pass P0 @@ -168,7 +188,7 @@ technique SCALER_T } pass P1 { - PixelShader = compile ps_3_0 CONVOLUTION6x6Vert(); + PixelShader = compile ps_3_0 Nothing(); ZEnable = False; FillMode = Solid; FogEnable = False; |