//Shadows VS
cbuffer PER_BATCH : register(b0)
{
  row_major float4x4 TexGen0 : packoffset(c0);
  float4 g_vViewPos : packoffset(c4);
  float4 fOneDivFarDist : packoffset(c5);
  float4 fDepthTestBias : packoffset(c6);
  float4 LSPos : packoffset(c7);
  row_major float4x4 RotMatrix : packoffset(c8);
}

cbuffer PER_INSTANCE : register(b1)
{
  row_major float4x4 CompMatrix : packoffset(c0);
}

cbuffer PER_FRAME : register(b3)
{
  row_major float4x4 g_VS_ViewProjMatr : packoffset(c0);  //new
  float4 g_VS_SunLightDir : packoffset(c4); //new
  float4 g_VS_WorldViewPos : packoffset(c6); //new
  float4 g_VS_ScreenSize : packoffset(c7);
  float4 g_VS_AnimGenParams : packoffset(c8); //new
  float4 g_VS_NearFarClipDist : packoffset(c9); //new
  row_major float4x4 g_VS_ViewProjZeroMatr : packoffset(c10); //new
  float4 g_VS_HPosScale : packoffset(c21);
  
}

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

void main( 
  float4 v0 : POSITION0,
  float4 v1 : TEXCOORD0,
  float3 v2 : TEXCOORD1,
  out float4 o0 : SV_Position0,
  out float4 o1 : TEXCOORD0,
  out float4 o2 : TEXCOORD1,
  
      out float4 nearfar : TEXCOORD2,
  out float4 res : TEXCOORD3)
  
{
  float4 r0;
  uint4 bitmask, uiDest;
  float4 fDest;

  o0.x = dot(CompMatrix._m00_m01_m02_m03, v0.xyzw);
  o0.y = dot(CompMatrix._m10_m11_m12_m13, v0.xyzw);
  o0.z = dot(CompMatrix._m20_m21_m22_m23, v0.xyzw);
  o0.w = dot(CompMatrix._m30_m31_m32_m33, v0.xyzw);
  r0.xyz = g_vViewPos.xyz + v2.xyz;
  r0.yw = RotMatrix._m10_m11 * r0.yy;
  r0.xy = r0.xx * RotMatrix._m00_m01 + r0.yw;
  r0.xy = r0.zz * RotMatrix._m20_m21 + r0.xy;
  r0.zw = RotMatrix._m10_m11 * g_vViewPos.yy;
  r0.zw = g_vViewPos.xx * RotMatrix._m00_m01 + r0.zw;
  r0.zw = g_vViewPos.zz * RotMatrix._m20_m21 + r0.zw;
  o1.zw = r0.xy + -r0.zw;
  o1.xy = r0.zw;
  r0.xy = g_VS_ScreenSize.xy * v1.xy;
  o2.zw = float2(0.25,0.25) * r0.xy;
  o2.xy = v1.xy;
  
  //Pass far clipping plane and screen resolution through to pixel shader:
  nearfar = g_VS_NearFarClipDist;
  res = g_VS_ScreenSize;
  
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//
// Buffer Definitions: 
//
// cbuffer PER_BATCH
// {
//
//   row_major float4x4 TexGen0;        // Offset:    0 Size:    64 [unused]
//   float4 g_vViewPos;                 // Offset:   64 Size:    16
//   float4 fOneDivFarDist;             // Offset:   80 Size:    16 [unused]
//   float4 fDepthTestBias;             // Offset:   96 Size:    16 [unused]
//   float4 LSPos;                      // Offset:  112 Size:    16 [unused]
//   row_major float4x4 RotMatrix;      // Offset:  128 Size:    64
//
// }
//
// cbuffer PER_INSTANCE
// {
//
//   row_major float4x4 CompMatrix;     // Offset:    0 Size:    64
//
// }
//
// cbuffer PER_FRAME
// {
//
//   float4 g_VS_ScreenSize;            // Offset:  112 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// PER_BATCH                         cbuffer      NA          NA    0        1
// PER_INSTANCE                      cbuffer      NA          NA    1        1
// PER_FRAME                         cbuffer      NA          NA    3        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float   xy  
// TEXCOORD                 1   xyz         2     NONE   float   xyz 
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 1   xyzw        2     NONE   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[11], immediateIndexed
dcl_constantbuffer cb1[4], immediateIndexed
dcl_constantbuffer cb3[8], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xy
dcl_input v2.xyz
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_temps 1
dp4 o0.x, cb1[0].xyzw, v0.xyzw
dp4 o0.y, cb1[1].xyzw, v0.xyzw
dp4 o0.z, cb1[2].xyzw, v0.xyzw
dp4 o0.w, cb1[3].xyzw, v0.xyzw
add r0.xyz, v2.xyzx, cb0[4].xyzx
mul r0.yw, r0.yyyy, cb0[9].xxxy
mad r0.xy, r0.xxxx, cb0[8].xyxx, r0.ywyy
mad r0.xy, r0.zzzz, cb0[10].xyxx, r0.xyxx
mul r0.zw, cb0[4].yyyy, cb0[9].xxxy
mad r0.zw, cb0[4].xxxx, cb0[8].xxxy, r0.zzzw
mad r0.zw, cb0[4].zzzz, cb0[10].xxxy, r0.zzzw
add o1.zw, -r0.zzzw, r0.xxxy
mov o1.xy, r0.zwzz
mul r0.xy, v1.xyxx, cb3[7].xyxx
mul o2.zw, r0.xxxy, l(0.000000, 0.000000, 0.250000, 0.250000)
mov o2.xy, v1.xyxx
ret 
// Approximately 17 instruction slots used

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
