//Lens flares PS 1. Occlusion.
// ---- Created with geo-11 v0.6.193 on Sun May 19 23:55:16 2024

SamplerState depthMap_s : register(s0);
Texture2D<float4> depthMap : register(t0);


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


void main(
  float4 v0 : SV_Position0,
  float4 v1 : TEXCOORD0,
  out float4 o0 : SV_Target0)
{
  float4 r0;
  uint4 bitmask, uiDest;
  float4 fDest;
  
  float4 stereo = StereoParams.Load(0);
  v1.x+=stereo.x*0.5;
  
  r0.x = depthMap.Sample(depthMap_s, v1.xy).x;
  r0.x = -v1.z + r0.x;
  r0.y = cmp(0 < r0.x);
  r0.x = cmp(r0.x < 0);
  r0.x = (int)-r0.y + (int)r0.x;
  r0.x = (int)r0.x;
  r0.x = saturate(r0.x);
  r0.x = cmp(0 < r0.x);
  r0.x = (int)-r0.x;
  o0.xyzw = saturate(r0.xxxx);
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.0.10011.16384
//
//   using 3Dmigoto v0.6.193 on Sun May 19 23:55:16 2024
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// depthMap                          sampler      NA          NA    0        1
// depthMap                          texture  float4          2d    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float
// TEXCOORD                 0   xyzw        1     NONE   float   xyz
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v1.xyz
dcl_output o0.xyzw
dcl_temps 1
sample_indexable(texture2d)(float,float,float,float) r0.x, v1.xyxx, t0.xyzw, s0
add r0.x, r0.x, -v1.z
lt r0.y, l(0.000000), r0.x
lt r0.x, r0.x, l(0.000000)
iadd r0.x, -r0.y, r0.x
itof r0.x, r0.x
mov_sat r0.x, r0.x
lt r0.x, l(0.000000), r0.x
itof r0.x, -r0.x
mov_sat o0.xyzw, r0.xxxx
ret
// Approximately 11 instruction slots used

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