cbuffer cb2 : register(b2)
{
  float4 cb2[4];
}

cbuffer cb1 : register(b1)
{
  float4 cb1[6];
}

cbuffer cb0 : register(b0)
{
  float4 cb0[14];
}


Texture2D<float4> StereoParams : register(t125);
Texture1D<float4> IniParams : register(t120);

void main( 
  float4 v0 : POSITION0,
  float2 v1 : TEXCOORD0,
  out float4 o0 : SV_POSITION0,
  out float4 o1 : TEXCOORD0,
  out float4 o2 : TEXCOORD1,
  out float4 o3 : TEXCOORD2,
  out float4 o4 : TEXCOORD3,
  out float2 o5 : TEXCOORD4)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyzw = cb2[1].xyzw * v0.yyyy;
  r0.xyzw = cb2[0].xyzw * v0.xxxx + r0.xyzw;
  r0.xyzw = cb2[2].xyzw * v0.zzzz + r0.xyzw;
  r0.xyzw = cb2[3].xywz * v0.wwww + r0.xywz;
  o0.xyzw = r0.xywz;
float4 stereo = StereoParams.Load(0);
//r0.x += stereo.x*(r0.w - stereo.y);
  r1.xyzw = cb0[7].xyzw * v0.yyyy;
  r1.xyzw = cb0[6].xyzw * v0.xxxx + r1.xyzw;
  r1.xyzw = cb0[8].xyzw * v0.zzzz + r1.xyzw;
  r1.xyzw = cb0[9].xyzw * v0.wwww + r1.xyzw;
  o1.xyzw = float4(1,-1,1,1) * r1.xyzw;
  r1.xyzw = float4(1,-1,1,1) * r0.xywz;
  o2.xyzw = r1.xyzw;
  o4.zw = r1.zw;
  o3.xyzw = float4(0,0,0,0);
  r0.w = 0 < cb1[5].x;
  r0.y = r0.w ? -r0.y : r0.y;
  r1.xz = float2(0.5,0.5);
  r1.y = cb1[5].x;
  r0.xyz = r1.xyz * r0.xyz;
  r0.w = 0.5 * r0.y;
  o4.xy = r0.xw + r0.zz;
  o5.xy = v1.xy * cb0[13].xy + cb0[13].zw;
  return;
} 