// Fire - FIXED

cbuffer _Globals : register(b0)
{
  row_major float4x4 mVPTexgen : packoffset(c0);
}

cbuffer dynamic_transforms : register(b1)
{
  row_major float4x4 m_WVP : packoffset(c0);
  row_major float3x4 m_WV : packoffset(c4);
  row_major float3x4 m_W : packoffset(c7);
  float4 L_material : packoffset(c10);
  float4 hemi_cube_pos_faces : packoffset(c11);
  float4 hemi_cube_neg_faces : packoffset(c12);
  float4 dt_params : packoffset(c13);
}



// 3Dmigoto declarations
#define cmp -
Texture1D<float4> IniParams : register(t120);
Texture2D<float4> StereoParams : register(t125);


void main( 
  float4 v0 : POSITION0,
  float2 v1 : TEXCOORD0,
  float4 v2 : COLOR0,
  out float2 o0 : TEXCOORD0,
  out float4 o1 : COLOR0,
  out float4 o2 : TEXCOORD1,
  out float4 o3 : SV_Position0)
{
  float4 r0;
  uint4 bitmask, uiDest;
  float4 fDest;

  o0.xy = v1.xy;
  o1.xyzw = v2.zyxw;
  o2.x = dot(mVPTexgen._m00_m01_m02_m03, v0.xyzw);
  o2.y = dot(mVPTexgen._m10_m11_m12_m13, v0.xyzw);
  o2.w = dot(mVPTexgen._m30_m31_m32_m33, v0.xyzw);
  r0.x = dot(m_WVP._m20_m21_m22_m23, v0.xyzw);
  o2.z = r0.x;
  o3.z = r0.x;
  o3.x = dot(m_WVP._m00_m01_m02_m03, v0.xyzw);
  o3.y = dot(m_WVP._m10_m11_m12_m13, v0.xyzw);
  o3.w = dot(m_WVP._m30_m31_m32_m33, v0.xyzw);
float4 stereo = StereoParams.Load(0);
float4 params = IniParams.Load(0);
o2.x += stereo.x * (o2.w - stereo.y)/2;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.27.952.3022
//
//   using 3Dmigoto v1.2.29 on Mon Apr 11 23:11:32 2016
//
//
// Buffer Definitions: 
//
// cbuffer $Globals
// {
//
//   row_major float4x4 mVPTexgen;      // Offset:    0 Size:    64
//
// }
//
// cbuffer dynamic_transforms
// {
//
//   row_major float4x4 m_WVP;          // Offset:    0 Size:    64
//   row_major float3x4 m_WV;           // Offset:   64 Size:    48 [unused]
//   row_major float3x4 m_W;            // Offset:  112 Size:    48 [unused]
//   float4 L_material;                 // Offset:  160 Size:    16 [unused]
//   float4 hemi_cube_pos_faces;        // Offset:  176 Size:    16 [unused]
//   float4 hemi_cube_neg_faces;        // Offset:  192 Size:    16 [unused]
//   float4 dt_params;                  // Offset:  208 Size:    16 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// $Globals                          cbuffer      NA          NA    0        1
// dynamic_transforms                cbuffer      NA          NA    1        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float   xy  
// COLOR                    0   xyzw        2     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 0   xy          0     NONE   float   xy  
// COLOR                    0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 1   xyzw        2     NONE   float   xyzw
// SV_Position              0   xyzw        3      POS   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[4], immediateIndexed
dcl_constantbuffer cb1[4], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xy
dcl_input v2.xyzw
dcl_output o0.xy
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output_siv o3.xyzw, position
dcl_temps 1
mov o0.xy, v1.xyxx
mov o1.xyzw, v2.zyxw
dp4 o2.x, cb0[0].xyzw, v0.xyzw
dp4 o2.y, cb0[1].xyzw, v0.xyzw
dp4 o2.w, cb0[3].xyzw, v0.xyzw
dp4 r0.x, cb1[2].xyzw, v0.xyzw
mov o2.z, r0.x
mov o3.z, r0.x
dp4 o3.x, cb1[0].xyzw, v0.xyzw
dp4 o3.y, cb1[1].xyzw, v0.xyzw
dp4 o3.w, cb1[3].xyzw, v0.xyzw
ret 
// Approximately 12 instruction slots used

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