//HUD PS.
// ---- Created with 3Dmigoto v1.3.6 on Sat Mar 17 09:28:09 2018

cbuffer PS_CONSTANT_BUFFER : register(b0)
{
  float4 vMaterialDiffuse : packoffset(c0);
  float4 vTC0ScaleOffset : packoffset(c1);
  int iBlendMode : packoffset(c2);
  int alpha_test : packoffset(c2.y);
  int alpha_test_func : packoffset(c2.z);
  float alpha_ref : packoffset(c2.w);
}

SamplerState sampler_TexMain_s : register(s0);
Texture2D<float4> TexMain : register(t0);


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


void main(
  float4 v0 : SV_POSITION0,
  float3 v1 : TEXCOORD1,
  float4 v2 : COLOR0,
  float4 v3 : TEXCOORD0,
  float4 v4 : TEXCOORD2,
  float4 v5 : TEXCOORD3,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2,r3,r4;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xy = vTC0ScaleOffset.zw + v3.xy;
  r0.xy = vTC0ScaleOffset.xy * r0.xy;
  r1.xyz = saturate(vMaterialDiffuse.xyz);
  r1.w = 1;
  r1.xyzw = v2.xyzw * r1.xyzw;
  r2.xyz = r1.xyz + r1.xyz;
  r0.z = cmp(iBlendMode < 2);
  r0.w = v2.w + v2.w;
  r2.w = r0.z ? r0.w : r1.w;
  r0.xyzw = TexMain.Sample(sampler_TexMain_s, r0.xy).xyzw;
  r1.xyzw = r2.xyzw * r0.xyzw;
  r3.xy = cmp(iBlendMode == int2(1,2));
  r4.xyz = r2.xyz * r0.xyz + r2.www;
  r4.w = r2.w + r0.w;
  r2.xyz = r4.xyz;
  r2.w = r0.w;
  r2.xyzw = r3.yyyy ? r4.xyzw : r2.xyzw;
  r0.xyzw = r3.xxxx ? r0.xyzw : r2.xyzw;
  r0.xyzw = iBlendMode ? r0.xyzw : r1.xyzw;
  if (alpha_test != 0) {
    r1.x = cmp(alpha_test_func == 1);
    if (r1.x != 0) {
      r1.x = -1;
    } else {
      r1.y = cmp(alpha_test_func == 2);
      if (r1.y != 0) {
        r1.y = cmp(r0.w < alpha_ref);
        r1.x = r1.y ? 1 : -1;
      } else {
        r1.y = cmp(alpha_test_func == 3);
        if (r1.y != 0) {
          r1.y = cmp(r0.w == alpha_ref);
          r1.x = r1.y ? 1 : -1;
        } else {
          r1.y = cmp(alpha_ref >= r0.w);
          r1.z = cmp(alpha_ref < r0.w);
          r1.w = cmp(r0.w != alpha_ref);
          r1.yzw = r1.yzw ? float3(1.40129846e-045,1.40129846e-045,1.40129846e-045) : float3(-1,-1,-1);
          r2.xyzw = cmp(alpha_test_func == int4(4,5,6,7));
          r3.x = cmp(r0.w >= alpha_ref);
          r3.x = r3.x ? 1 : -1;
          r2.w = r2.w ? r3.x : 1;
          r1.w = r2.z ? r1.w : r2.w;
          r1.z = r2.y ? r1.z : r1.w;
          r1.x = r2.x ? r1.y : r1.z;
        }
      }
    }
    r1.x = (int)r1.x;
    r1.x = cmp(r1.x < 0);
    if (r1.x != 0) discard;
  }
  o0.xyzw = r0.xyzw;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.6 on Sat Mar 17 09:28:09 2018
//
//
// Buffer Definitions:
//
// cbuffer PS_CONSTANT_BUFFER
// {
//
//   float4 vMaterialDiffuse;           // Offset:    0 Size:    16
//   float4 vTC0ScaleOffset;            // Offset:   16 Size:    16
//   int iBlendMode;                    // Offset:   32 Size:     4
//   int alpha_test;                    // Offset:   36 Size:     4
//   int alpha_test_func;               // Offset:   40 Size:     4
//   float alpha_ref;                   // Offset:   44 Size:     4
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// sampler_TexMain                   sampler      NA          NA    0        1
// TexMain                           texture  float4          2d    0        1
// PS_CONSTANT_BUFFER                cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float
// TEXCOORD                 1   xyz         1     NONE   float
// COLOR                    0   xyzw        2     NONE   float   xyzw
// TEXCOORD                 0   xy          3     NONE   float   xy
// TEXCOORD                 2   xyz         4     NONE   float
// TEXCOORD                 3   xyzw        5     NONE   float
//
//
// 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 s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v2.xyzw
dcl_input_ps linear v3.xy
dcl_output o0.xyzw
dcl_temps 5
add r0.xy, v3.xyxx, cb0[1].zwzz
mul r0.xy, r0.xyxx, cb0[1].xyxx
mov_sat r1.xyz, cb0[0].xyzx
mov r1.w, l(1.000000)
mul r1.xyzw, r1.xyzw, v2.xyzw
add r2.xyz, r1.xyzx, r1.xyzx
ilt r0.z, cb0[2].x, l(2)
add r0.w, v2.w, v2.w
movc r2.w, r0.z, r0.w, r1.w
sample_indexable(texture2d)(float,float,float,float) r0.xyzw, r0.xyxx, t0.xyzw, s0
mul r1.xyzw, r0.xyzw, r2.xyzw
ieq r3.xy, cb0[2].xxxx, l(1, 2, 0, 0)
mad r4.xyz, r2.xyzx, r0.xyzx, r2.wwww
add r4.w, r0.w, r2.w
mov r2.xyz, r4.xyzx
mov r2.w, r0.w
movc r2.xyzw, r3.yyyy, r4.xyzw, r2.xyzw
movc r0.xyzw, r3.xxxx, r0.xyzw, r2.xyzw
movc r0.xyzw, cb0[2].xxxx, r0.xyzw, r1.xyzw
if_nz cb0[2].y
  ieq r1.x, cb0[2].z, l(1)
  if_nz r1.x
    mov r1.x, l(-1)
  else
    ieq r1.y, cb0[2].z, l(2)
    if_nz r1.y
      lt r1.y, r0.w, cb0[2].w
      movc r1.x, r1.y, l(1), l(-1)
    else
      ieq r1.y, cb0[2].z, l(3)
      if_nz r1.y
        eq r1.y, r0.w, cb0[2].w
        movc r1.x, r1.y, l(1), l(-1)
      else
        ge r1.y, cb0[2].w, r0.w
        lt r1.z, cb0[2].w, r0.w
        ne r1.w, r0.w, cb0[2].w
        movc r1.yzw, r1.yyzw, l(0,1,1,1), l(0,-1,-1,-1)
        ieq r2.xyzw, cb0[2].zzzz, l(4, 5, 6, 7)
        ge r3.x, r0.w, cb0[2].w
        movc r3.x, r3.x, l(1), l(-1)
        movc r2.w, r2.w, r3.x, l(1)
        movc r1.w, r2.z, r1.w, r2.w
        movc r1.z, r2.y, r1.z, r1.w
        movc r1.x, r2.x, r1.y, r1.z
      endif
    endif
  endif
  itof r1.x, r1.x
  lt r1.x, r1.x, l(0.000000)
  discard_nz r1.x
endif
mov o0.xyzw, r0.xyzw
ret
// Approximately 54 instruction slots used

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