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

cbuffer CBDofParam : register(b0)
{
  float4 g_vDepthComputeParam : packoffset(c0);
  float4 g_vNearFarParam : packoffset(c1);
  float4 g_vScreenSize : packoffset(c2);
  float4 g_vLensParam : packoffset(c3);
  float4 g_vNoBlurDist : packoffset(c4);
  float4 g_vVelomapParam : packoffset(c5);
  float4 g_vDebugMode : packoffset(c6);
}

SamplerState SS_ClampPoint_s : register(s2);
SamplerState SS_ClampLinear_s : register(s3);
Texture2D<float4> g_DepthTex : register(t1);
Texture2D<float4> g_VelocityTex : register(t4);


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


void main( 
  float4 v0 : SV_Position0,
  float2 v1 : TEXCOORD0,
  out float4 o0 : SV_Target0)
{
  float4 r0;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xy = g_VelocityTex.Sample(SS_ClampLinear_s, v1.xy).xy;
  r0.xy = r0.xy * float2(0.400000006,0.400000006) + float2(-0.199215695,-0.199215695);
  r0.xy = g_vVelomapParam.xx * r0.xy;
  r0.x = dot(r0.xy, r0.xy);
  r0.x = sqrt(r0.x);
  r0.x = 100 * r0.x;
  r0.x = min(1, r0.x);
  o0.z = r0.x * r0.x;
  r0.x = g_DepthTex.Sample(SS_ClampPoint_s, v1.xy).x;
  r0.x = g_vDepthComputeParam.x + -r0.x;
  r0.x = -g_vDepthComputeParam.y / r0.x;
  r0.yz = -g_vNearFarParam.yz + r0.xx;
  r0.x = cmp(r0.x >= g_vNoBlurDist.x);
  o0.w = r0.x ? 0 : 1;
  r0.xw = g_vNearFarParam.xw + -g_vNearFarParam.yz;
  o0.xy = saturate(r0.yz / r0.xw);
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
//
// Buffer Definitions: 
//
// cbuffer CBDofParam
// {
//
//   float4 g_vDepthComputeParam;       // Offset:    0 Size:    16
//   float4 g_vNearFarParam;            // Offset:   16 Size:    16
//   float4 g_vScreenSize;              // Offset:   32 Size:    16 [unused]
//   float4 g_vLensParam;               // Offset:   48 Size:    16 [unused]
//   float4 g_vNoBlurDist;              // Offset:   64 Size:    16
//   float4 g_vVelomapParam;            // Offset:   80 Size:    16
//   float4 g_vDebugMode;               // Offset:   96 Size:    16 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// SS_ClampPoint                     sampler      NA          NA    2        1
// SS_ClampLinear                    sampler      NA          NA    3        1
// g_DepthTex                        texture  float4          2d    1        1
// g_VelocityTex                     texture  float4          2d    4        1
// CBDofParam                        cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float       
// TEXCOORD                 0   xy          1     NONE   float   xy  
//
//
// 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 cb0[6], immediateIndexed
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t4
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 1
sample_indexable(texture2d)(float,float,float,float) r0.xy, v1.xyxx, t4.xyzw, s3
mad r0.xy, r0.xyxx, l(0.400000, 0.400000, 0.000000, 0.000000), l(-0.199216, -0.199216, 0.000000, 0.000000)
mul r0.xy, r0.xyxx, cb0[5].xxxx
dp2 r0.x, r0.xyxx, r0.xyxx
sqrt r0.x, r0.x
mul r0.x, r0.x, l(100.000000)
min r0.x, r0.x, l(1.000000)
mul o0.z, r0.x, r0.x
sample_indexable(texture2d)(float,float,float,float) r0.x, v1.xyxx, t1.xyzw, s2
add r0.x, -r0.x, cb0[0].x
div r0.x, -cb0[0].y, r0.x
add r0.yz, r0.xxxx, -cb0[1].yyzy
ge r0.x, r0.x, cb0[4].x
movc o0.w, r0.x, l(0), l(1.000000)
add r0.xw, -cb0[1].yyyz, cb0[1].xxxw
div_sat o0.xy, r0.yzyy, r0.xwxx
ret 
// Approximately 17 instruction slots used

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