// ---- 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_ClampLinear_s : register(s3);
Texture2D<float4> g_CoCTex : register(t2);


// 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,r1,r2,r3,r4;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyzw = g_vScreenSize.zwzw * float4(-0.5,-1.5,1.5,-0.5) + v1.xyxy;
  r1.xyz = g_CoCTex.Sample(SS_ClampLinear_s, r0.xy).xyw;
  r0.xyz = g_CoCTex.Sample(SS_ClampLinear_s, r0.zw).xyw;
  r2.xyzw = g_CoCTex.Sample(SS_ClampLinear_s, v1.xy).xyzw;
  r3.y = min(r2.y, r1.y);
  r3.xw = max(r2.xw, r1.xz);
  r1.xyz = r3.xyw + r2.xyw;
  r3.y = min(r2.y, r0.y);
  r3.xw = max(r2.xw, r0.xz);
  r0.xyz = r3.xyw + r1.xyz;
  r1.xyzw = g_vScreenSize.zwzw * float4(0.5,1.5,-1.5,0.5) + v1.xyxy;
  r3.xyz = g_CoCTex.Sample(SS_ClampLinear_s, r1.xy).xyw;
  r1.xyz = g_CoCTex.Sample(SS_ClampLinear_s, r1.zw).xyw;
  r4.y = min(r3.y, r2.y);
  r4.xw = max(r3.xz, r2.xw);
  r0.xyz = r4.xyw + r0.xyz;
  r3.y = min(r1.y, r2.y);
  r3.xw = max(r1.xz, r2.xw);
  o0.z = r2.z;
  r0.xyz = r3.xyw + r0.xyz;
  o0.xyw = float3(0.200000003,0.200000003,0.200000003) * r0.xyz;
  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 [unused]
//   float4 g_vNearFarParam;            // Offset:   16 Size:    16 [unused]
//   float4 g_vScreenSize;              // Offset:   32 Size:    16
//   float4 g_vLensParam;               // Offset:   48 Size:    16 [unused]
//   float4 g_vNoBlurDist;              // Offset:   64 Size:    16 [unused]
//   float4 g_vVelomapParam;            // Offset:   80 Size:    16 [unused]
//   float4 g_vDebugMode;               // Offset:   96 Size:    16 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// SS_ClampLinear                    sampler      NA          NA    3        1
// g_CoCTex                          texture  float4          2d    2        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[3], immediateIndexed
dcl_sampler s3, mode_default
dcl_resource_texture2d (float,float,float,float) t2
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 5
mad r0.xyzw, cb0[2].zwzw, l(-0.500000, -1.500000, 1.500000, -0.500000), v1.xyxy
sample_indexable(texture2d)(float,float,float,float) r1.xyz, r0.xyxx, t2.xywz, s3
sample_indexable(texture2d)(float,float,float,float) r0.xyz, r0.zwzz, t2.xywz, s3
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, v1.xyxx, t2.xyzw, s3
min r3.y, r1.y, r2.y
max r3.xw, r1.xxxz, r2.xxxw
add r1.xyz, r2.xywx, r3.xywx
min r3.y, r0.y, r2.y
max r3.xw, r0.xxxz, r2.xxxw
add r0.xyz, r1.xyzx, r3.xywx
mad r1.xyzw, cb0[2].zwzw, l(0.500000, 1.500000, -1.500000, 0.500000), v1.xyxy
sample_indexable(texture2d)(float,float,float,float) r3.xyz, r1.xyxx, t2.xywz, s3
sample_indexable(texture2d)(float,float,float,float) r1.xyz, r1.zwzz, t2.xywz, s3
min r4.y, r2.y, r3.y
max r4.xw, r2.xxxw, r3.xxxz
add r0.xyz, r0.xyzx, r4.xywx
min r3.y, r2.y, r1.y
max r3.xw, r2.xxxw, r1.xxxz
mov o0.z, r2.z
add r0.xyz, r0.xyzx, r3.xywx
mul o0.xyw, r0.xyxz, l(0.200000, 0.200000, 0.000000, 0.200000)
ret 
// Approximately 22 instruction slots used

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