//Gamma PS 1.
// ---- Created with 3Dmigoto v1.3.15-re2_workaround on Fri Mar 15 22:02:38 2019

cbuffer OutputColorAdjustment : register(b0)
{
  float fGamma : packoffset(c0);
  float fLowerLimit : packoffset(c0.y);
  float fUpperLimit : packoffset(c0.z);
  float fConvertToLimit : packoffset(c0.w);
  float4 fConfigDrawRect : packoffset(c1);
  float2 fConfigDrawRectSize : packoffset(c2);
  uint uConfigMode : packoffset(c2.z);
  float fConfigImageIntensity : packoffset(c2.w);
  float fConfigImageAlphaScale : packoffset(c3);
}

SamplerState PointBorder_s : register(s0);
Texture2D<float4> tLinearImage : 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.xyz = tLinearImage.SampleLevel(PointBorder_s, v1.xy, 0).xyz;
  r1.xyz = log2(r0.xyz);
  r1.xyz = float3(0.416666657,0.416666657,0.416666657) * r1.xyz;
  r1.xyz = exp2(r1.xyz);
  r1.xyz = r1.xyz * float3(1.05499995,1.05499995,1.05499995) + float3(-0.0549999997,-0.0549999997,-0.0549999997);
  r2.xyz = cmp(float3(0.00313080009,0.00313080009,0.00313080009) >= r0.xyz);
  r0.xyz = float3(12.9200001,12.9200001,12.9200001) * r0.xyz;
  r0.xyz = r2.xyz ? r0.xyz : r1.xyz;
  r0.xyz = log2(r0.xyz);
  r0.xyz = fGamma * r0.xyz;
  r0.xyz = exp2(r0.xyz);
  o0.xyz = r0.xyz * fConvertToLimit + fLowerLimit;
  o0.w = 1;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v1.3.15-re2_workaround on Fri Mar 15 22:02:38 2019
//
//
// Buffer Definitions:
//
// cbuffer OutputColorAdjustment
// {
//
//   float fGamma;                      // Offset:    0 Size:     4
//   float fLowerLimit;                 // Offset:    4 Size:     4
//   float fUpperLimit;                 // Offset:    8 Size:     4 [unused]
//   float fConvertToLimit;             // Offset:   12 Size:     4
//   float4 fConfigDrawRect;            // Offset:   16 Size:    16 [unused]
//   float2 fConfigDrawRectSize;        // Offset:   32 Size:     8 [unused]
//   uint uConfigMode;                  // Offset:   40 Size:     4 [unused]
//   float fConfigImageIntensity;       // Offset:   44 Size:     4 [unused]
//   float fConfigImageAlphaScale;      // Offset:   48 Size:     4 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// PointBorder                       sampler      NA          NA    0        1
// tLinearImage                      texture  float4          2d    0        1
// OutputColorAdjustment             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_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[1], 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_indexable(texture2d)(float,float,float,float) r0.xyz, v1.xyxx, t0.xyzw, s0, l(0.000000)
log r1.xyz, r0.xyzx
mul r1.xyz, r1.xyzx, l(0.416666657, 0.416666657, 0.416666657, 0.000000)
exp r1.xyz, r1.xyzx
mad r1.xyz, r1.xyzx, l(1.055000, 1.055000, 1.055000, 0.000000), l(-0.055000, -0.055000, -0.055000, 0.000000)
ge r2.xyz, l(0.00313080009, 0.00313080009, 0.00313080009, 0.000000), r0.xyzx
mul r0.xyz, r0.xyzx, l(12.920000, 12.920000, 12.920000, 0.000000)
movc r0.xyz, r2.xyzx, r0.xyzx, r1.xyzx
log r0.xyz, r0.xyzx
mul r0.xyz, r0.xyzx, cb0[0].xxxx
exp r0.xyz, r0.xyzx
mad o0.xyz, r0.xyzx, cb0[0].wwww, cb0[0].yyyy
mov o0.w, l(1.000000)
ret
// Approximately 14 instruction slots used

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