If I use vs_3_0, the shader compiles fine but my calls to DrawIndexedPrimitive return D3DERR_INVALIDCALL. All other calls succeed.
Shader code:
struct VS_INPUT
{
float4 Position : POSITION;
float2 Texture : TEXCOORD0;
float4 VecScale : COLOR0;
float4 TexScale : COLOR1;
};
struct VS_OUTPUT
{
float4 Position : POSITION;
float2 Texture : TEXCOORD0;
};
// Global variables
float4x4 WorldViewProj;
VS_OUTPUT main( in VS_INPUT In )
{
VS_OUTPUT Out;
float4 pos = In.Position;
pos.x = In.Position.x * In.VecScale.y + In.VecScale.x;
pos.z = In.Position.z * In.VecScale.w + In.VecScale.z;
Out.Position = mul(pos,
WorldViewProj);
Out.Texture = In.Texture;
return Out;
}
Assembly for vs_1_1:
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// Parameters:
//
// float4x4 WorldViewProj;
//
//
// Registers:
//
// Name Reg Size
// ------------- ----- ----
// WorldViewProj c0 4
//
vs_1_1
def c4, 1, 0, 0, 0
dcl_position v0
dcl_texcoord v1
dcl_color v2
mov r0, v2
mad r0.xy, v0.xzzw, r0.ywzw, r0.xzzw
mov r0.z, c4.x
dp3 oPos.x, r0, c0.xzww
dp3 oPos.y, r0, c1.xzww
dp3 oPos.z, r0, c2.xzww
dp3 oPos.w, r0, c3.xzww
mov oT0.xy, v1
// approximately 8 instruction slots used
Assembly code for vs_3_0:
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// Parameters:
//
// float4x4 WorldViewProj;
//
//
// Registers:
//
// Name Reg Size
// ------------- ----- ----
// WorldViewProj c0 4
//
vs_3_0
def c4, 1, 0, 0, 0
dcl_position v0
dcl_texcoord v1
dcl_color v2
dcl_position o0
dcl_texcoord o1.xy
mov r0, v2
mad r0.xy, v0.xzzw, r0.ywzw, r0.xzzw
mov r0.z, c4.x
dp3 o0.x, r0, c0.xzww
dp3 o0.y, r0, c1.xzww
dp3 o0.z, r0, c2.xzww
dp3 o0.w, r0, c3.xzww
mov o1.xy, v1
// approximately 8 instruction slots used
Anyone know why it could be failing?