I have a very simple test effect file that I try to load with the following code:
using D3D = Microsoft.WindowsAPICodePack.DirectX.Direct3D10;
...
var DxDevice = CreateDevice(D3D.DriverType.Hardware);
var stream = Application.GetResourceStream(Global.MakePackUri("Resources/Effects/Test.ps"));
var DxEffect = DxDevice.CreateEffectFromCompiledBinary(stream.Stream);
MessageBox.Show(DxEffect.Description.Techniques);
The number of techniques in the effect always comes in as zero.
The effect file does nothing but colors the bitmap for easy recognition:
sampler2D input1 : register(S0);
float4 DoHorizontal(float2 uv : TEXCOORD) : COLOR
{
return float4(1, 0, 1, 1);
}
float4 DoVertical(float2 uv : TEXCOORD) : COLOR
{
return float4(1, 1, 0, 1);
}
technique Test
{
pass P0
{
PixelShader = compile ps_4_0 DoHorizontal();
}
pass P1
{
PixelShader = compile ps_4_0 DoVertical();
}
}
It compiles without any error (using fxc /T fx_4_0
). Is there any HLSL incompatiblity in Windows API Code Pack that might account for this strange behavior?