//vela
// ---- Created with 3Dmigoto v0.6.164 on Mon Jul 29 06:33:23 2024
Texture2D<float4> t0 : register(t0);

SamplerState s0_s : register(s0);

cbuffer cb1 : register(b1)
{
  float4 cb1[7];
}

cbuffer cb0 : register(b0)
{
  float4 cb0[12];
}




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


void main(
  float4 v0 : SV_POSITION0,
  float4 v1 : TEXCOORD1,
  float4 v2 : TEXCOORD2,
  float4 v3 : TEXCOORD3,
  out float4 o0 : SV_Target0)
{
  const float4 icb[] = { { 0.0588235296, 0, 0, 0},
                              { 0.529411793, 0, 0, 0},
                              { 0.176470593, 0, 0, 0},
                              { 0.647058845, 0, 0, 0},
                              { 0.764705896, 0, 0, 0},
                              { 0.294117659, 0, 0, 0},
                              { 0.882352948, 0, 0, 0},
                              { 0.411764711, 0, 0, 0},
                              { 0.235294119, 0, 0, 0},
                              { 0.705882370, 0, 0, 0},
                              { 0.117647059, 0, 0, 0},
                              { 0.588235319, 0, 0, 0},
                              { 0.941176474, 0, 0, 0},
                              { 0.470588237, 0, 0, 0},
                              { 0.823529422, 0, 0, 0},
                              { 0.352941185, 0, 0, 0} };
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;
  
float4 s = StereoParams.Load(0);
float4 texFilter = IniParams.Load(int2(14,0));
float4 testeo = IniParams.Load(int2(90,0));
float cursor_showing  = IniParams[1].z;

//v3.x += s.x * (v3.w - s.y) * 0.5;

  r0.xy = v3.xy / v3.ww;
  r0.xy = cb1[6].xy * r0.xy;
  r0.xy = (uint2)r0.xy;
  r0.x = (uint)r0.x << 2;
  r0.xy = (int2)r0.xy & int2(12,3);
  r0.x = (int)r0.y + (int)r0.x;
  r1.xyzw = t0.Sample(s0_s, v1.xy).xyzw;
  r0.x = r1.w * cb0[8].w + -icb[r0.x+0].x;
  r0.x = -cb0[11].x + r0.x;
  r0.x = cmp(r0.x < 0);
  if (r0.x != 0) discard;
  o0.xyzw = float4(0,0,0,0);
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v0.6.164 on Mon Jul 29 06:33:23 2024
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float
// TEXCOORD                 1   xy          1     NONE   float   xy
// TEXCOORD                 2   xyz         2     NONE   float
// TEXCOORD                 3   xyzw        3     NONE   float   xy w
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_4_0
dcl_immediateConstantBuffer { { 0.0588235296, 0, 0, 0},
                              { 0.529411793, 0, 0, 0},
                              { 0.176470593, 0, 0, 0},
                              { 0.647058845, 0, 0, 0},
                              { 0.764705896, 0, 0, 0},
                              { 0.294117659, 0, 0, 0},
                              { 0.882352948, 0, 0, 0},
                              { 0.411764711, 0, 0, 0},
                              { 0.235294119, 0, 0, 0},
                              { 0.705882370, 0, 0, 0},
                              { 0.117647059, 0, 0, 0},
                              { 0.588235319, 0, 0, 0},
                              { 0.941176474, 0, 0, 0},
                              { 0.470588237, 0, 0, 0},
                              { 0.823529422, 0, 0, 0},
                              { 0.352941185, 0, 0, 0} }
dcl_constantbuffer CB0[12], immediateIndexed
dcl_constantbuffer CB1[7], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v1.xy
dcl_input_ps linear v3.xyw
dcl_output o0.xyzw
dcl_temps 2
div r0.xy, v3.xyxx, v3.wwww
mul r0.xy, r0.xyxx, cb1[6].xyxx
ftou r0.xy, r0.xyxx
ishl r0.x, r0.x, l(2)
and r0.xy, r0.xyxx, l(12, 3, 0, 0)
iadd r0.x, r0.y, r0.x
sample r1.xyzw, v1.xyxx, t0.xyzw, s0
mad r0.x, r1.w, cb0[8].w, -icb[r0.x + 0].x
add r0.x, r0.x, -cb0[11].x
lt r0.x, r0.x, l(0.000000)
discard_nz r0.x
mov o0.xyzw, l(0,0,0,0)
ret
// Approximately 0 instruction slots used

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