// hlsltool.py -I ../112 --auto-fix-vertex-halo --fix-unity-reflection --only-autofixed --no-validate --ignore-other-errors e5dea26c73dab140-vs_replace.txt
// 3DMigoto: e5dea26c73dab140 | Matched 3 variants of 3 shaders: PlayWay Water/Volumes/Back, PlayWay Water/Volumes/Front, PlayWay Water/Volumes/Front Simple
//
// 1:    Unity headers extracted from Volume - Back Depth.shader
// 4:    Unity headers extracted from Volume - Front Depth Fast.shader
// 2:    Unity headers extracted from Volume - Front Depth.shader
// 1:    Shader "PlayWay Water/Volumes/Back" {
// 4:    Shader "PlayWay Water/Volumes/Front Simple" {
// 2:    Shader "PlayWay Water/Volumes/Front" {
//         Properties {
// 6:       _WaterId ("", Vector) = (2,1,0,0)
//          _WaterStencilId ("", Float) = 0
// 6:       _WaterStencilIdInv ("", Float) = 0
//         }
//         SubShader 1/1 {
//           Tags { "CustomType"="WaterVolume" }
// 5:        Pass 1/1 {
// 2:        Pass 1/2 {
//             Tags { "CustomType"="WaterVolume" }
// 1:          ZTest Always
// 6:          ZTest Less
// 1:          ZWrite Off
// 1:          Cull Front
//             Stencil {
// 2:             Ref [_WaterStencilIdInv]
// 5:             Ref [_WaterStencilId]
// 1:             Comp Equal
// 6:             Pass Replace
// 2:             Fail Invert
// 2:             ZFail Invert
//               }
// 1:          Blend One One
// 6:          ColorMask RB
// 1:          BlendOp Max
// 4:          GpuProgramID 19350
// 2:          GpuProgramID 46223
// 1:          ColorMask G
// 1:          GpuProgramID 1369
//             Program "vp" {
//               SubProgram "d3d11_9x " {
//                 GpuProgramIndex 2
//               }
//             }
//           }
//         }
//       }
//
// 1: Unity 5.3 headers extracted from Volume - Back Depth.shader.decompressed:
// 4: Unity 5.3 headers extracted from Volume - Front Depth Fast.shader.decompressed:
// 2: Unity 5.3 headers extracted from Volume - Front Depth.shader.decompressed:
//      API d3d11_9x
//      Shader model vs_4_0_level_9_1
//      undeciphered1: 201509030 4 0 0
//      undeciphered2: 1 0 1 0 0
//      undeciphered3: 1 1 0 0
//      ConstBuffer "UnityPerDraw" 352
//      Matrix 0 [glstate_matrix_mvp]
//      BindCB "UnityPerDraw" 0
//
// Headers extracted with DarkStarSword's extract_unity53_shaders.py
// https://raw.githubusercontent.com/DarkStarSword/3d-fixes/master/extract_unity53_shaders.py

// ---- Created with 3Dmigoto v1.2.38 on Thu Feb 09 12:34:34 2017
cbuffer cb0 : register(b0)
{
  float4 cb0[4];
}




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


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

float4 stereo = StereoParams.Load(0);
float separation = stereo.x, convergence = stereo.y, eye = stereo.z;

  r0.xyzw = cb0[1].xyzw * v0.yyyy;
  r0.xyzw = cb0[0].xyzw * v0.xxxx + r0.xyzw;
  r0.xyzw = cb0[2].xyzw * v0.zzzz + r0.xyzw;
  r0.xyzw = cb0[3].xyzw * v0.wwww + r0.xyzw;
  o0.xyzw = r0.xyzw;

// Automatic vertex shader halo fix inserted with DarkStarSword's hlsltool.py:
// hlsltool.py -I ../112 --auto-fix-vertex-halo --fix-unity-reflection --only-autofixed --no-validate --ignore-other-errors e5dea26c73dab140-vs_replace.txt
if (r0.w != 1.0) { r0.x += separation * (r0.w - convergence); }

  o1.xy = r0.zw;
  return;
}
