// batch fixed
// batch fixed
//
//
// Buffer Definitions: 
//
// cbuffer SceneBuffer
// {
//
//   float4x4 g_View;                   // Offset:    0 Size:    64 [unused]
//   float4x4 g_Proj;                   // Offset:   64 Size:    64 [unused]
//   float4x4 g_ViewProjection;         // Offset:  128 Size:    64 [unused]
//   float4x4 g_ViewInverseMatrix;      // Offset:  192 Size:    64
//
// }
//
// cbuffer HPixel_Buffer
// {
//
//   float4 g_TargetUvParam;            // Offset:    0 Size:    16
//
// }
//
// cbuffer CamParam_HPixel_Buffer
// {
//
//   float4 g_CameraParam;              // Offset:    0 Size:    16
//   float4 g_CameraVec;                // Offset:   16 Size:    16 [unused]
//
// }
//
// cbuffer EffectParameterIndex
// {
//
//   uint g_EffectParameterIndex;       // Offset:    0 Size:     4
//
// }
//
// cbuffer ExposureBuffer
// {
//
//   float4 g_Exposure;                 // Offset:    0 Size:    16
//
// }
//
// cbuffer LightFogParamBuffer
// {
//
//   float4 g_lightColorEff;            // Offset:    0 Size:    16 [unused]
//   float4 g_lightVecEff;              // Offset:   16 Size:    16 [unused]
//   float4 g_FogParamEff;              // Offset:   32 Size:    16
//   float4 g_ScreenTileSizeEff;        // Offset:   48 Size:    16 [unused]
//   float4 g_SpParamEff;               // Offset:   64 Size:    16
//
// }
//
// Resource bind info for g_EffectPixelCommonBuffers
// {
//
//   struct EffectPixelCommonBuffer
//   {
//       
//       float4 m_ToneCurveRate;        // Offset:    0
//       float4 m_DepthRate;            // Offset:   16
//       float4 m_ColorCorrection;      // Offset:   32
//       float4 m_FogColor;             // Offset:   48
//       float4 m_Gamma;                // Offset:   64
//       float4 m_AlphaCurveRate;       // Offset:   80
//       float4 m_DitherRate;           // Offset:   96
//
//   } $Element;                        // Offset:    0 Size:   112
//
// }
//
// Resource bind info for g_EffectPixelProjectionBuffers
// {
//
//   struct EffectPixelProjectionBuffer
//   {
//       
//       float4 m_WorldInverseMatrixCol0;// Offset:    0
//       float4 m_WorldInverseMatrixCol1;// Offset:   16
//       float4 m_ProjectionCenter;     // Offset:   32
//       float4 m_ProjectionDir;        // Offset:   48
//       float4 m_ProjectionUvOffset;   // Offset:   64
//       float4 m_ProjectionUvTile;     // Offset:   80
//
//   } $Element;                        // Offset:    0 Size:    96
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// g_ColorTextureSampler             sampler      NA          NA    0        1
// g_VleTextureSampler               sampler      NA          NA    8        1
// g_FogLUTSampler                   sampler      NA          NA   12        1
// g_ColorTexture                    texture  float4          2d    0        1
// g_VleTexture                      texture  float4          2d    8        1
// g_FogLUT                          texture  float4        cube   12        1
// g_ZTexture                        texture  float4          2d   13        1
// g_BeforeFogLUT                    texture  float4        cube   19        1
// g_EffectPixelCommonBuffers        texture  struct         r/o   27        1
// g_EffectPixelProjectionBuffers    texture  struct         r/o   28        1
// SceneBuffer                       cbuffer      NA          NA    0        1
// EffectParameterIndex              cbuffer      NA          NA    1        1
// ExposureBuffer                    cbuffer      NA          NA    7        1
// LightFogParamBuffer               cbuffer      NA          NA    8        1
// HPixel_Buffer                     cbuffer      NA          NA   12        1
// CamParam_HPixel_Buffer            cbuffer      NA          NA   13        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xy  
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 6   xyz         2     NONE   float   xyz 
//
//
// 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[16], immediateIndexed
dcl_constantbuffer cb12[1], immediateIndexed
dcl_constantbuffer cb13[1], immediateIndexed
dcl_constantbuffer cb1[1], immediateIndexed
dcl_constantbuffer cb7[1], immediateIndexed
dcl_constantbuffer cb8[5], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s8, mode_default
dcl_sampler s12, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t8
dcl_resource_texturecube (float,float,float,float) t12
dcl_resource_texture2d (float,float,float,float) t13
dcl_resource_texturecube (float,float,float,float) t19
dcl_resource_structured t27, 112 
dcl_resource_structured t28, 96 
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xyz
dcl_output o0.xyzw

dcl_resource_texture2d (float,float,float,float) t125
dcl_temps 6

mul r0.xy, v0.xyxx, cb12[0].xyxx
add r0.zw, r0.xxxy, r0.xxxy
resinfo_indexable(texture2d)(float,float,float,float) r1.xy, l(0), t13.xyzw
mul r1.xy, r0.zwzz, r1.xyxx
ftoi r1.xy, r1.xyxx
mov r1.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r1.x, r1.xyzw, t13.xyzw
mad r1.x, r1.x, cb13[0].y, cb13[0].x
mul r0.xy, r0.xyxx, l(4.000000, 4.000000, 0.000000, 0.000000)
mad r0.xy, r0.xyxx, l(1.000000, -1.000000, 0.000000, 0.000000), l(-1.000000, 1.000000, 0.000000, 0.000000)
mul r0.xy, r1.xxxx, r0.xyxx
mul r2.xy, r0.xyxx, cb13[0].zwzz
mov r2.z, -r1.x
mov r2.w, l(1.000000)

ld_indexable(texture2d)(float,float,float,float) r5.xyzw, l(0, 0, 0, 0), t125.xyzw
add r5.y, r2.z, r5.y
mul r5.x, r5.x, r5.y
rcp r5.w, cb0[4].x
mul r5.x, r5.x, r5.w
add r2.x, r2.x, r5.x

dp4 r1.x, r2.xyzw, cb0[12].xyzw
dp4 r1.y, r2.xyzw, cb0[13].xyzw
dp4 r1.z, r2.xyzw, cb0[14].xyzw
dp4 r1.w, r2.xyzw, cb0[15].xyzw
ld_structured_indexable(structured_buffer, stride=96)(mixed,mixed,mixed,mixed) r2.xyzw, cb1[0].x, l(0), t28.xyzw
ld_structured_indexable(structured_buffer, stride=96)(mixed,mixed,mixed,mixed) r3.xyzw, cb1[0].x, l(16), t28.xyzw
dp4 r0.x, r1.xyzw, r2.xyzw
add r0.x, r0.x, l(1.000000)
dp4 r1.w, r1.xyzw, r3.xyzw
add r0.y, r1.w, l(1.000000)
ld_structured_indexable(structured_buffer, stride=96)(mixed,mixed,mixed,mixed) r2.xy, cb1[0].x, l(80), t28.xyxx
ld_structured_indexable(structured_buffer, stride=96)(mixed,mixed,mixed,mixed) r2.zw, cb1[0].x, l(64), t28.xxxy
mad r2.xy, r0.xyxx, r2.xyxx, r2.zwzz
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, r2.xyxx, t0.xyzw, s0
mul r1.w, r2.w, r2.w
ld_structured_indexable(structured_buffer, stride=112)(mixed,mixed,mixed,mixed) r3.x, cb1[0].x, l(64), t27.xxxx
mad r3.y, -r2.w, r2.w, r2.w
mad r1.w, r3.x, r3.y, r1.w
ld_structured_indexable(structured_buffer, stride=96)(mixed,mixed,mixed,mixed) r3.xyz, cb1[0].x, l(32), t28.xyzx
ld_structured_indexable(structured_buffer, stride=96)(mixed,mixed,mixed,mixed) r4.xyzw, cb1[0].x, l(48), t28.xyzw
add r1.xyz, r1.xyzx, -r3.xyzx
dp3 r1.x, r1.xyzx, r4.xyzx
mul_sat r1.x, r4.w, |r1.x|
add r1.yz, -r0.xxyx, l(0.000000, 1.000000, 1.000000, 0.000000)
round_ni_sat r1.yz, r1.yyzy
add r1.xyz, -r1.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
round_ni_sat r0.xy, r0.xyxx
add r0.xy, -r0.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)
mul r1.y, r1.z, r1.y
mul r0.x, r0.x, r1.y
mul r0.x, r0.y, r0.x
mul r0.x, r0.x, r1.x
mul r2.w, r0.x, r1.w
mul r1.xyzw, r2.xyzw, v1.xyzw
ge r0.x, l(0.000100), r1.w
discard_nz r0.x
mad r2.xyz, r1.xyzx, cb7[0].xxxx, -r1.xyzx
mul r2.xyz, r2.xyzx, cb7[0].yyyy
ld_structured_indexable(structured_buffer, stride=112)(mixed,mixed,mixed,mixed) r0.x, cb1[0].x, l(76), t27.xxxx
mad r1.xyz, |r0.xxxx|, r2.xyzx, r1.xyzx
dp3 r0.x, -v2.xyzx, -v2.xyzx
rsq r0.y, r0.x
mul r2.xyz, r0.yyyy, -v2.xyzx
sqrt r0.x, r0.x
add r0.x, r0.x, -cb8[2].x
mul_sat r0.x, r0.x, cb8[2].y
log r0.x, r0.x
mul r0.x, r0.x, cb8[2].z
exp r0.x, r0.x
mov r2.xyz, -r2.xyzx
sample_indexable(texturecube)(float,float,float,float) r3.xyzw, r2.xyzx, t12.xyzw, s12
sample_indexable(texturecube)(float,float,float,float) r2.xyzw, r2.xyzx, t19.xyzw, s12
add r3.xyzw, -r2.xyzw, r3.xyzw
mad r2.xyzw, cb8[4].wwww, r3.xyzw, r2.xyzw
mul r0.y, r0.x, r2.w
mad r2.xyz, r2.xyzx, cb8[2].wwww, -r1.xyzx
mad r1.xyz, r0.yyyy, r2.xyzx, r1.xyzx
sample_indexable(texture2d)(float,float,float,float) r0.yzw, r0.zwzz, t8.wxyz, s8
mad o0.xyz, r0.yzwy, r0.xxxx, r1.xyzx
mov_sat o0.w, r1.w
ret 
// Approximately 75 instruction slots used

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


/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HLSL errors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\SteamLibrary\steamapps\common\NieRAutomata\ShaderCache\b44db9d18e456faf-ps_replace.txt(49,18-43): error X3000: syntax error: unexpected token 'g_EffectPixelCommonBuffers'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
