//HUD 2 PS 2.
// ---- Created with 3Dmigoto v1.3.16 on Fri May 17 17:47:53 2019
Texture2D<float4> t0 : register(t0);

SamplerState s0_s : register(s0);




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


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

// This matches the stereo correction in the vertex shader
float stereo_adjustment = StereoParams.Load(0).x * IniParams[0].x * 1;

// Load the scissor rectangle and stereoise it. Note that since both
// SV_Position and the scissor rectange are in pixels, the adjustment needs to
// be divided by the render target size and again by 2:
float4 scissor_rect = IniParams[6].xyzw;
scissor_rect.xz += floor(stereo_adjustment * IniParams[7].x / 2);

// Perform stereo adjusted scissor clipping:
if (any(v2.xy < scissor_rect.xy) || any(v2.xy >= scissor_rect.zw)) {
	o0.xyzw=float4(0.0,0.0,0.0,0.0);
	discard;
}

  r0.xyzw = t0.Sample(s0_s, v1.xy).xyzw;
  o0.xyzw = v0.xyzw * r0.xyzw;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.3.16 on Fri May 17 17:47:53 2019
//
//
// Note: shader requires additional functionality:
//       Early depth-stencil
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR                    0   xyzw        0     NONE   float   xyzw
// 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 | forceEarlyDepthStencil
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v0.xyzw
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 1
sample_indexable(texture2d)(float,float,float,float) r0.xyzw, v1.xyxx, t0.xyzw, s0
mul o0.xyzw, r0.xyzw, v0.xyzw
ret
// Approximately 0 instruction slots used

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