// asmtool.py -I ../.. --auto-fix-vertex-halo --fix-unusual-halo-with-inconsistent-w-optimisation --fix-unity-reflection --fix-unity-frustum-world --only-autofixed 0a7701014e2afadf-vs.txt
// 3DMigoto: 0a7701014e2afadf | Matched 4 variants of 1 shaders: Kyoto/VFX/Transparent Diffuse Additive Lit
//
//       Unity headers extracted from TransparentDiffuseAdditiveLit.shader
//       Shader "Kyoto/VFX/Transparent Diffuse Additive Lit" {
//         Properties {
//         [HideInInspector]  _Mode ("__mode", Float) = 2.000000
//         [HideInInspector]  _SrcBlend ("__src", Float) = 1.000000
//         [HideInInspector]  _DstBlend ("__dst", Float) = 0.000000
//          _Color ("Color", Color) = (1.000000,1.000000,1.000000,1.000000)
//          _MainTex ("Albedo", 2D) = "white" { }
//          _DepthFeatherAmount ("Depth Feather", Range(0.000000,500.000000)) = 1.000000
//          _ShadowProjectionAlphaModulation ("Shadow Alpha Projection Offset", Range(1.000000,20.000000)) = 5.000000
//          _ShadowBias ("Shadow Bias", Range(0.000000,0.900000)) = 0.100000
//          _NormalDirectionalStrength ("Directional light NdotL strength", Range(0.000000,1.000000)) = 1.000000
//          _WorldSpaceNormalOverrideBias ("World Space Normal Override Bias", Range(0.000000,1.000000)) = 0.000000
//          _WorldSpaceNormalOverrideDir ("World Space Normal Direction", Vector) = (0.000000,1.000000,0.000000,1.000000)
//         }
//         Fallback Off
//         SubShader 1/1 {
//           Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" }
//           Pass 2/3 {
//             Name "FORWARD_DELTA"
//             Tags { "LIGHTMODE"="ForwardAdd" "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "SHADOWSUPPORT"="true" }
//             ZWrite Off
//             Cull Off
//             Blend SrcAlpha One
//             GpuProgramID 73056
//             Program "vp" {
//               SubProgram "d3d11 " {
// 1:              GpuProgramIndex 144
// 2:              GpuProgramIndex 145
// 4:              GpuProgramIndex 189
// 8:              GpuProgramIndex 190
//               }
//             }
//           }
//         }
//       }
//
//    Unity 5.3 headers extracted from TransparentDiffuseAdditiveLit.shader.decompressed:
//      API d3d11
//      Shader model vs_4_0
//      undeciphered1: 201510240 25 0 0
// 8:   Keywords { "DIRECTIONAL" "SHADOWS_DEPTH" "LIGHTMAP_OFF" "DIRLIGHTMAP_OFF" "DYNAMICLIGHTMAP_OFF" "UNITY_HDR_ON" }
// 2:   Keywords { "DIRECTIONAL" "SHADOWS_DEPTH" "LIGHTMAP_OFF" "DIRLIGHTMAP_OFF" "DYNAMICLIGHTMAP_OFF" }
// 4:   Keywords { "DIRECTIONAL" "SHADOWS_DEPTH" "SHADOWS_SOFT" "LIGHTMAP_OFF" "DIRLIGHTMAP_OFF" "DYNAMICLIGHTMAP_OFF" "UNITY_HDR_ON" }
// 1:   Keywords { "DIRECTIONAL" "SHADOWS_DEPTH" "SHADOWS_SOFT" "LIGHTMAP_OFF" "DIRLIGHTMAP_OFF" "DYNAMICLIGHTMAP_OFF" }
//      undeciphered2: 1 0 5 0 0 0
//      undeciphered3: 15 4 0 0 2 1 1 2 3 4
//      ConstBuffer "$Globals" 320
//      Vector 256 [_MainTex_ST]
//      ConstBuffer "UnityPerCamera" 144
//      Vector 64 [_WorldSpaceCameraPos] 3
//      Vector 80 [_ProjectionParams]
//      ConstBuffer "UnityPerCameraRare" 352
//      Matrix 288 [unity_CameraToWorld]
//      ConstBuffer "UnityLighting" 720
//      Vector 0 [_WorldSpaceLightPos0]
//      ConstBuffer "UnityPerDraw" 352
//      Matrix 0 [glstate_matrix_mvp]
//      Matrix 64 [glstate_matrix_modelview0]
//      BindCB "$Globals" 0
//      BindCB "UnityPerCamera" 1
//      BindCB "UnityPerCameraRare" 2
//      BindCB "UnityLighting" 3
//      BindCB "UnityPerDraw" 4
//
// Headers extracted with DarkStarSword's extract_unity53_shaders.py
// https://github.com/DarkStarSword/3d-fixes

//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.3.12 on Thu Dec 06 16:58:42 2018
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// NORMAL                   0   xyz         1     NONE   float   xyz
// TEXCOORD                 0   xy          2     NONE   float   xy
// TEXCOORD                 1   xy          3     NONE   float
// COLOR                    0   xyzw        4     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xyz         1     NONE   float   xyz
// TEXCOORD                 1   xyzw        2     NONE   float   xyzw
// TEXCOORD                 2   xyzw        3     NONE   float   xyzw
// TEXCOORD                 3   xyzw        4     NONE   float   xyzw
// TEXCOORD                 4   xyzw        5     NONE   float   xyzw
// TEXCOORD                 5   xyz         6     NONE   float   xyz
// TEXCOORD                 6   xyzw        7     NONE   float   xyzw
// TEXCOORD                 9   xyzw        8     NONE   float   xyzw
// TEXCOORD                10   xyzw        9     NONE   float   xyzw
// COLOR                    0   xyzw       10     NONE   float   xyzw
//
vs_4_0
dcl_constantbuffer cb0[17], immediateIndexed
dcl_constantbuffer cb1[9], immediateIndexed
dcl_constantbuffer cb2[22], immediateIndexed
dcl_constantbuffer cb3[1], immediateIndexed
dcl_constantbuffer cb4[22], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyz
dcl_input v2.xy
dcl_input v4.xyzw
dcl_output_siv o0.xyzw, position
dcl_output o1.xyz
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_output o6.xyz
dcl_output o7.xyzw
dcl_output o8.xyzw
dcl_output o9.xyzw
dcl_output o10.xyzw
dcl_temps 6

// 3DMigoto StereoParams:
dcl_resource_texture2d (float,float,float,float) t125
dcl_constantbuffer cb10[4], immediateIndexed

ld_indexable(texture2d)(float,float,float,float) r4.xyzw, l(0, 0, 0, 0), t125.xyzw


// Unity reflection/specular fix inserted with DarkStarSword's asmtool.py:
// asmtool.py -I ../.. --auto-fix-vertex-halo --fix-unusual-halo-with-inconsistent-w-optimisation --fix-unity-reflection --fix-unity-frustum-world --only-autofixed 0a7701014e2afadf-vs.txt

mul r4.w, -r4.x, r4.y
mad r5.xyz, -r4.wwww, cb10[0].xyzw, cb1[4].xyzw

mul r0.xyzw, v0.yyyy, cb4[1].xyzw
mad r0.xyzw, cb4[0].xyzw, v0.xxxx, r0.xyzw
mad r0.xyzw, cb4[2].xyzw, v0.zzzz, r0.xyzw
mad r0.xyzw, cb4[3].xyzw, v0.wwww, r0.xyzw
mov o0.xyzw, r0.xyzw

// Automatic vertex shader halo fix inserted with DarkStarSword's asmtool.py:
// asmtool.py -I ../.. --auto-fix-vertex-halo --fix-unusual-halo-with-inconsistent-w-optimisation --fix-unity-reflection --fix-unity-frustum-world --only-autofixed 0a7701014e2afadf-vs.txt
ne r4.w, r0.w, l(1.0)
if_nz r4.w
  add r4.w, r0.w, -r4.y
  mad r0.x, r4.w, r4.x, r0.x
endif

mul r1.xyzw, v0.xyzw, l(1.000000, 1.000000, -1.000000, 1.000000)
mul r2.xyz, r1.yyyy, cb2[19].xyzx
mad r2.xyz, cb2[18].xyzx, r1.xxxx, r2.xyzx
mad r2.xyz, cb2[20].xyzx, r1.zzzz, r2.xyzx
mad r2.xyz, cb2[21].xyzx, r1.wwww, r2.xyzx
add o1.xyz, r2.xyzx, -r5.xyzx
mul r2.w, r0.y, cb1[5].x
mul r3.w, r2.w, l(0.500000)
mul r3.xz, r0.xxwx, l(0.500000, 0.000000, 0.500000, 0.000000)
add r0.xy, r3.zzzz, r3.xwxx
mov o2.xyw, r0.xyxw
mov o9.xyzw, r0.xyzw
mul r0.x, v0.y, cb4[5].z
mad r0.x, cb4[4].z, v0.x, r0.x
mad r0.x, cb4[6].z, v0.z, r0.x
add r0.x, r0.x, cb4[7].z
mov o2.z, -r0.x
mad r0.xyz, -r2.xyzx, cb3[0].wwww, cb3[0].xyzx
mov o6.xyz, r2.xyzx
mov r0.w, l(0)
mov o3.xyzw, r0.wwwx
mov o4.xyzw, r0.wwwy
mov o5.w, r0.z
mov o5.xyz, v1.xyzx
mul r0.xyzw, r1.yyyy, cb2[19].xyzw
mad r0.xyzw, cb2[18].xyzw, r1.xxxx, r0.xyzw
mad r0.xyzw, cb2[20].xyzw, r1.zzzz, r0.xyzw
mad o7.xyzw, cb2[21].xyzw, r1.wwww, r0.xyzw
mad o8.xy, v2.xyxx, cb0[16].xyxx, cb0[16].zwzz
mov o8.zw, l(0,0,0,0)
mov o10.xyzw, v4.xyzw
ret
// Approximately 0 instruction slots used