// bloom ---- Created with 3Dmigoto v1.3.16 on Wed Mar 02 12:30:44 2022

cbuffer _Globals : register(b0)
{
  float4 lightCount : packoffset(c0);
  float4 ambient : packoffset(c1);
  float4 lightInfo[4] : packoffset(c2);
  float4 g_vScreenDepthRect : packoffset(c6);
  float4 g_vDitherSettings : packoffset(c7);
  float4 g_ColorK : packoffset(c8) = {0.270000011,0.670000017,0.0599999987,0};
  float4 LevelMin : packoffset(c9) = {0.100000001,0.100000001,0.100000001,0};
  float4 LevelMax : packoffset(c10) = {0.800000012,0.800000012,0.800000012,0};
  float4 MaxAdd : packoffset(c11) = {0.100000001,0.100000001,0.100000001,0};
  float4 MinSub : packoffset(c12) = {0.0199999996,0.0199999996,0.0199999996,0};
  float4 Color : packoffset(c13);
  float4 Settings : packoffset(c14);
  float4 Settings2 : packoffset(c15);
  float4 Settings3 : packoffset(c16);
  float4 Settings4 : packoffset(c17);
  float4 Transform : packoffset(c18);
  float4 g_vDepthCoordsClamp : packoffset(c19);
  float4 CamPos : packoffset(c20);
  float4 g_vCenterOffs : packoffset(c21);
  float4 g_vHFrustrum : packoffset(c22);
  float4 g_vVFrustrum : packoffset(c23);
  float4 g_avNoise[8] : packoffset(c24);
  float4x4 g_mView : packoffset(c32);
  float4 g_PixelsDir[8] : packoffset(c36);
  float4 g_vHistogramBoundLow : packoffset(c44) = {0,0.0160000008,0.0260000005,0.129999995};
  float4 g_vHistogramBoundHigh : packoffset(c45) = {0.0160000008,0.0260000005,0.129999995,0.409999996};
}

SamplerState DiffuseSamplerLerp_s : register(s0);
Texture2D<float4> DiffTexture : register(t0);


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


void main(
  float4 v0 : SV_Position0,
  float2 v1 : TEXCOORD0,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2;
  uint4 bitmask, uiDest;
  float4 fDest;

//  r0.xyzw = DiffTexture.SampleLevel(DiffuseSamplerLerp_s, v1.xy, 0).xyzw;
  o0.xyzw = 0.0; ///////new
//  r1.x = max(r0.y, r0.z);
//  r1.x = max(r1.x, r0.x);
//  r1.y = -Settings.x + r1.x;
//  r1.y = Settings.y * r1.y;
//  r2.xyzw = saturate(r1.yyyy);
//  r1.y = cmp(0 < r1.x);
//  if (r1.y != 0) {
//    r0.xyzw = r2.wwww * r0.xyzw;
//    r2.xyzw = r0.xyzw / r1.xxxx;
//  }
//  o0.w = dot(g_ColorK.xyzw, r2.xyzw);
//  o0.xyz = r2.xyz;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.3.16 on Wed Mar 02 12:30:44 2022
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
//   float4 lightCount;                 // Offset:    0 Size:    16 [unused]
//   float4 ambient;                    // Offset:   16 Size:    16 [unused]
//   float4 lightInfo[4];               // Offset:   32 Size:    64 [unused]
//   float4 g_vScreenDepthRect;         // Offset:   96 Size:    16 [unused]
//   float4 g_vDitherSettings;          // Offset:  112 Size:    16 [unused]
//   float4 g_ColorK;                   // Offset:  128 Size:    16
//      = 0x3e8a3d71 0x3f2b851f 0x3d75c28f 0x00000000
//   float4 LevelMin;                   // Offset:  144 Size:    16 [unused]
//      = 0x3dcccccd 0x3dcccccd 0x3dcccccd 0x00000000
//   float4 LevelMax;                   // Offset:  160 Size:    16 [unused]
//      = 0x3f4ccccd 0x3f4ccccd 0x3f4ccccd 0x00000000
//   float4 MaxAdd;                     // Offset:  176 Size:    16 [unused]
//      = 0x3dcccccd 0x3dcccccd 0x3dcccccd 0x00000000
//   float4 MinSub;                     // Offset:  192 Size:    16 [unused]
//      = 0x3ca3d70a 0x3ca3d70a 0x3ca3d70a 0x00000000
//   float4 Color;                      // Offset:  208 Size:    16 [unused]
//   float4 Settings;                   // Offset:  224 Size:    16
//   float4 Settings2;                  // Offset:  240 Size:    16 [unused]
//   float4 Settings3;                  // Offset:  256 Size:    16 [unused]
//   float4 Settings4;                  // Offset:  272 Size:    16 [unused]
//   float4 Transform;                  // Offset:  288 Size:    16 [unused]
//   float4 g_vDepthCoordsClamp;        // Offset:  304 Size:    16 [unused]
//   float4 CamPos;                     // Offset:  320 Size:    16 [unused]
//   float4 g_vCenterOffs;              // Offset:  336 Size:    16 [unused]
//   float4 g_vHFrustrum;               // Offset:  352 Size:    16 [unused]
//   float4 g_vVFrustrum;               // Offset:  368 Size:    16 [unused]
//   float4 g_avNoise[8];               // Offset:  384 Size:   128 [unused]
//   float4x4 g_mView;                  // Offset:  512 Size:    64 [unused]
//   float4 g_PixelsDir[8];             // Offset:  576 Size:   128 [unused]
//   float4 g_vHistogramBoundLow;       // Offset:  704 Size:    16 [unused]
//      = 0x00000000 0x3c83126f 0x3cd4fdf4 0x3e051eb8
//   float4 g_vHistogramBoundHigh;      // Offset:  720 Size:    16 [unused]
//      = 0x3c83126f 0x3cd4fdf4 0x3e051eb8 0x3ed1eb85
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// DiffuseSamplerLerp                sampler      NA          NA    0        1
// DiffTexture                       texture  float4          2d    0        1
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float
// 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_4_0
dcl_constantbuffer cb0[15], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 3
sample_l r0.xyzw, v1.xyxx, t0.xyzw, s0, l(0.000000)
max r1.x, r0.z, r0.y
max r1.x, r0.x, r1.x
add r1.y, r1.x, -cb0[14].x
mul r1.y, r1.y, cb0[14].y
mov_sat r2.xyzw, r1.yyyy
lt r1.y, l(0.000000), r1.x
if_nz r1.y
  mul r0.xyzw, r0.xyzw, r2.wwww
  div r2.xyzw, r0.xyzw, r1.xxxx
endif
dp4 o0.w, cb0[8].xyzw, r2.xyzw
mov o0.xyz, r2.xyzx
ret
// Approximately 14 instruction slots used

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