// ---- Created with 3Dmigoto v1.2.35 on Tue Apr 26 22:31:29 2016

cbuffer cbSceneParam : register(b8)
{
  float4 FC_FarClipInfo : packoffset(c0);
  float4 FC_ScreenSize : packoffset(c1);
  float4x3 FC_MatrixView : packoffset(c2);
  float4x4 FC_MatrixInvViewProj : packoffset(c5);
  float4x4 FC_MatrixInvProj : packoffset(c9);
  float4x4 FC_MatrixProj : packoffset(c13);
  float4 FC_DepthComputeParam : packoffset(c17);
  float4 FC_ShadowMapParam : packoffset(c18);
  float4 FC_ShadowColor : packoffset(c19);
  float4 FC_ShadowDir : packoffset(c20);
  float4x4 VC_ShadowMapMatrix : packoffset(c21);
  float FC_ShadowDepthRate : packoffset(c25);
  float FC_ShadowDepthScale : packoffset(c25.y);
  float FC_ShadowKernelScale : packoffset(c25.z);
  float FC_ShadowRandTexInvScale : packoffset(c25.w);
  float FC_ShadowTexInvScaleX : packoffset(c26);
  float FC_ShadowTexInvScaleY : packoffset(c26.y);
  float FC_ShadowDepthOffsetScale : packoffset(c26.z);
  float4 FC_ShadowViewKernelScale : packoffset(c27);
  float4x4 FC_ProjSpaceToShadowMatrix[4] : packoffset(c28);
  float4 FC_CascadeSelectDist : packoffset(c44);
  float4x4 FC_MatrixInvView : packoffset(c45);
  float4 VC_ClipPlane : packoffset(c49);
  float4x4 VC_MatrixViewProj : packoffset(c50);
}



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


void main( 
  float4 v0 : SV_Position0,
  float4 v1 : COLOR0,
  float3 v2 : NORMAL0,
  float3 v3 : TANGENT0,
  float3 v4 : BINORMAL0,
  float4 v5 : POSITION1,
  float4 v6 : POSITION2,
  float4 v7 : TEXCOORD29,
  float4 v8 : TEXCOORD0,
  float3 v9 : TEXCOORD17,
  uint v10 : SV_IsFrontFace0,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.x = FC_FarClipInfo.y * v0.w;
  r1.x = ddx_coarse(r0.x);
  r1.y = ddy_coarse(r0.x);
  r0.y = dot(r1.xy, r1.xy);
  r0.y = 0.25 * r0.y;
  o0.y = r0.x * r0.x + r0.y;
  o0.x = r0.x;
  o0.zw = float2(0,1);
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//
// Buffer Definitions: 
//
// cbuffer cbSceneParam
// {
//
//   float4 FC_FarClipInfo;             // Offset:    0 Size:    16
//   float4 FC_ScreenSize;              // Offset:   16 Size:    16 [unused]
//   float4x3 FC_MatrixView;            // Offset:   32 Size:    48 [unused]
//   float4x4 FC_MatrixInvViewProj;     // Offset:   80 Size:    64 [unused]
//   float4x4 FC_MatrixInvProj;         // Offset:  144 Size:    64 [unused]
//   float4x4 FC_MatrixProj;            // Offset:  208 Size:    64 [unused]
//   float4 FC_DepthComputeParam;       // Offset:  272 Size:    16 [unused]
//   float4 FC_ShadowMapParam;          // Offset:  288 Size:    16 [unused]
//   float4 FC_ShadowColor;             // Offset:  304 Size:    16 [unused]
//   float4 FC_ShadowDir;               // Offset:  320 Size:    16 [unused]
//   float4x4 VC_ShadowMapMatrix;       // Offset:  336 Size:    64 [unused]
//   float FC_ShadowDepthRate;          // Offset:  400 Size:     4 [unused]
//   float FC_ShadowDepthScale;         // Offset:  404 Size:     4 [unused]
//   float FC_ShadowKernelScale;        // Offset:  408 Size:     4 [unused]
//   float FC_ShadowRandTexInvScale;    // Offset:  412 Size:     4 [unused]
//   float FC_ShadowTexInvScaleX;       // Offset:  416 Size:     4 [unused]
//   float FC_ShadowTexInvScaleY;       // Offset:  420 Size:     4 [unused]
//   float FC_ShadowDepthOffsetScale;   // Offset:  424 Size:     4 [unused]
//   float4 FC_ShadowViewKernelScale;   // Offset:  432 Size:    16 [unused]
//   float4x4 FC_ProjSpaceToShadowMatrix[4];// Offset:  448 Size:   256 [unused]
//   float4 FC_CascadeSelectDist;       // Offset:  704 Size:    16 [unused]
//   float4x4 FC_MatrixInvView;         // Offset:  720 Size:    64 [unused]
//   float4 VC_ClipPlane;               // Offset:  784 Size:    16 [unused]
//   float4x4 VC_MatrixViewProj;        // Offset:  800 Size:    64 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// cbSceneParam                      cbuffer      NA          NA    8        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float      w
// COLOR                    0   xyzw        1     NONE   float       
// NORMAL                   0   xyz         2     NONE   float       
// TANGENT                  0   xyz         3     NONE   float       
// BINORMAL                 0   xyz         4     NONE   float       
// POSITION                 1   xyzw        5     NONE   float       
// POSITION                 2   xyzw        6     NONE   float       
// TEXCOORD                29   xyz         7     NONE   float       
// TEXCOORD                 0   xy          8     NONE   float       
// TEXCOORD                17   xyz         9     NONE   float       
// SV_IsFrontFace           0   x          10    FFACE    uint       
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb8[1], immediateIndexed
dcl_input_ps_siv linear noperspective v0.w, position
dcl_output o0.xyzw
dcl_temps 2
mul r0.x, v0.w, cb8[0].y
deriv_rtx_coarse r1.x, r0.x
deriv_rty_coarse r1.y, r0.x
dp2 r0.y, r1.xyxx, r1.xyxx
mul r0.y, r0.y, l(0.250000)
mad o0.y, r0.x, r0.x, r0.y
mov o0.x, r0.x
mov o0.zw, l(0,0,0,1.000000)
ret 
// Approximately 9 instruction slots used

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