// DECAL VS - NEEDS MONO

cbuffer cbMatrixWorld : register(b10)
{
  row_major float4x4 VC_DecalTransform : packoffset(c0);
  float4 VC_WidthScale : packoffset(c4);
}



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


void main(
  float3 v0 : POSITION0,
  out float4 o0 : SV_Position0,
  out float4 o1 : TEXCOORD0)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.x = 1 + v0.y;
  r0.x = 0.5 * r0.x;
  r0.yz = float2(-1,-1) + VC_WidthScale.xy;
  r0.xy = r0.xx * r0.yz + float2(1,1);
  r0.xz = v0.xz * r0.xy;
  r0.y = v0.y;
  r0.w = 1;
  r1.x = dot(VC_DecalTransform._m00_m01_m02_m03, r0.xyzw);
  r1.y = dot(VC_DecalTransform._m10_m11_m12_m13, r0.xyzw);
  r1.z = dot(VC_DecalTransform._m20_m21_m22_m23, r0.xyzw);
  r1.w = dot(VC_DecalTransform._m30_m31_m32_m33, r0.xyzw);
  o0.xyzw = r1.xyzw;
  o1.xyzw = r1.xyzw;
  
  float4 stereo = StereoParams.Load(0);
  o1.x += stereo.x* (o0.w - stereo.y);
  
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
//   using 3Dmigoto v1.3.14 on Fri Mar 22 23:37:29 2019
//
//
// Buffer Definitions:
//
// cbuffer cbMatrixWorld
// {
//
//   row_major float4x4 VC_DecalTransform;// Offset:    0 Size:    64
//   float4 VC_WidthScale;              // Offset:   64 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// cbMatrixWorld                     cbuffer      NA          NA   10        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyz         0     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
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb10[5], immediateIndexed
dcl_input v0.xyz
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_temps 2
add r0.x, v0.y, l(1.000000)
mul r0.x, r0.x, l(0.500000)
add r0.yz, cb10[4].xxyx, l(0.000000, -1.000000, -1.000000, 0.000000)
mad r0.xy, r0.xxxx, r0.yzyy, l(1.000000, 1.000000, 0.000000, 0.000000)
mul r0.xz, r0.xxyx, v0.xxzx
mov r0.y, v0.y
mov r0.w, l(1.000000)
dp4 r1.x, cb10[0].xyzw, r0.xyzw
dp4 r1.y, cb10[1].xyzw, r0.xyzw
dp4 r1.z, cb10[2].xyzw, r0.xyzw
dp4 r1.w, cb10[3].xyzw, r0.xyzw
mov o0.xyzw, r1.xyzw
mov o1.xyzw, r1.xyzw
ret
// Approximately 14 instruction slots used

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