// ---- Created with 3Dmigoto v1.3.16 on Fri Jul 10 06:00:01 2020

cbuffer _Globals : register(b0)
{
  float2 ScreenSize : packoffset(c0) = {1920,1080};
  float4x4 WorldView : packoffset(c1);
  float4x4 WorldViewProjection : packoffset(c5);
  float4 MaterialColor : packoffset(c9) = {1,1,1,1};
  float AlphaThreshold : packoffset(c10) = {0.00100000005};
}

SamplerState TextureSamplerSampler_s : register(s0);
Texture2D<float4> TextureSampler : register(t0);
Texture2D<float4> ColorBuffer : register(t1);


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


void main(
  float4 v0 : SV_POSITION0,
  float4 v1 : COLOR0,
  float2 v2 : TEXCOORD0,
  out float4 o0 : SV_TARGET0)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;
  
  float4 iniParams = IniParams.Load(0); 
  if (iniParams.x == 1) {discard;}

  r0.xyzw = TextureSampler.Sample(TextureSamplerSampler_s, v2.xy).xyzw;
  r1.x = v1.w * r0.w + -AlphaThreshold;
  r1.x = cmp(r1.x < 0);
  if (r1.x != 0) discard;
  r0.w = v1.w * r0.w;
  r1.xy = (int2)v0.xy;
  r1.zw = float2(0,0);
  r1.xyzw = ColorBuffer.Load(r1.xyz).xyzw;
  r0.xyz = v1.xyz * r0.xyz + -r1.xyz;
  o0.xyz = r0.www * r0.xyz + r1.xyz;
  o0.w = 1;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v1.3.16 on Fri Jul 10 06:00:01 2020
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
//   float2 ScreenSize;                 // Offset:    0 Size:     8 [unused]
//      = 0x44f00000 0x44870000
//   float4x4 WorldView;                // Offset:   16 Size:    64 [unused]
//   float4x4 WorldViewProjection;      // Offset:   80 Size:    64 [unused]
//   float4 MaterialColor;              // Offset:  144 Size:    16 [unused]
//      = 0x3f800000 0x3f800000 0x3f800000 0x3f800000
//   float AlphaThreshold;              // Offset:  160 Size:     4
//      = 0x3a83126f
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// TextureSamplerSampler             sampler      NA          NA    0        1
// TextureSampler                    texture  float4          2d    0        1
// ColorBuffer                       texture  float4          2d    1        1
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xy
// COLOR                    0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 0   xy          2     NONE   float   xy
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET                0   xyzw        0   TARGET   float   xyzw
//
ps_4_0
dcl_constantbuffer cb0[11], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xy
dcl_output o0.xyzw
dcl_temps 2
sample r0.xyzw, v2.xyxx, t0.xyzw, s0
mad r1.x, v1.w, r0.w, -cb0[10].x
lt r1.x, r1.x, l(0.000000)
discard_nz r1.x
mul r0.w, r0.w, v1.w
ftoi r1.xy, v0.xyxx
mov r1.zw, l(0,0,0,0)
ld r1.xyzw, r1.xyzw, t1.xyzw
mad r0.xyz, v1.xyzx, r0.xyzx, -r1.xyzx
mad o0.xyz, r0.wwww, r0.xyzx, r1.xyzx
mov o0.w, l(1.000000)
ret
// Approximately 12 instruction slots used

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