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

cbuffer cbSampleOffset : register(b1)
{
  float4 g_avSampleOffsets[16] : packoffset(c0);
}

cbuffer cbGlowParam : register(b2)
{
  float4 g_GlowScaleOffset : packoffset(c0);
}

cbuffer cbFilterParam : register(b0)
{
  float4 g_vRandomRatationTexScale : packoffset(c0);
  float4 g_vScreenSpaceTexCoordScale : packoffset(c1);
}

SamplerState SS_ClampLinear_s : register(s3);
Texture2D<float4> g_SourceTex : 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;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyzw = float4(0,0,0,0);
  while (true) {
    r1.x = cmp((int)r0.w >= 13);
    if (r1.x != 0) break;
    r1.xy = g_avSampleOffsets[r0.w].xy * g_vScreenSpaceTexCoordScale.xy + v1.xy;
    r1.xyz = g_SourceTex.SampleLevel(SS_ClampLinear_s, r1.xy, 0).xyz;
    r0.xyz = g_avSampleOffsets[r0.w].zzz * r1.xyz + r0.xyz;
    r0.w = (int)r0.w + 1;
  }
  o0.xyz = g_GlowScaleOffset.xxx * r0.xyz;
  o0.w = 1;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
//
// Buffer Definitions: 
//
// cbuffer cbSampleOffset
// {
//
//   float4 g_avSampleOffsets[16];      // Offset:    0 Size:   256
//
// }
//
// cbuffer cbGlowParam
// {
//
//   float4 g_GlowScaleOffset;          // Offset:    0 Size:    16
//
// }
//
// cbuffer cbFilterParam
// {
//
//   float4 g_vRandomRatationTexScale;  // Offset:    0 Size:    16 [unused]
//   float4 g_vScreenSpaceTexCoordScale;// Offset:   16 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// SS_ClampLinear                    sampler      NA          NA    3        1
// g_SourceTex                       texture  float4          2d    0        1
// cbFilterParam                     cbuffer      NA          NA    0        1
// cbSampleOffset                    cbuffer      NA          NA    1        1
// cbGlowParam                       cbuffer      NA          NA    2        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 cb1[14], dynamicIndexed
dcl_constantbuffer cb2[1], immediateIndexed
dcl_constantbuffer cb0[2], immediateIndexed
dcl_sampler s3, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 2
mov r0.xyzw, l(0,0,0,0)
loop 
  ige r1.x, r0.w, l(13)
  breakc_nz r1.x
  mad r1.xy, cb1[r0.w + 0].xyxx, cb0[1].xyxx, v1.xyxx
  sample_l_indexable(texture2d)(float,float,float,float) r1.xyz, r1.xyxx, t0.xyzw, s3, l(0.000000)
  mad r0.xyz, cb1[r0.w + 0].zzzz, r1.xyzx, r0.xyzx
  iadd r0.w, r0.w, l(1)
endloop 
mul o0.xyz, r0.xyzx, cb2[0].xxxx
mov o0.w, l(1.000000)
ret 
// Approximately 12 instruction slots used

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