[
Edit I wrote the following before I saw your last comment. Object shaders are indeed another kettle of fish. I'm going to have to do something else now but hopefully there's something in this example which you'll find helpful.]
I think I've fixed your initial shader. Here's the revised version with comments:
float4x4 WorldViewProj : WorldViewProjection;
int TexWidth = 480;
texture inputTexture : RENDERCOLORTARGET
<
string ResourceName = "";
float2 ViewportRatio = { 1.0, 1.0 };
>;
sampler2D inputTextureSampler = sampler_state {
Texture = < inputTexture >;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
AddressU = Wrap;
AddressV = Wrap;
};
texture swapTexture : RENDERCOLORTARGET
<
string ResourceName = "";
float2 ViewportRatio = { 1.0, 1.0 };
>;
sampler2D swapSampler = sampler_state {
Texture = < swapTexture >;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
AddressU = Wrap;
AddressV = Wrap;
};
const int KernelSize = 7;
float2 PixelKernel[11] =
{
-5, 0,
-4, 0,
-3, 0,
-2, 0,
-1, 0,
0, 0,
1, 0,
2, 0,
3, 0,
4, 0,
5, 0,
};
float2 PixelKernel2[11] =
{
0, -5,
0, -4,
0, -3,
0, -2,
0, -1,
0, 0,
0, 1,
0, 2,
0, 3,
0, 4,
0, 5,
};
const float BlurWeights[11] =
{
0.0663416609168,
0.0794253870845,
0.0913609489799,
0.100969448686,
0.107213057578,
0.109378911555,
0.107213057578,
0.100969448686,
0.0913609489799,
0.0794253870845,
0.0663416609168,
};
struct inputData
{
float4 Position : POSITION;
float2 TextureCoords : TEXCOORD0;
};
struct outputData
{
float4 Position : POSITION;
float2 TextureCoords : TEXCOORD0;
};
//Vertex Shader passes on data to pixel shader including the texture coordinates of the texture
outputData SmoothVS(inputData IN)
{
outputData OUT;
// OUT.Position = float4(IN.Position.xy + float2(-InvViewSize.x, InvViewSize.y ), 0.0, 1.0 ); // strictly, you need something like this - a quibble though
OUT.Position = float4(IN.Position.xy, 0.0, 1.0 ); // *** THIS IS VITAL for a built-in quad
OUT.TextureCoords = (IN.Position.xy + 1.0) * 0.5; // *** THIS MAY BE VITAL TOO - it is in Dark Shader anyway
OUT.TextureCoords.y = 1.0 - OUT.TextureCoords.y; // ** and this too (but not in case of two passes as it happens :))
return OUT;
}
float4 SmoothPS(outputData IN): COLOR
{
float4 colour = 0;
float2 TexSize = float2(1.0/TexWidth, 1.0/TexWidth);
for(int p = 0; p < 11; p++)
{
colour += tex2D(inputTextureSampler, IN.TextureCoords + (PixelKernel2[p] * TexSize)) * BlurWeights[p];
}
return colour;
}
float4 SmoothMorePS(outputData IN, uniform sampler2D srcTex): COLOR
{
float4 colour = 0;
float2 TexSize = float2(1.0/TexWidth, 1.0/TexWidth);
for(int p = 0; p < 11; p++)
{
colour += tex2D(srcTex, IN.TextureCoords + (PixelKernel[p] * TexSize)) * BlurWeights[p];
}
return colour;
}
/*
technique SingleBlur
{
pass Pass0
{
VertexShader = compile vs_2_0 SmoothVS();
PixelShader = compile ps_2_0 SmoothPS();
}
}
*/
technique DoubleBlur
<
string RenderColorTarget = "inputTexture"; // *** THIS IS VITAL TOO - for Dark Shader anyway
>
{
pass Pass0
//Should write output to swapTexture
<
string RenderColorTarget = "swapTexture";
>
{
VertexShader = compile vs_2_0 SmoothVS();
PixelShader = compile ps_2_0 SmoothPS();
}
pass Pass1
//Should write output to screen buffer
<
string RenderColorTarget = "";
>
{
VertexShader = compile vs_2_0 SmoothVS();
//Should get input from swapTexure
PixelShader = compile ps_2_0 SmoothMorePS( swapSampler );
}
}
I think I've added comments to all the vital steps - but I have fiddled with a few irrelevant things as well which you can ignore like deleting redundant brackets.
These changes allow the shader to run correctly as a fullscreen shader in Dark Shader. If you are using your own screen quad or other object you may need to tweak the vertex shader again.
I've been unable to find decent documentation on things like the bits between < and > in the technique and pass sections of the code so I sympathise.

The only way that works for me is to work from a shader which is known to work. Not ideal but there we are.