// hlsltool.py -I ../112 --auto-fix-vertex-halo --fix-unity-reflection --only-autofixed --no-validate --ignore-other-errors 0f8b89da49706446-vs_replace.txt
// 3DMigoto: 0f8b89da49706446 | Matched 8 variants of 8 shaders: Hidden/Amplify Color/Base, Hidden/Amplify Color/Blend, Hidden/Amplify Color/BlendCache, Hidden/Amplify Color/DepthMask, Hidden/Amplify Color/DepthMaskBlend, Hidden/Amplify Color/Mask, Hidden/Amplify Color/MaskBlend, Hidden/Amplify Color/ProcessOnly
//
// 01:    Unity headers extracted from Base.shader
// 02:    Unity headers extracted from Blend.shader
// 04:    Unity headers extracted from BlendCache.shader
// 08:    Unity headers extracted from DepthMask.shader
// 10:    Unity headers extracted from DepthMaskBlend.shader
// 20:    Unity headers extracted from Mask.shader
// 40:    Unity headers extracted from MaskBlend.shader
// 80:    Unity headers extracted from ProcessOnly.shader
// 01:    Shader "Hidden/Amplify Color/Base" {
// 02:    Shader "Hidden/Amplify Color/Blend" {
// 04:    Shader "Hidden/Amplify Color/BlendCache" {
// 08:    Shader "Hidden/Amplify Color/DepthMask" {
// 10:    Shader "Hidden/Amplify Color/DepthMaskBlend" {
// 20:    Shader "Hidden/Amplify Color/Mask" {
// 40:    Shader "Hidden/Amplify Color/MaskBlend" {
// 80:    Shader "Hidden/Amplify Color/ProcessOnly" {
//          Properties {
//           _MainTex ("Base (RGB)", 2D) = "" { }
//          }
//          Fallback Off
//          SubShader 1/1 {
// 04:        Pass 1/1 {
// fb:        Pass 1/36 {
//              ZTest Always
//              ZWrite Off
//              Cull Off
// 02:          GpuProgramID 12018
// 20:          GpuProgramID 13886
// 40:          GpuProgramID 21030
// 80:          GpuProgramID 27081
// 01:          GpuProgramID 43450
// 10:          GpuProgramID 44542
// 08:          GpuProgramID 51119
// 04:          GpuProgramID 8802
//              Program "vp" {
//                SubProgram "d3d11 " {
//                  GpuProgramIndex 1
//                }
//              }
//            }
//          }
//        }
//
// 01: Unity 5.3 headers extracted from Base.shader.decompressed:
// 02: Unity 5.3 headers extracted from Blend.shader.decompressed:
// 04: Unity 5.3 headers extracted from BlendCache.shader.decompressed:
// 08: Unity 5.3 headers extracted from DepthMask.shader.decompressed:
// 10: Unity 5.3 headers extracted from DepthMaskBlend.shader.decompressed:
// 20: Unity 5.3 headers extracted from Mask.shader.decompressed:
// 40: Unity 5.3 headers extracted from MaskBlend.shader.decompressed:
// 80: Unity 5.3 headers extracted from ProcessOnly.shader.decompressed:
//       API d3d11
//       Shader model vs_4_0
//       undeciphered1: 201509030 9 0 0
//       undeciphered2: 1 0 3 0 0
//       undeciphered3: 9 2 0 0 3 4
//       ConstBuffer "$Globals" 176
//       Vector 96 [_MainTex_TexelSize]
//       ConstBuffer "UnityPerCamera" 144
//       Vector 80 [_ProjectionParams]
//       ConstBuffer "UnityPerDraw" 352
//       Matrix 0 [glstate_matrix_mvp]
//       BindCB "$Globals" 0
//       BindCB "UnityPerCamera" 1
//       BindCB "UnityPerDraw" 2
//
// 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:24:38 2017
cbuffer cb2 : register(b2)
{
  float4 cb2[4];
}

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

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




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


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

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

  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].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 0f8b89da49706446-vs_replace.txt
if (r0.w != 1.0) { r0.x += separation * (r0.w - convergence); }

  r0.y = cb1[5].x * r0.y;
  r1.xzw = float3(0.5,0.5,0.5) * r0.xwy;
  o1.zw = r0.zw;
  o1.xy = r1.xw + r1.zz;
  r0.x = cmp(cb0[6].y < 0);
  r0.y = 1 + -v1.y;
  o2.w = r0.x ? r0.y : v1.y;
  o2.xyz = v1.xyx;
  return;
}
  