//ui-- blue circle movement
// ---- Created with 3Dmigoto v1.3.16 on Sun Aug 16 01:37:37 2020

cbuffer LensModelDynamics : register(b0)
{
  row_major float4x4 WorldMatrix : packoffset(c0);
  float4 g_fColor : packoffset(c4);
  float4 g_UVScaleOffset : packoffset(c5);
  float2 g_fNumTiles : packoffset(c6);
  float g_fLerpFactor : packoffset(c6.z);
  float g_fMaskPercent : packoffset(c6.w);
}

cbuffer LensModelGlobals : register(b1)
{
  row_major float4x4 ViewProjectionMatrix : packoffset(c0);
  float g_IntermediateExposure : packoffset(c4);
}



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


void main(
  uint2 v0 : POSITION0,
  float2 v1 : TEXCOORD0,
  out float4 o0 : SV_POSITION0,
  out float4 o1 : TEXCOORD0,
  out float4 o2 : TEXCOORD1)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.x = (uint)v0.x >> 16;
  r0.x = f16tof32(r0.x);
  r0.xyz = WorldMatrix._m10_m11_m12 * r0.xxx;
  r1.xy = (int2)v0.xy & int2(0xffff,0xffff);
  r1.xy = f16tof32(r1.xy);
  r0.xyz = r1.xxx * WorldMatrix._m00_m01_m02 + r0.xyz;
  r0.xyz = r1.yyy * WorldMatrix._m20_m21_m22 + r0.xyz;
  r0.xyz = WorldMatrix._m30_m31_m32 + r0.xyz;
  r1.xyzw = ViewProjectionMatrix._m10_m11_m12_m13 * r0.yyyy;
  r1.xyzw = r0.xxxx * ViewProjectionMatrix._m00_m01_m02_m03 + r1.xyzw;
  r0.xyzw = r0.zzzz * ViewProjectionMatrix._m20_m21_m22_m23 + r1.xyzw;
  o0.xyzw = ViewProjectionMatrix._m30_m31_m32_m33 + r0.xyzw;
  o1.xy = v1.xy * g_UVScaleOffset.xy + g_UVScaleOffset.zw;
  o2.xyzw = g_fColor.xyzw;

float4 stereo = StereoParams.Load(0);
o0.x += stereo.x*(o0.w - stereo.y);

  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.0.10011.16384
//
//   using 3Dmigoto v1.3.16 on Sun Aug 16 01:37:37 2020
//
//
// Buffer Definitions:
//
// cbuffer LensModelDynamics
// {
//
//   row_major float4x4 WorldMatrix;    // Offset:    0 Size:    64
//   float4 g_fColor;                   // Offset:   64 Size:    16
//   float4 g_UVScaleOffset;            // Offset:   80 Size:    16
//   float2 g_fNumTiles;                // Offset:   96 Size:     8 [unused]
//   float g_fLerpFactor;               // Offset:  104 Size:     4 [unused]
//   float g_fMaskPercent;              // Offset:  108 Size:     4 [unused]
//
// }
//
// cbuffer LensModelGlobals
// {
//
//   row_major float4x4 ViewProjectionMatrix;// Offset:    0 Size:    64
//   float g_IntermediateExposure;      // Offset:   64 Size:     4 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// LensModelDynamics                 cbuffer      NA          NA    0        1
// LensModelGlobals                  cbuffer      NA          NA    1        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xy          0     NONE    uint   xy
// TEXCOORD                 0   xy          1     NONE   float   xy
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float   xy
// TEXCOORD                 1   xyzw        2     NONE   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[6], immediateIndexed
dcl_constantbuffer cb1[4], immediateIndexed
dcl_input v0.xy
dcl_input v1.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_output o2.xyzw
dcl_temps 2
ushr r0.x, v0.x, l(16)
f16tof32 r0.x, r0.x
mul r0.xyz, r0.xxxx, cb0[1].xyzx
and r1.xy, v0.xyxx, l(0x0000ffff, 0x0000ffff, 0, 0)
f16tof32 r1.xy, r1.xyxx
mad r0.xyz, r1.xxxx, cb0[0].xyzx, r0.xyzx
mad r0.xyz, r1.yyyy, cb0[2].xyzx, r0.xyzx
add r0.xyz, r0.xyzx, cb0[3].xyzx
mul r1.xyzw, r0.yyyy, cb1[1].xyzw
mad r1.xyzw, r0.xxxx, cb1[0].xyzw, r1.xyzw
mad r0.xyzw, r0.zzzz, cb1[2].xyzw, r1.xyzw
add o0.xyzw, r0.xyzw, cb1[3].xyzw
mad o1.xy, v1.xyxx, cb0[5].xyxx, cb0[5].zwzz
mov o2.xyzw, cb0[4].xyzw
ret
// Approximately 15 instruction slots used

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