//Particles PS.
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v1.3.14 on Wed Feb 06 18:44:17 2019
//
//
// Buffer Definitions:
//
// cbuffer SceneInfo
// {
//
//   row_major float4x4 viewProjMat;    // Offset:    0 Size:    64 [unused]
//   row_major float3x4 transposeViewMat;// Offset:   64 Size:    48 [unused]
//   row_major float3x4 transposeViewInvMat;// Offset:  112 Size:    48 [unused]
//   float4 projElement[2];             // Offset:  160 Size:    32 [unused]
//   float4 projInvElements[2];         // Offset:  192 Size:    32 [unused]
//   row_major float4x4 viewProjInvMat; // Offset:  224 Size:    64 [unused]
//   row_major float4x4 prevViewProjMat;// Offset:  288 Size:    64 [unused]
//   float3 ZToLinear;                  // Offset:  352 Size:    12
//   float subdivisionLevel;            // Offset:  364 Size:     4 [unused]
//   float2 screenSize;                 // Offset:  368 Size:     8 [unused]
//   float2 screenInverseSize;          // Offset:  376 Size:     8
//   float2 cullingHelper;              // Offset:  384 Size:     8 [unused]
//   float cameraNearPlane;             // Offset:  392 Size:     4 [unused]
//   float cameraFarPlane;              // Offset:  396 Size:     4 [unused]
//   float4 viewFrustum[6];             // Offset:  400 Size:    96 [unused]
//   float4 clipplane;                  // Offset:  496 Size:    16 [unused]
//
// }
//
// cbuffer Tonemap
// {
//
//   float exposureAdjustment;          // Offset:    0 Size:     4
//   float tonemapRange;                // Offset:    4 Size:     4
//   float sharpness;                   // Offset:    8 Size:     4 [unused]
//   float preTonemapRange;             // Offset:   12 Size:     4 [unused]
//   int useAutoExposure;               // Offset:   16 Size:     4
//   float echoBlend;                   // Offset:   20 Size:     4 [unused]
//   float AABlend;                     // Offset:   24 Size:     4 [unused]
//   float AASubPixel;                  // Offset:   28 Size:     4 [unused]
//   float ResponsiveAARate;            // Offset:   32 Size:     4 [unused]
//
// }
//
// cbuffer GpuParticleVS
// {
//
//   float depthBias;                   // Offset:    0 Size:     4 [unused]
//   float softParticleDist;            // Offset:    4 Size:     4
//   float fadeCone;                    // Offset:    8 Size:     4 [unused]
//   float fadeSpread;                  // Offset:   12 Size:     4 [unused]
//   float3 fadeConeDir;                // Offset:   16 Size:    12 [unused]
//   float fadeAlphaRate;               // Offset:   28 Size:     4 [unused]
//   float4 fadeDepth;                  // Offset:   32 Size:    16 [unused]
//   float3 occlusionSphereOffset;      // Offset:   48 Size:    12 [unused]
//   uint effectFlags;                  // Offset:   60 Size:     4
//   float occlusionSphereRadius;       // Offset:   64 Size:     4 [unused]
//   float occlusionSizeRate;           // Offset:   68 Size:     4 [unused]
//   float dofNear;                     // Offset:   72 Size:     4 [unused]
//   float dofMaxScale;                 // Offset:   76 Size:     4 [unused]
//   float dofMinAlpha;                 // Offset:   80 Size:     4 [unused]
//   uint dofUsingMipLevel;             // Offset:   84 Size:     4 [unused]
//   float dofVanishDistance;           // Offset:   88 Size:     4 [unused]
//   float fadeEnableAngle;             // Offset:   92 Size:     4 [unused]
//   float lumaBleed;                   // Offset:   96 Size:     4
//   float lumaSlide;                   // Offset:  100 Size:     4
//   float lumaScale;                   // Offset:  104 Size:     4
//   float lumaBias;                    // Offset:  108 Size:     4
//   float2 texRect;                    // Offset:  112 Size:     8 [unused]
//   float lumaTexelScale;              // Offset:  120 Size:     4
//   float texEV;                       // Offset:  124 Size:     4
//   float3 emitterPos;                 // Offset:  128 Size:    12 [unused]
//   float alphaRate;                   // Offset:  140 Size:     4
//   float usePhysicalAlphaBlend;       // Offset:  144 Size:     4
//   float fadeEmitterCone;             // Offset:  148 Size:     4 [unused]
//   float fadeEmitterSpread;           // Offset:  152 Size:     4 [unused]
//   float fadeEmitterAlphaRate;        // Offset:  156 Size:     4 [unused]
//   float fadeEmitterEnableAngle;      // Offset:  160 Size:     4 [unused]
//   float fadeEmitterFadeinStart;      // Offset:  164 Size:     4 [unused]
//   float fadeEmitterFadeinEnd;        // Offset:  168 Size:     4 [unused]
//   float detonemapRate;               // Offset:  172 Size:     4
//   uint effectPlayerColor;            // Offset:  176 Size:     4 [unused]
//   float gpuParticleReserve0;         // Offset:  180 Size:     4 [unused]
//   float gpuParticleReserve1;         // Offset:  184 Size:     4 [unused]
//   float gpuParticleReserve2;         // Offset:  188 Size:     4 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// BilinearClamp                     sampler      NA          NA    0        1
// ReadonlyDepth                     texture   float          2d    0        1
// ParticleTex                       texture  float4          2d    1        1
// WhitePtSrv                        texture    byte         r/o    2        1
// primDownSampleTex                 texture  float4          2d    3        1
// SceneInfo                         cbuffer      NA          NA    0        1
// Tonemap                           cbuffer      NA          NA    1        1
// GpuParticleVS                     cbuffer      NA          NA    2        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyz
// Color                    0   xyzw        1     NONE   float   xyzw
// Generic                  0   xyzw        2     NONE   float   xy
// Generic                  1   xyzw        3     NONE   float   xyz
// Generic                  2   xyzw        4     NONE    uint   x
//
//
// 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[24], immediateIndexed
dcl_constantbuffer cb1[2], immediateIndexed
dcl_constantbuffer cb2[11], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_raw t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_input_ps_siv linear noperspective v0.xyz, position
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xy
dcl_input_ps linear v3.xyz
dcl_input_ps constant v4.x
dcl_output o0.xyzw
dcl_temps 8
ftoi r0.xy, v0.xyxx
mov r0.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r0.x, r0.xyzw, t0.xyzw
mad r0.x, -r0.x, cb0[22].y, cb0[22].x
mad r0.y, -v0.z, cb0[22].y, cb0[22].x
div r0.xy, cb0[22].zzzz, r0.xyxx
lt r0.z, l(0.000000), cb2[0].y
if_nz r0.z
  add r0.z, -r0.y, r0.x
  div_sat r0.z, r0.z, cb2[0].y
else
  lt r0.w, cb2[0].y, l(0.000000)
  if_nz r0.w
    add r0.x, -r0.y, r0.x
    div_sat r0.x, |r0.x|, -cb2[0].y
    ge r0.y, r0.x, l(0.500000)
    and r0.w, r0.y, l(0x3f800000)
    add r1.x, r0.x, r0.x
    add r0.x, r0.x, l(-0.500000)
    mad r0.x, -r0.x, l(2.000000), l(1.000000)
    movc r0.y, r0.y, l(0), r1.x
    mad r0.z, r0.x, r0.w, r0.y
  else
    mov r0.z, l(1.000000)
  endif
endif
sample_indexable(texture2d)(float,float,float,float) r1.xyzw, v2.xyxx, t1.xyzw, s0
log r0.x, r1.w
mul r0.x, r0.x, l(4.840000)
exp r0.x, r0.x
mul r0.y, r0.x, v1.w
mul r0.y, r0.z, r0.y
lt r0.z, r0.y, l(0.000010)
if_nz r0.z
  mov o0.xyz, l(0,0,0,0)
  mov o0.w, r0.y
  ret
endif
lt r0.z, cb2[6].x, l(0.000000)
if_nz r0.z
  mov r2.xyz, l(1.000000,1.000000,1.000000,0)
endif
if_z r0.z
  mul r0.zw, v0.xxxy, cb0[23].zzzw
  sample_l_indexable(texture2d)(float,float,float,float) r3.xyz, r0.zwzz, t3.xyzw, s0, l(0.000000)
  mul r4.xy, cb0[23].zwzz, cb2[6].xxxx
  mul r4.zw, r4.yyyx, cb2[6].yyyy
  mad r5.xy, v0.xyxx, cb0[23].zwzz, r4.xzxx
  sample_l_indexable(texture2d)(float,float,float,float) r5.xyz, r5.xyxx, t3.xyzw, s0, l(0.000000)
  mul r5.xyz, r5.xyzx, l(0.150000, 0.150000, 0.150000, 0.000000)
  mad r3.xyz, r3.xyzx, l(0.750000, 0.750000, 0.750000, 0.000000), r5.xyzx
  mul r5.xy, -cb0[23].zwzz, cb2[6].xxxx
  mul r5.zw, r5.yyyx, cb2[6].yyyy
  mad r6.xy, v0.xyxx, cb0[23].zwzz, r5.xzxx
  sample_l_indexable(texture2d)(float,float,float,float) r6.xyz, r6.xyxx, t3.xyzw, s0, l(0.000000)
  mad r3.xyz, r6.xyzx, l(0.150000, 0.150000, 0.150000, 0.000000), r3.xyzx
  mov r6.xw, r5.wwwy
  mov r6.yz, r4.yywy
  mad r6.xyzw, v0.xyxy, cb0[23].zwzw, r6.xyzw
  sample_l_indexable(texture2d)(float,float,float,float) r7.xyz, r6.xyxx, t3.xyzw, s0, l(0.000000)
  mad r3.xyz, r7.xyzx, l(0.100000, 0.100000, 0.100000, 0.000000), r3.xyzx
  sample_l_indexable(texture2d)(float,float,float,float) r6.xyz, r6.zwzz, t3.xyzw, s0, l(0.000000)
  mad r3.xyz, r6.xyzx, l(0.100000, 0.100000, 0.100000, 0.000000), r3.xyzx
  mul r6.yz, r4.xxyx, l(0.000000, 0.500000, 0.500000, 0.000000)
  mad r4.xy, r4.xzxx, l(0.500000, 0.500000, 0.000000, 0.000000), r0.zwzz
  sample_l_indexable(texture2d)(float,float,float,float) r4.xyz, r4.xyxx, t3.xyzw, s0, l(0.000000)
  mad r3.xyz, r4.xyzx, l(0.080000, 0.080000, 0.080000, 0.000000), r3.xyzx
  mul r4.yz, r5.xxyx, l(0.000000, 0.500000, 0.500000, 0.000000)
  mad r0.zw, r5.xxxz, l(0.000000, 0.000000, 0.500000, 0.500000), r0.zzzw
  sample_l_indexable(texture2d)(float,float,float,float) r5.xyz, r0.zwzz, t3.xyzw, s0, l(0.000000)
  mad r3.xyz, r5.xyzx, l(0.080000, 0.080000, 0.080000, 0.000000), r3.xyzx
  mul r6.x, r4.y, cb2[6].y
  mad r0.zw, v0.xxxy, cb0[23].zzzw, r6.xxxz
  sample_l_indexable(texture2d)(float,float,float,float) r5.xyz, r0.zwzz, t3.xyzw, s0, l(0.000000)
  mad r3.xyz, r5.xyzx, l(0.060000, 0.060000, 0.060000, 0.000000), r3.xyzx
  mul r4.x, r6.y, cb2[6].y
  mad r0.zw, v0.xxxy, cb0[23].zzzw, r4.xxxz
  sample_l_indexable(texture2d)(float,float,float,float) r4.xyz, r0.zwzz, t3.xyzw, s0, l(0.000000)
  mad r3.xyz, r4.xyzx, l(0.060000, 0.060000, 0.060000, 0.000000), r3.xyzx
  dp3 r0.z, r3.xyzx, l(0.212600, 0.715200, 0.072200, 0.000000)
  mad r0.z, r0.z, cb2[6].z, cb2[6].w
  dp3 r0.w, r1.xyzx, l(0.212600, 0.715200, 0.072200, 0.000000)
  mul r0.w, r0.w, cb2[7].z
  mul r0.w, r0.w, l(1.442695)
  exp r0.w, r0.w
  mul r0.z, r0.w, r0.z
  mul r2.xyz, r3.xyzx, r0.zzzz
endif
ubfe r0.z, l(4), l(10), cb2[3].w
switch r0.z
  case l(0)
  mul r3.xyz, r1.xyzx, v1.xyzx
  mul r3.xyz, r3.xyzx, v3.xxxx
  mul r4.xyz, r2.xyzx, r3.xyzx
  and r0.z, cb2[3].w, l(0x00004000)
  if_nz r0.z
    add r0.z, -cb1[0].y, l(1.000000)
    max r0.z, r0.z, l(0.000100)
    div r5.xyz, r4.xyzx, r0.zzzz
    ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r0.z, l(0), t2.xxxx
    movc r0.z, cb1[1].x, r0.z, l(1.000000)
    mul r0.z, r0.z, cb1[0].x
    div r5.xyz, r5.xyzx, r0.zzzz
    max r5.xyz, r5.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
    mad r3.xyz, -r3.xyzx, r2.xyzx, r5.xyzx
    mad r4.xyz, cb2[10].wwww, r3.xyzx, r4.xyzx
  endif
  max r0.z, v1.w, l(0.000001)
  log r0.z, r0.z
  mul r0.z, r0.z, cb2[8].w
  exp r0.z, r0.z
  mul r0.z, r0.z, r0.y
  mul o0.xyz, r0.zzzz, r4.xyzx
  mov o0.w, r0.z
  ret
  case l(1)
  dp3 r0.z, l(0.212600, 0.715200, 0.072200, 0.000000), r1.xyzx
  mul r0.z, r0.z, r0.z
  mul r0.z, r0.z, v3.x
  mul r0.z, r0.z, l(10.000000)
  exp r0.w, cb2[7].w
  mul r0.z, r0.w, r0.z
  mul r0.z, r0.z, l(3.750000)
  mad r3.xyz, r1.xyzx, r0.zzzz, r1.xyzx
  mul r3.xyz, r3.xyzx, v1.xyzx
  mul r4.xyz, r2.xyzx, r3.xyzx
  and r0.z, cb2[3].w, l(0x00004000)
  if_nz r0.z
    add r0.z, -cb1[0].y, l(1.000000)
    max r0.z, r0.z, l(0.000100)
    div r5.xyz, r4.xyzx, r0.zzzz
    ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r0.z, l(0), t2.xxxx
    movc r0.z, cb1[1].x, r0.z, l(1.000000)
    mul r0.z, r0.z, cb1[0].x
    div r5.xyz, r5.xyzx, r0.zzzz
    max r5.xyz, r5.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
    mad r2.xyz, -r3.xyzx, r2.xyzx, r5.xyzx
    mad r4.xyz, cb2[10].wwww, r2.xyzx, r4.xyzx
  endif
  max r0.z, v1.w, l(0.000001)
  log r0.z, r0.z
  mul r0.z, r0.z, cb2[8].w
  exp r0.z, r0.z
  mul r0.z, r0.z, r0.y
  mul o0.xyz, r0.zzzz, r4.xyzx
  mul o0.w, r0.z, cb2[9].x
  ret
  case l(2)
  mul o0.w, r0.y, -v3.y
  mul r2.xyz, r1.xyzx, v1.xyzx
  mul r2.xyz, r2.xyzx, v3.xxxx
  and r0.z, cb2[3].w, l(0x00004000)
  if_nz r0.z
    add r0.z, -cb1[0].y, l(1.000000)
    max r0.z, r0.z, l(0.000100)
    div r3.xyz, r2.xyzx, r0.zzzz
    ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r0.z, l(0), t2.xxxx
    movc r0.z, cb1[1].x, r0.z, l(1.000000)
    mul r0.z, r0.z, cb1[0].x
    div r3.xyz, r3.xyzx, r0.zzzz
    max r2.xyz, r3.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
  endif
  max r0.z, v1.w, l(0.000001)
  log r0.z, r0.z
  mul r0.z, r0.z, cb2[8].w
  exp r0.z, r0.z
  mul r0.z, r0.z, r0.y
  mul o0.xyz, r0.zzzz, r2.xyzx
  ret
  case l(3)
  ushr r2.yzw, v4.xxxx, l(0, 8, 16, 24)
  mov r2.x, v4.x
  and r2.xyzw, r2.xyzw, l(255, 255, 255, 255)
  utof r2.xyzw, r2.xyzw
  mul r2.xyzw, r2.xyzw, l(0.00392156886, 0.00392156886, 0.00392156886, 0.00392156886)
  add r0.x, -r0.x, l(1.000000)
  log r0.x, r0.x
  mul r0.x, r0.x, v3.z
  exp r0.x, r0.x
  add r0.z, -r0.x, l(1.000000)
  mul r3.xyz, r0.zzzz, v1.xyzx
  mul r0.xzw, r0.xxxx, r2.xxyz
  mul r0.xzw, r0.xxzw, v3.yyyy
  mul r0.xzw, r2.wwww, r0.xxzw
  mul r0.xzw, r0.xxzw, l(100.000000, 0.000000, 100.000000, 100.000000)
  mad r0.xzw, r3.xxyz, v3.xxxx, r0.xxzw
  and r1.w, cb2[3].w, l(0x00004000)
  if_nz r1.w
    add r1.w, -cb1[0].y, l(1.000000)
    max r1.w, r1.w, l(0.000100)
    div r2.xyz, r0.xzwx, r1.wwww
    ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r1.w, l(0), t2.xxxx
    movc r1.w, cb1[1].x, r1.w, l(1.000000)
    mul r1.w, r1.w, cb1[0].x
    div r2.xyz, r2.xyzx, r1.wwww
    max r0.xzw, r2.xxyz, l(0.000000, 0.000000, 0.000000, 0.000000)
  endif
  max r1.w, v1.w, l(0.000001)
  log r1.w, r1.w
  mul r1.w, r1.w, cb2[8].w
  exp r1.w, r1.w
  mul r1.w, r0.y, r1.w
  mul o0.xyz, r0.xzwx, r1.wwww
  mov o0.w, r1.w
  ret
  case l(4)
  mul r0.x, v1.w, v3.y
  mul r1.xyz, r1.xyzx, v1.xyzx
  mul r1.xyz, r1.xyzx, v3.xxxx
  and r0.z, cb2[3].w, l(0x00004000)
  if_nz r0.z
    add r0.z, -cb1[0].y, l(1.000000)
    max r0.z, r0.z, l(0.000100)
    div r2.xyz, r1.xyzx, r0.zzzz
    ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r0.z, l(0), t2.xxxx
    movc r0.z, cb1[1].x, r0.z, l(1.000000)
    mul r0.z, r0.z, cb1[0].x
    div r2.xyz, r2.xyzx, r0.zzzz
    max r1.xyz, r2.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
  endif
  max r0.z, v1.w, l(0.000001)
  log r0.z, r0.z
  mul r0.z, r0.z, cb2[8].w
  exp r0.z, r0.z
  mul r0.y, r0.z, r0.y
  mul o0.xyz, r0.yyyy, r1.xyzx
  mul r0.x, r0.y, r0.x
  min o0.w, r0.x, l(1.000000)
  ret
  default
  break
endswitch
mov o0.xyzw, l(1.000000,0,0,1.000000)
ret
// Approximately 234 instruction slots used

///////////////////////////////// HLSL Code /////////////////////////////////
// // ---- Created with 3Dmigoto v1.3.14 on Wed Feb 06 18:44:17 2019
//
// cbuffer SceneInfo : register(b0)
// {
//   row_major float4x4 viewProjMat : packoffset(c0);
//   row_major float3x4 transposeViewMat : packoffset(c4);
//   row_major float3x4 transposeViewInvMat : packoffset(c7);
//   float4 projElement[2] : packoffset(c10);
//   float4 projInvElements[2] : packoffset(c12);
//   row_major float4x4 viewProjInvMat : packoffset(c14);
//   row_major float4x4 prevViewProjMat : packoffset(c18);
//   float3 ZToLinear : packoffset(c22);
//   float subdivisionLevel : packoffset(c22.w);
//   float2 screenSize : packoffset(c23);
//   float2 screenInverseSize : packoffset(c23.z);
//   float2 cullingHelper : packoffset(c24);
//   float cameraNearPlane : packoffset(c24.z);
//   float cameraFarPlane : packoffset(c24.w);
//   float4 viewFrustum[6] : packoffset(c25);
//   float4 clipplane : packoffset(c31);
// }
//
// cbuffer Tonemap : register(b1)
// {
//   float exposureAdjustment : packoffset(c0);
//   float tonemapRange : packoffset(c0.y);
//   float sharpness : packoffset(c0.z);
//   float preTonemapRange : packoffset(c0.w);
//   int useAutoExposure : packoffset(c1);
//   float echoBlend : packoffset(c1.y);
//   float AABlend : packoffset(c1.z);
//   float AASubPixel : packoffset(c1.w);
//   float ResponsiveAARate : packoffset(c2);
// }
//
// cbuffer GpuParticleVS : register(b2)
// {
//   float depthBias : packoffset(c0);
//   float softParticleDist : packoffset(c0.y);
//   float fadeCone : packoffset(c0.z);
//   float fadeSpread : packoffset(c0.w);
//   float3 fadeConeDir : packoffset(c1);
//   float fadeAlphaRate : packoffset(c1.w);
//   float4 fadeDepth : packoffset(c2);
//   float3 occlusionSphereOffset : packoffset(c3);
//   uint effectFlags : packoffset(c3.w);
//   float occlusionSphereRadius : packoffset(c4);
//   float occlusionSizeRate : packoffset(c4.y);
//   float dofNear : packoffset(c4.z);
//   float dofMaxScale : packoffset(c4.w);
//   float dofMinAlpha : packoffset(c5);
//   uint dofUsingMipLevel : packoffset(c5.y);
//   float dofVanishDistance : packoffset(c5.z);
//   float fadeEnableAngle : packoffset(c5.w);
//   float lumaBleed : packoffset(c6);
//   float lumaSlide : packoffset(c6.y);
//   float lumaScale : packoffset(c6.z);
//   float lumaBias : packoffset(c6.w);
//   float2 texRect : packoffset(c7);
//   float lumaTexelScale : packoffset(c7.z);
//   float texEV : packoffset(c7.w);
//   float3 emitterPos : packoffset(c8);
//   float alphaRate : packoffset(c8.w);
//   float usePhysicalAlphaBlend : packoffset(c9);
//   float fadeEmitterCone : packoffset(c9.y);
//   float fadeEmitterSpread : packoffset(c9.z);
//   float fadeEmitterAlphaRate : packoffset(c9.w);
//   float fadeEmitterEnableAngle : packoffset(c10);
//   float fadeEmitterFadeinStart : packoffset(c10.y);
//   float fadeEmitterFadeinEnd : packoffset(c10.z);
//   float detonemapRate : packoffset(c10.w);
//   uint effectPlayerColor : packoffset(c11);
//   float gpuParticleReserve0 : packoffset(c11.y);
//   float gpuParticleReserve1 : packoffset(c11.z);
//   float gpuParticleReserve2 : packoffset(c11.w);
// }
//
// SamplerState BilinearClamp_s : register(s0);
// Texture2D<float> ReadonlyDepth : register(t0);
// Texture2D<float4> ParticleTex : register(t1);
// ByteAddressBuffer WhitePtSrv : register(t2);
// Texture2D<float4> primDownSampleTex : register(t3);
//
//
// // 3Dmigoto declarations
// #define cmp -
// Texture1D<float4> IniParams : register(t120);
// Texture2D<float4> StereoParams : register(t125);
//
//
// void main(
//   float4 v0 : SV_Position0,
//   float4 v1 : Color0,
//   float4 v2 : Generic0,
//   float4 v3 : Generic1,
//   nointerpolation uint4 v4 : Generic2,
//   out float4 o0 : SV_Target0)
// {
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_resource_raw t2
//   float4 r0,r1,r2,r3,r4,r5,r6,r7;
//   uint4 bitmask, uiDest;
//   float4 fDest;
//
//   r0.xy = (int2)v0.xy;
//   r0.zw = float2(0,0);
//   r0.x = ReadonlyDepth.Load(r0.xyz).x;
//   r0.x = -r0.x * ZToLinear.y + ZToLinear.x;
//   r0.y = -v0.z * ZToLinear.y + ZToLinear.x;
//   r0.xy = ZToLinear.zz / r0.xy;
//   r0.z = cmp(0 < softParticleDist);
//   if (r0.z != 0) {
//     r0.z = r0.x + -r0.y;
//     r0.z = saturate(r0.z / softParticleDist);
//   } else {
//     r0.w = cmp(softParticleDist < 0);
//     if (r0.w != 0) {
//       r0.x = r0.x + -r0.y;
//       r0.x = saturate(abs(r0.x) / -softParticleDist);
//       r0.y = cmp(r0.x >= 0.5);
//       r0.w = r0.y ? 1.000000 : 0;
//       r1.x = r0.x + r0.x;
//       r0.x = -0.5 + r0.x;
//       r0.x = -r0.x * 2 + 1;
//       r0.y = r0.y ? 0 : r1.x;
//       r0.z = r0.x * r0.w + r0.y;
//     } else {
//       r0.z = 1;
//     }
//   }
//   r1.xyzw = ParticleTex.Sample(BilinearClamp_s, v2.xy).xyzw;
//   r0.x = log2(r1.w);
//   r0.x = 4.84000015 * r0.x;
//   r0.x = exp2(r0.x);
//   r0.y = v1.w * r0.x;
//   r0.y = r0.y * r0.z;
//   r0.z = cmp(r0.y < 9.99999975e-006);
//   if (r0.z != 0) {
//     o0.xyz = float3(0,0,0);
//     o0.w = r0.y;
//     return;
//   }
//   r0.z = cmp(lumaBleed < 0);
//   if (r0.z != 0) {
//     r2.xyz = float3(1,1,1);
//   }
//   if (r0.z == 0) {
//     r0.zw = screenInverseSize.xy * v0.xy;
//     r3.xyz = primDownSampleTex.SampleLevel(BilinearClamp_s, r0.zw, 0).xyz;
//     r4.xy = lumaBleed * screenInverseSize.xy;
//     r4.zw = lumaSlide * r4.yx;
//     r5.xy = v0.xy * screenInverseSize.xy + r4.xz;
//     r5.xyz = primDownSampleTex.SampleLevel(BilinearClamp_s, r5.xy, 0).xyz;
//     r5.xyz = float3(0.150000006,0.150000006,0.150000006) * r5.xyz;
//     r3.xyz = r3.xyz * float3(0.75,0.75,0.75) + r5.xyz;
//     r5.xy = lumaBleed * -screenInverseSize.xy;
//     r5.zw = lumaSlide * r5.yx;
//     r6.xy = v0.xy * screenInverseSize.xy + r5.xz;
//     r6.xyz = primDownSampleTex.SampleLevel(BilinearClamp_s, r6.xy, 0).xyz;
//     r3.xyz = r6.xyz * float3(0.150000006,0.150000006,0.150000006) + r3.xyz;
//     r6.xw = r5.wy;
//     r6.yz = r4.yw;
//     r6.xyzw = v0.xyxy * screenInverseSize.xyxy + r6.xyzw;
//     r7.xyz = primDownSampleTex.SampleLevel(BilinearClamp_s, r6.xy, 0).xyz;
//     r3.xyz = r7.xyz * float3(0.100000001,0.100000001,0.100000001) + r3.xyz;
//     r6.xyz = primDownSampleTex.SampleLevel(BilinearClamp_s, r6.zw, 0).xyz;
//     r3.xyz = r6.xyz * float3(0.100000001,0.100000001,0.100000001) + r3.xyz;
//     r6.yz = float2(0.5,0.5) * r4.xy;
//     r4.xy = r4.xz * float2(0.5,0.5) + r0.zw;
//     r4.xyz = primDownSampleTex.SampleLevel(BilinearClamp_s, r4.xy, 0).xyz;
//     r3.xyz = r4.xyz * float3(0.0799999982,0.0799999982,0.0799999982) + r3.xyz;
//     r4.yz = float2(0.5,0.5) * r5.xy;
//     r0.zw = r5.xz * float2(0.5,0.5) + r0.zw;
//     r5.xyz = primDownSampleTex.SampleLevel(BilinearClamp_s, r0.zw, 0).xyz;
//     r3.xyz = r5.xyz * float3(0.0799999982,0.0799999982,0.0799999982) + r3.xyz;
//     r6.x = lumaSlide * r4.y;
//     r0.zw = v0.xy * screenInverseSize.xy + r6.xz;
//     r5.xyz = primDownSampleTex.SampleLevel(BilinearClamp_s, r0.zw, 0).xyz;
//     r3.xyz = r5.xyz * float3(0.0599999987,0.0599999987,0.0599999987) + r3.xyz;
//     r4.x = lumaSlide * r6.y;
//     r0.zw = v0.xy * screenInverseSize.xy + r4.xz;
//     r4.xyz = primDownSampleTex.SampleLevel(BilinearClamp_s, r0.zw, 0).xyz;
//     r3.xyz = r4.xyz * float3(0.0599999987,0.0599999987,0.0599999987) + r3.xyz;
//     r0.z = dot(r3.xyz, float3(0.212599993,0.715200007,0.0722000003));
//     r0.z = r0.z * lumaScale + lumaBias;
//     r0.w = dot(r1.xyz, float3(0.212599993,0.715200007,0.0722000003));
//     r0.w = lumaTexelScale * r0.w;
//     r0.w = 1.44269502 * r0.w;
//     r0.w = exp2(r0.w);
//     r0.z = r0.z * r0.w;
//     r2.xyz = r0.zzz * r3.xyz;
//   }
//   if (4 == 0) r0.z = 0; else if (4+10 < 32) {   r0.z = (uint)effectFlags << (32-(4 + 10)); r0.z = (uint)r0.z >> (32-4);  } else r0.z = (uint)effectFlags >> 10;
//   switch (r0.z) {
//     case 0 :    r3.xyz = v1.xyz * r1.xyz;
//     r3.xyz = v3.xxx * r3.xyz;
//     r4.xyz = r3.xyz * r2.xyz;
//     r0.z = effectFlags & 0x00004000;
//     if (r0.z != 0) {
//       r0.z = 1 + -tonemapRange;
//       r0.z = max(9.99999975e-005, r0.z);
//       r5.xyz = r4.xyz / r0.zzz;
//     // No code for instruction (needs manual fix):
//         ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r0.z, l(0), t2.xxxx
//       r0.z = useAutoExposure ? r0.z : 1;
//       r0.z = exposureAdjustment * r0.z;
//       r5.xyz = r5.xyz / r0.zzz;
//       r5.xyz = max(float3(0,0,0), r5.xyz);
//       r3.xyz = -r3.xyz * r2.xyz + r5.xyz;
//       r4.xyz = detonemapRate * r3.xyz + r4.xyz;
//     }
//     r0.z = max(9.99999997e-007, v1.w);
//     r0.z = log2(r0.z);
//     r0.z = alphaRate * r0.z;
//     r0.z = exp2(r0.z);
//     r0.z = r0.y * r0.z;
//     o0.xyz = r4.xyz * r0.zzz;
//     o0.w = r0.z;
//     return;
//     case 1 :    r0.z = dot(float3(0.212599993,0.715200007,0.0722000003), r1.xyz);
//     r0.z = r0.z * r0.z;
//     r0.z = v3.x * r0.z;
//     r0.z = 10 * r0.z;
//     r0.w = exp2(texEV);
//     r0.z = r0.z * r0.w;
//     r0.z = 3.75 * r0.z;
//     r3.xyz = r1.xyz * r0.zzz + r1.xyz;
//     r3.xyz = v1.xyz * r3.xyz;
//     r4.xyz = r3.xyz * r2.xyz;
//     r0.z = effectFlags & 0x00004000;
//     if (r0.z != 0) {
//       r0.z = 1 + -tonemapRange;
//       r0.z = max(9.99999975e-005, r0.z);
//       r5.xyz = r4.xyz / r0.zzz;
//     // No code for instruction (needs manual fix):
//         ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r0.z, l(0), t2.xxxx
//       r0.z = useAutoExposure ? r0.z : 1;
//       r0.z = exposureAdjustment * r0.z;
//       r5.xyz = r5.xyz / r0.zzz;
//       r5.xyz = max(float3(0,0,0), r5.xyz);
//       r2.xyz = -r3.xyz * r2.xyz + r5.xyz;
//       r4.xyz = detonemapRate * r2.xyz + r4.xyz;
//     }
//     r0.z = max(9.99999997e-007, v1.w);
//     r0.z = log2(r0.z);
//     r0.z = alphaRate * r0.z;
//     r0.z = exp2(r0.z);
//     r0.z = r0.y * r0.z;
//     o0.xyz = r4.xyz * r0.zzz;
//     o0.w = usePhysicalAlphaBlend * r0.z;
//     return;
//     case 2 :    o0.w = -v3.y * r0.y;
//     r2.xyz = v1.xyz * r1.xyz;
//     r2.xyz = v3.xxx * r2.xyz;
//     r0.z = effectFlags & 0x00004000;
//     if (r0.z != 0) {
//       r0.z = 1 + -tonemapRange;
//       r0.z = max(9.99999975e-005, r0.z);
//       r3.xyz = r2.xyz / r0.zzz;
//     // No code for instruction (needs manual fix):
//         ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r0.z, l(0), t2.xxxx
//       r0.z = useAutoExposure ? r0.z : 1;
//       r0.z = exposureAdjustment * r0.z;
//       r3.xyz = r3.xyz / r0.zzz;
//       r2.xyz = max(float3(0,0,0), r3.xyz);
//     }
//     r0.z = max(9.99999997e-007, v1.w);
//     r0.z = log2(r0.z);
//     r0.z = alphaRate * r0.z;
//     r0.z = exp2(r0.z);
//     r0.z = r0.y * r0.z;
//     o0.xyz = r2.xyz * r0.zzz;
//     return;
//     case 3 :    r2.yzw = (uint3)v4.xxx >> int3(8,16,24);
//     r2.x = v4.x;
//     r2.xyzw = (int4)r2.xyzw & int4(255,255,255,255);
//     r2.xyzw = (uint4)r2.xyzw;
//     r2.xyzw = float4(0.00392156886,0.00392156886,0.00392156886,0.00392156886) * r2.xyzw;
//     r0.x = 1 + -r0.x;
//     r0.x = log2(r0.x);
//     r0.x = v3.z * r0.x;
//     r0.x = exp2(r0.x);
//     r0.z = 1 + -r0.x;
//     r3.xyz = v1.xyz * r0.zzz;
//     r0.xzw = r2.xyz * r0.xxx;
//     r0.xzw = v3.yyy * r0.xzw;
//     r0.xzw = r0.xzw * r2.www;
//     r0.xzw = float3(100,100,100) * r0.xzw;
//     r0.xzw = r3.xyz * v3.xxx + r0.xzw;
//     r1.w = effectFlags & 0x00004000;
//     if (r1.w != 0) {
//       r1.w = 1 + -tonemapRange;
//       r1.w = max(9.99999975e-005, r1.w);
//       r2.xyz = r0.xzw / r1.www;
//     // No code for instruction (needs manual fix):
//         ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r1.w, l(0), t2.xxxx
//       r1.w = useAutoExposure ? r1.w : 1;
//       r1.w = exposureAdjustment * r1.w;
//       r2.xyz = r2.xyz / r1.www;
//       r0.xzw = max(float3(0,0,0), r2.xyz);
//     }
//     r1.w = max(9.99999997e-007, v1.w);
//     r1.w = log2(r1.w);
//     r1.w = alphaRate * r1.w;
//     r1.w = exp2(r1.w);
//     r1.w = r1.w * r0.y;
//     o0.xyz = r1.www * r0.xzw;
//     o0.w = r1.w;
//     return;
//     case 4 :    r0.x = v3.y * v1.w;
//     r1.xyz = v1.xyz * r1.xyz;
//     r1.xyz = v3.xxx * r1.xyz;
//     r0.z = effectFlags & 0x00004000;
//     if (r0.z != 0) {
//       r0.z = 1 + -tonemapRange;
//       r0.z = max(9.99999975e-005, r0.z);
//       r2.xyz = r1.xyz / r0.zzz;
//     // No code for instruction (needs manual fix):
//         ld_raw_indexable(raw_buffer)(mixed,mixed,mixed,mixed) r0.z, l(0), t2.xxxx
//       r0.z = useAutoExposure ? r0.z : 1;
//       r0.z = exposureAdjustment * r0.z;
//       r2.xyz = r2.xyz / r0.zzz;
//       r1.xyz = max(float3(0,0,0), r2.xyz);
//     }
//     r0.z = max(9.99999997e-007, v1.w);
//     r0.z = log2(r0.z);
//     r0.z = alphaRate * r0.z;
//     r0.z = exp2(r0.z);
//     r0.y = r0.y * r0.z;
//     o0.xyz = r1.xyz * r0.yyy;
//     r0.x = r0.x * r0.y;
//     o0.w = min(1, r0.x);
//     return;
//     default :
//     break;
//   }
//   o0.xyzw = float4(1,0,0,1);
//   return;
// }
//////////////////////////////// HLSL Errors ////////////////////////////////
// E:\SteamLibrary\steamapps\common\RESIDENT EVIL 2  BIOHAZARD RE2\ShaderFixes\47b5ac039e8cd0d5-ps_replace.txt(204,26-35): error X3004: undeclared identifier 'raw_buffer'
// E:\SteamLibrary\steamapps\common\RESIDENT EVIL 2  BIOHAZARD RE2\ShaderFixes\47b5ac039e8cd0d5-ps_replace.txt(204,9-36): error X3004: undeclared identifier 'ld_raw_indexable'
/////////////////////////////////////////////////////////////////////////////
