// asmtool.py -I ../.. --auto-fix-vertex-halo --fix-unusual-halo-with-inconsistent-w-optimisation --fix-unity-reflection --fix-unity-frustum-world --only-autofixed 3de60ed1c5098406-vs.txt
// 3DMigoto: 3de60ed1c5098406 |    Unity headers extracted from Hidden_SoftPointLight
//    Shader "Hidden/SoftPointLight" {
//      SubShader 1/1 {
//        Tags { "QUEUE"="Geometry-1" }
//        Pass 1/1 {
//          Tags { "QUEUE"="Geometry-1" }
//          ZWrite Off
//          Program "vp" {
//            SubProgram "d3d11" {
//            }
//          }
//        }
//      }
//    }
//
// Unity 5.3 headers extracted from Hidden_SoftPointLight:
//   API d3d11
//   Shader model vs_4_0
//   undeciphered1: 201609010 18 0 0
//   undeciphered1a: 3
//   Keywords { "SHADOWS_CUBE" "UNITY_HDR_ON" }
//   undeciphered2: 1 0 4 0 0 0
//   undeciphered3: 3 2 0 0 1 2
//   ConstBuffer "$Globals" 1264
//   Float 32 [_LightAsQuad]
//   ConstBuffer "UnityPerCamera" 144
//   Vector 80 [_ProjectionParams]
//   ConstBuffer "UnityPerDraw" 160
//   Matrix 0 [unity_ObjectToWorld]
//   ConstBuffer "UnityPerFrame" 384
//   Matrix 144 [unity_MatrixV]
//   Matrix 272 [unity_MatrixVP]
//   BindCB "$Globals" 0
//   BindCB "UnityPerCamera" 1
//   BindCB "UnityPerDraw" 2
//   BindCB "UnityPerFrame" 3
//
// Headers extracted with DarkStarSword's extract_unity55_shaders.py
// https://github.com/DarkStarSword/3d-fixes

//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v1.3.16 on Sun Apr 21 17:54:28 2019
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
//   float4 unity_Lightmap_HDR;         // Offset:    0 Size:    16 [unused]
//   float4 unity_DynamicLightmap_HDR;  // Offset:   16 Size:    16 [unused]
//   float _LightAsQuad;                // Offset:   32 Size:     4
//   float4 _LightDir;                  // Offset:   48 Size:    16 [unused]
//   float4 _LightPos;                  // Offset:   64 Size:    16 [unused]
//   float4 _LightColor;                // Offset:   80 Size:    16 [unused]
//   float4 unity_LightmapFade;         // Offset:   96 Size:    16 [unused]
//   float4x4 unity_WorldToLight;       // Offset:  112 Size:    64 [unused]
//   float3 LocalPoissonDisksOffsets[64];// Offset:  176 Size:  1020 [unused]
//   float4 _LightColor0;               // Offset: 1200 Size:    16 [unused]
//   float4 _SpecColor;                 // Offset: 1216 Size:    16 [unused]
//   float _LightSpecStrength;          // Offset: 1232 Size:     4 [unused]
//      = 0x3f800000
//   float3 _AttenuationPlaneNormal;    // Offset: 1236 Size:    12 [unused]
//      = 0x3f800000 0x00000000 0x00000000
//   float4 _AttenuationSettings;       // Offset: 1248 Size:    16 [unused]
//      = 0x3f800000 0x3f800000 0x3f800000 0x3f800000
//
// }
//
// cbuffer UnityPerCamera
// {
//
//   float4 _Time;                      // Offset:    0 Size:    16 [unused]
//   float4 _SinTime;                   // Offset:   16 Size:    16 [unused]
//   float4 _CosTime;                   // Offset:   32 Size:    16 [unused]
//   float4 unity_DeltaTime;            // Offset:   48 Size:    16 [unused]
//   float3 _WorldSpaceCameraPos;       // Offset:   64 Size:    12 [unused]
//   float4 _ProjectionParams;          // Offset:   80 Size:    16
//   float4 _ScreenParams;              // Offset:   96 Size:    16 [unused]
//   float4 _ZBufferParams;             // Offset:  112 Size:    16 [unused]
//   float4 unity_OrthoParams;          // Offset:  128 Size:    16 [unused]
//
// }
//
// cbuffer UnityPerDraw
// {
//
//   float4x4 unity_ObjectToWorld;      // Offset:    0 Size:    64
//   float4x4 unity_WorldToObject;      // Offset:   64 Size:    64 [unused]
//   float4 unity_LODFade;              // Offset:  128 Size:    16 [unused]
//   float4 unity_WorldTransformParams; // Offset:  144 Size:    16 [unused]
//
// }
//
// cbuffer UnityPerFrame
// {
//
//   float4 glstate_lightmodel_ambient; // Offset:    0 Size:    16 [unused]
//   float4 unity_AmbientSky;           // Offset:   16 Size:    16 [unused]
//   float4 unity_AmbientEquator;       // Offset:   32 Size:    16 [unused]
//   float4 unity_AmbientGround;        // Offset:   48 Size:    16 [unused]
//   float4 unity_IndirectSpecColor;    // Offset:   64 Size:    16 [unused]
//   float4x4 glstate_matrix_projection;// Offset:   80 Size:    64 [unused]
//   float4x4 unity_MatrixV;            // Offset:  144 Size:    64
//   float4x4 unity_MatrixInvV;         // Offset:  208 Size:    64 [unused]
//   float4x4 unity_MatrixVP;           // Offset:  272 Size:    64
//   float4 unity_StereoScaleOffset;    // Offset:  336 Size:    16 [unused]
//   int unity_StereoEyeIndex;          // Offset:  352 Size:     4 [unused]
//   float4 unity_ShadowColor;          // Offset:  368 Size:    16 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// $Globals                          cbuffer      NA          NA    0        1
// UnityPerCamera                    cbuffer      NA          NA    1        1
// UnityPerDraw                      cbuffer      NA          NA    2        1
// UnityPerFrame                     cbuffer      NA          NA    3        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyz
// NORMAL                   0   xyz         1     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
// TEXCOORD                 1   xyz         2     NONE   float   xyz
//
vs_4_0
dcl_constantbuffer cb0[3], immediateIndexed
dcl_constantbuffer cb1[6], immediateIndexed
dcl_constantbuffer cb2[4], immediateIndexed
dcl_constantbuffer cb3[21], immediateIndexed
dcl_input v0.xyz
dcl_input v1.xyz
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyz
dcl_temps 4

// 3DMigoto StereoParams:
dcl_resource_texture2d (float,float,float,float) t125

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

mul r0.xyzw, v0.yyyy, cb2[1].xyzw
mad r0.xyzw, cb2[0].xyzw, v0.xxxx, r0.xyzw
mad r0.xyzw, cb2[2].xyzw, v0.zzzz, r0.xyzw
add r0.xyzw, r0.xyzw, cb2[3].xyzw
mul r1.xyzw, r0.yyyy, cb3[18].xyzw
mad r1.xyzw, cb3[17].xyzw, r0.xxxx, r1.xyzw
mad r1.xyzw, cb3[19].xyzw, r0.zzzz, r1.xyzw
mad r1.xyzw, cb3[20].xyzw, r0.wwww, r1.xyzw
mov o0.xyzw, r1.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 3de60ed1c5098406-vs.txt
ne r3.w, r1.w, l(1.0)
if_nz r3.w
  add r3.w, r1.w, -r3.y
  mad r1.x, r3.w, r3.x, r1.x
endif

mul r1.y, r1.y, cb1[5].x
mul r2.xzw, r1.xxwy, l(0.500000, 0.000000, 0.500000, 0.500000)
mov o1.zw, r1.zzzw
add o1.xy, r2.zzzz, r2.xwxx
mul r1.xyz, r0.yyyy, cb3[10].xyzx
mad r1.xyz, cb3[9].xyzx, r0.xxxx, r1.xyzx
mad r0.xyz, cb3[11].xyzx, r0.zzzz, r1.xyzx
mad r0.xyz, cb3[12].xyzx, r0.wwww, r0.xyzx
mul r1.xyz, r0.xyzx, l(-1.000000, -1.000000, 1.000000, 0.000000)
mad r0.xyz, -r0.xyzx, l(-1.000000, -1.000000, 1.000000, 0.000000), v1.xyzx
mad o2.xyz, cb0[2].xxxx, r0.xyzx, r1.xyzx
ret
// Approximately 21 instruction slots used