// ---- Created with 3Dmigoto v1.2.35 on Tue Apr 26 22:30:28 2016

cbuffer cbToneMap : register(b1)
{
  float3 g_ToneMapInvSceneLumScale : packoffset(c0);
  float3 g_ToneMapScaler : packoffset(c1);
  float4 g_ToneMapParam : packoffset(c2);
  float4 g_ToneMapSceneLumScale : packoffset(c3);
  float4 g_AdaptParam : packoffset(c4);
  float4 g_AdaptCenterWeight : packoffset(c5);
  float4 g_BrightPassThreshold : packoffset(c6);
  float4 g_GlareLuminance : packoffset(c7);
  float4 g_BloomBoostColor : packoffset(c8);
  float4 g_vBloomFinalColor : packoffset(c9);
  float4 g_vBloomScaleParam : packoffset(c10);
}

SamplerState SS_ClampLinear_s : register(s1);
Texture2D<float4> g_SourceTexture : register(t0);


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


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

  r0.xyzw = g_SourceTexture.SampleLevel(SS_ClampLinear_s, v1.xy, 0).xyzw;
  r1.xyz = g_ToneMapSceneLumScale.xyz * r0.xyz;
  r0.xyz = r0.xyz * g_ToneMapSceneLumScale.xyz + float3(1,1,1);
  o0.w = r0.w;
  r0.xyz = r1.xyz / r0.xyz;
  o0.xyz = g_ToneMapScaler.xyz * r0.xyz;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
//
// Buffer Definitions: 
//
// cbuffer cbToneMap
// {
//
//   float3 g_ToneMapInvSceneLumScale;  // Offset:    0 Size:    12 [unused]
//   float3 g_ToneMapScaler;            // Offset:   16 Size:    12
//   float4 g_ToneMapParam;             // Offset:   32 Size:    16 [unused]
//   float4 g_ToneMapSceneLumScale;     // Offset:   48 Size:    16
//   float4 g_AdaptParam;               // Offset:   64 Size:    16 [unused]
//   float4 g_AdaptCenterWeight;        // Offset:   80 Size:    16 [unused]
//   float4 g_BrightPassThreshold;      // Offset:   96 Size:    16 [unused]
//   float4 g_GlareLuminance;           // Offset:  112 Size:    16 [unused]
//   float4 g_BloomBoostColor;          // Offset:  128 Size:    16 [unused]
//   float4 g_vBloomFinalColor;         // Offset:  144 Size:    16 [unused]
//   float4 g_vBloomScaleParam;         // Offset:  160 Size:    16 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// SS_ClampLinear                    sampler      NA          NA    1        1
// g_SourceTexture                   texture  float4          2d    0        1
// cbToneMap                         cbuffer      NA          NA    1        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float       
// TEXCOORD                 0   xyz         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 cb1[4], immediateIndexed
dcl_sampler s1, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 2
sample_l_indexable(texture2d)(float,float,float,float) r0.xyzw, v1.xyxx, t0.xyzw, s1, l(0.000000)
mul r1.xyz, r0.xyzx, cb1[3].xyzx
mad r0.xyz, r0.xyzx, cb1[3].xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mov o0.w, r0.w
div r0.xyz, r1.xyzx, r0.xyzx
mul o0.xyz, r0.xyzx, cb1[1].xyzx
ret 
// Approximately 7 instruction slots used

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