//
// Generated by Microsoft (R) HLSL Shader Compiler 10.0.10011.16384
//
//   using 3Dmigoto v1.3.16 on Fri Jan 14 20:06:33 2022
//
//
// Note: shader requires additional functionality:
//       64 UAV slots
//
//
// Buffer Definitions:
//
// cbuffer ConstBuf__passData
// {
//
//   struct PostEffectsHalfResPassData
//   {
//
//       struct FullResResolveConstants
//       {
//
//           float MotionBlurEnabled;   // Index:    0
//           float DebugBlur;           // Index:    0.y
//           float DebugBlurEffect;     // Index:    0.z
//           float NoOpaquePass;        // Index:    0.w
//           uint DebugTakingCalibrationScreenshot;// Index:    1
//           float DebugMotionVectors;  // Index:    1.y
//           float BloomEnabled;        // Index:    1.z
//           float2 screenSize;         // Index:    2
//           float2 screenSizeRcp;      // Index:    2.z
//           float2 screenHalfSize;     // Index:    3
//           float2 screenHalfSizeRcp;  // Index:    3.z
//           float2 screenSizeResolved; // Index:    4
//           float2 screenSizeResolvedRcp;// Index:    4.z
//           float2 screenResolvedToUnresolved;// Index:    5
//           float2 screenUnresolvedToResolved;// Index:    5.z
//           float2 motionVectorTemporalRescaleCompress;// Index:    6
//           float2 motionVectorTemporalRescaleDecompress;// Index:    6.z
//           float2 dlssScreenSize;     // Index:    7
//           float2 screenScale;        // Index:    7.z
//           float2 screenOffset;       // Index:    8
//           float4 scaleOffsetR;       // Index:    9
//           float4 scaleOffsetG;       // Index:   10
//           float4 scaleOffsetB;       // Index:   11
//           float3 Vignette_Color;     // Index:   12
//           float Vignette_Brightness; // Index:   12.w
//           float Vignette_Falloff;    // Index:   13
//           float Vignette_Scale;      // Index:   13.y
//           float lensVignetteExposureSq;// Index:   13.z
//           float scale;               // Index:   13.w
//           float rcpScreenLensRadius2;// Index:   14
//           float2 screenLensCenter;   // Index:   14.y
//           int filmGrainOffset;       // Index:   14.w
//           float4 filmGrainUVTransform;// Index:   15
//           float filmGrainEffectShadows;// Index:   16
//           float filmGrainEffectMids; // Index:   16.y
//           float filmGrainEffectBrights;// Index:   16.z
//           float doUnsharp;           // Index:   16.w
//           float unsharpStrength;     // Index:   17
//           bool DebugNoLUT;           // Index:   17.y
//           bool passThrough;          // Index:   17.z
//           bool passThrough_Exposure; // Index:   17.w
//           bool passThrough_WhiteBalance;// Index:   18
//           bool passThrough_SLog;     // Index:   18.y
//
//       } constants;                   // Index:    0
//
//       struct BloomConstants
//       {
//
//           float4 m_WideScaledCoefs[16];// Index:   19
//           float4 m_WideGaussCoefs[16];// Index:   35
//           float4 m_NarrowScaledCoefs[16];// Index:   51
//           float4 m_NarrowGaussCoefs[16];// Index:   67
//           float m_FrameBlend;        // Index:   83
//           float m_RampOffset;        // Index:   83.y
//           float m_RampScale;         // Index:   83.z
//           float m_Adaptation_Exposure;// Index:   83.w
//           float m_StartLuminance;    // Index:   84
//           float m_FullLuminance;     // Index:   84.y
//           float m_ContributionFalloff;// Index:   84.z
//           float m_MaxLuminance;      // Index:   84.w
//           float m_MaxFalloff;        // Index:   85
//           float m_FinalScale;        // Index:   85.y
//           float m_NarrowFinalScale;  // Index:   85.z
//           float m_WideFinalScale;    // Index:   85.w
//           float m_RcpLumRange;       // Index:   86
//           float m_RcpLumRangeTimesStartLuminance;// Index:   86.y
//           float m_FullLumMinusMaxFalloffRcp;// Index:   86.z
//           float m_MaxLuminanceMinusFullLuminance;// Index:   86.w
//
//       } bloomConstants;              // Index:   19
//
//       struct TemporalAAConsts
//       {
//
//           float TAAConvergenceLimit; // Index:   87
//           float TAAHP;               // Index:   87.y
//           float TAALP;               // Index:   87.z
//           float TAAColorExtent;      // Index:   87.w
//           float TAACheckerboardFramePhase;// Index:   88
//           float TAAMotionRejection;  // Index:   88.y
//           float TAAEnable;           // Index:   88.z
//           float HalfResTAAEnable;    // Index:   88.w
//           float HalfResTAAConvergence;// Index:   89
//           uint TAAForceSmooth;       // Index:   89.y
//           float TAATransparentsContributionRejectionMultiply;// Index:   89.z
//           float TAAVarianceBlurIncrease;// Index:   89.w
//           float TAAVarianceTransparentDecrease;// Index:   90
//           float TAAEncodeRange;      // Index:   90.y
//           float TAAInvEncodeRange;   // Index:   90.z
//           uint DebugSimilarity;      // Index:   90.w
//           float VarianceWindow;      // Index:   91
//           float2 UpsampleOffset;     // Index:   91.y
//
//       } temporalConsts;              // Index:   87
//       float4 blurSamples[16];        // Index:   92
//
//   } resourceTables__passData;        // Index:    0-107            Components:   432
                                        // Textures:  t0-t7
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// resourceTables__passData__smpPointClamp    sampler      NA          NA    0        1
// resourceTables__passData__smpLinearClamp    sampler      NA          NA    1        1
// resourceTables__passData.InputColor    texture  float4          2d    0        1
// resourceTables__passData.InputHalfResColorPrevFrame    texture  float4          2d    1        1
// resourceTables__passData.InputMotionVectors    texture  float2          2d    2        1
// resourceTables__passData.InputCoC    texture  float4          2d    3        1
// resourceTables__passData.InputTransparents    texture  float4          2d    4        1
// resourceTables__passData.InputTransparentsLowRes    texture  float4          2d    5        1
// resourceTables__passData.InputRefraction    texture  float4          2d    6        1
// resourceTables__passData.NoiseTexture    texture   float     2darray    7        1
// resourceTables__passData.OutBloom4        UAV  float4          2d   10        1
// resourceTables__passData.OutBloom8        UAV  float4          2d   11        1
// ConstBuf__passData                cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// no Input
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// no Output
cs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[90], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_resource_texture2d (float,float,float,float) t5
dcl_resource_texture2d (float,float,float,float) t6
dcl_resource_texture2darray (float,float,float,float) t7
dcl_uav_typed_texture2d (float,float,float,float) u10
dcl_uav_typed_texture2d (float,float,float,float) u11
dcl_input vThreadIDInGroupFlattened
dcl_input vThreadGroupID.xy
dcl_temps 50
dcl_tgsm_structured g0, 4, 64
dcl_thread_group 64, 1, 1
dcl_resource_texture2d (float,float,float,float) t125
ld_indexable(texture2d)(float,float,float,float) r40.xyzw, l(0, 0, 0, 0), t125.xyzw
and r0.x, vThreadIDInGroupFlattened.x, l(7)
ushr r0.y, vThreadIDInGroupFlattened.x, l(3)
imad r0.xy, vThreadGroupID.xyxx, l(8, 8, 0, 0), r0.xyxx
utof r1.xy, r0.xyxx
add r1.xy, r1.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
mul r1.xy, r1.xyxx, cb0[3].zwzz
sample_l_indexable(texture2d)(float,float,float,float) r2.xyz, r1.xyxx, t6.xywz, s1, l(0.000000)
mul r1.zw, r2.xxxy, l(0.000000, 0.000000, 1.000000, -1.000000)
dp2 r2.x, r2.xyxx, r2.xyxx
ne r2.x, r2.x, l(0.000000)
if_nz r2.x
  gather4_indexable(texture2d)(float,float,float,float) r3.xyzw, r1.xyxx, t6.xyzw, s0.z
  min r2.x, r3.z, r3.y
  min r2.x, r2.x, r3.x
  min r2.x, r3.w, r2.x
  max r2.x, -r2.x, l(1.000000)
  div r2.x, r2.z, r2.x
  and r3.xy, r0.xyxx, l(63, 63, 0, 0)
  and r3.z, l(7), cb0[14].w
  mov r3.w, l(0)
  ld_indexable(texture2darray)(float,float,float,float) r2.y, r3.xyzw, t7.yxzw
  mul r2.z, r2.y, l(0.250000)
  mad r3.xy, r1.zwzz, r2.zzzz, r1.xyxx
  sample_l_indexable(texture2d)(float,float,float,float) r2.w, r3.xyxx, t3.xyzw, s1, l(0.000000)
  mad r3.xyz, r2.yyyy, l(0.250000, 0.250000, 0.250000, 0.000000), l(0.250000, 0.500000, 0.750000, 0.000000)
  mad r4.xyzw, r1.zwzw, r3.xxyy, r1.xyxy
  sample_l_indexable(texture2d)(float,float,float,float) r2.y, r4.xyxx, t3.xwyz, s1, l(0.000000)
  sample_l_indexable(texture2d)(float,float,float,float) r3.w, r4.zwzz, t3.xyzw, s1, l(0.000000)
  mad r4.xy, r1.zwzz, r3.zzzz, r1.xyxx
  sample_l_indexable(texture2d)(float,float,float,float) r4.x, r4.xyxx, t3.wxyz, s1, l(0.000000)
  lt r2.yw, r2.xxxx, r2.yyyw
  and r2.z, r2.z, r2.w
  movc r2.y, r2.y, r3.x, r2.z
  lt r2.z, r2.x, r3.w
  movc r2.y, r2.z, r3.y, r2.y
  lt r2.x, r2.x, r4.x
  movc r2.x, r2.x, r3.z, r2.y
else
  mov r2.x, l(0)
endif
mad r1.zw, r1.zzzw, r2.xxxx, r1.xxxy
sample_l_indexable(texture2d)(float,float,float,float) r2.xyz, r1.zwzz, t0.xyzw, s1, l(0.000000)
sample_l_indexable(texture2d)(float,float,float,float) r3.xyzw, r1.xyxx, t4.xyzw, s1, l(0.000000)
max r3.xyzw, r3.xyzw, l(0.000000, 0.000000, 0.000000, 0.000000)
sample_l_indexable(texture2d)(float,float,float,float) r4.xyzw, r1.xyxx, t5.xyzw, s1, l(0.000000)
max r4.xyzw, r4.xyzw, l(0.000000, 0.000000, 0.000000, 0.000000)
mul r2.w, r3.w, r4.w
mad r3.xyz, r3.xyzx, r4.wwww, r4.xyzx
mul r3.w, l(4.000000), cb0[89].z
mad_sat r4.x, -r2.y, r2.w, r3.y
mad_sat r3.w, -r3.w, r4.x, l(1.000000)
mov r0.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r0.zw, r0.xyzw, t2.zwxy

//Disabled with new TAA fix.
//mad r0.z, r40.x, l(0.5), r0.z

mad r0.zw, r0.zzzw, cb0[6].zzzw, r1.xxxy
sample_l_indexable(texture2d)(float,float,float,float) r4.xyz, r0.zwzz, t1.xyzw, s1, l(0.000000)
sample_l_aoffimmi_indexable(0,-1,0)(texture2d)(float,float,float,float) r5.xyz, r1.zwzz, t0.xyzw, s1, l(0.000000)
sample_l_aoffimmi_indexable(-1,0,0)(texture2d)(float,float,float,float) r6.xyz, r1.zwzz, t0.xyzw, s1, l(0.000000)
sample_l_aoffimmi_indexable(1,0,0)(texture2d)(float,float,float,float) r7.xyz, r1.zwzz, t0.xyzw, s1, l(0.000000)
sample_l_aoffimmi_indexable(0,1,0)(texture2d)(float,float,float,float) r1.xyz, r1.zwzz, t0.xyzw, s1, l(0.000000)
add r8.xyz, r2.xyzx, r5.xyzx
add r8.xyz, r6.xyzx, r8.xyzx
add r8.xyz, r7.xyzx, r8.xyzx
add r8.xyz, r1.xyzx, r8.xyzx
mul r8.xyz, r8.xyzx, l(0.200000, 0.200000, 0.200000, 0.000000)
mul r5.xyz, r5.xyzx, r5.xyzx
mad r5.xyz, r2.xyzx, r2.xyzx, r5.xyzx
mad r5.xyz, r6.xyzx, r6.xyzx, r5.xyzx
mad r5.xyz, r7.xyzx, r7.xyzx, r5.xyzx
mad r1.xyz, r1.xyzx, r1.xyzx, r5.xyzx
mul r5.xyz, r8.xyzx, r8.xyzx
mad r1.xyz, r1.xyzx, l(0.200000, 0.200000, 0.200000, 0.000000), -r5.xyzx
max r1.xyz, r1.xyzx, l(9.999999717E-010, 9.999999717E-010, 9.999999717E-010, 0.000000)
sqrt r1.xyz, r1.xyzx
mad r5.xyz, r8.xyzx, r2.wwww, r3.xyzx
mad r2.xyz, r2.xyzx, r2.wwww, r3.xyzx
mad r3.xyz, -r1.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), r5.xyzx
mad r1.xyz, r1.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), r5.xyzx
max r0.z, r4.z, r4.y
max r0.z, r0.z, r4.x
add r0.z, -r0.z, l(1.000000)
rcp r0.z, r0.z
mul r4.xyz, r0.zzzz, r4.xyzx
min r5.xyz, r1.xyzx, r4.xyzx
max r1.xyz, r1.xyzx, r4.xyzx
min r1.xyz, r3.xyzx, r1.xyzx
max r1.xyz, r1.xyzx, r5.xyzx
mul r0.z, r3.w, cb0[89].x
add r1.xyz, -r2.xyzx, r1.xyzx
mad r1.xyz, r0.zzzz, r1.xyzx, r2.xyzx
mul r1.xyz, r1.xyzx, cb0[83].wwww
dp3 r0.z, l(0.299000, 0.587000, 0.114000, 0.000000), r1.xyzx
mad_sat r0.w, r0.z, cb0[86].x, -cb0[86].y
log r0.w, r0.w
mul r0.w, r0.w, cb0[84].z
exp r0.w, r0.w
add r1.w, r0.z, -cb0[86].z
max r1.w, r1.w, l(1.000000013E-010)
div r1.w, l(1.000000, 1.000000, 1.000000, 1.000000), r1.w
add_sat r1.w, -r1.w, cb0[85].x
mad r1.w, r1.w, cb0[86].w, cb0[84].y
max r0.z, r0.z, l(1.000000013E-010)
div_sat r0.z, r1.w, r0.z
mul r0.z, r0.z, r0.w
mul r1.xyz, r0.zzzz, r1.xyzx
max r0.z, r1.z, r1.y
max r0.z, r0.z, r1.x
add r0.z, r0.z, l(1.000000)
rcp r0.z, r0.z
mul r2.xyz, r0.zzzz, r1.xyzx
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r2.x
sync_g_t
xor r3.xyzw, vThreadIDInGroupFlattened.xxxx, l(8, 1, 16, 2)
ld_structured r0.w, r3.x, l(0), g0.xxxx
mad r0.w, r1.x, r0.z, r0.w
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r2.y
sync_g_t
ld_structured r1.x, r3.x, l(0), g0.xxxx
mad r1.x, r1.y, r0.z, r1.x
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r2.z
sync_g_t
ld_structured r1.y, r3.x, l(0), g0.xxxx
mad r0.z, r1.z, r0.z, r1.y
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r0.w
sync_g_t
ld_structured r1.y, r3.y, l(0), g0.xxxx
add r2.x, r0.w, r1.y
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r1.x
sync_g_t
ld_structured r0.w, r3.y, l(0), g0.xxxx
add r2.y, r0.w, r1.x
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r0.z
sync_g_t
ld_structured r0.w, r3.y, l(0), g0.xxxx
add r2.z, r0.w, r0.z
mul r1.xyz, r2.xyzx, l(0.250000, 0.250000, 0.250000, 0.000000)
max r0.z, r1.z, r1.y
max r0.z, r0.z, r1.x
add r0.z, -r0.z, l(1.000000)
rcp r0.z, r0.z
mul r1.xyz, r0.zzzz, r1.xyzx
max r1.xyz, r1.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
min r1.xyz, r1.xyzx, l(20.000000, 20.000000, 20.000000, 0.000000)
and r2.xyzw, r0.xyxy, l(1, 1, 3, 3)
ieq r2.xyzw, r2.xyzw, l(0, 0, 0, 0)
and r0.zw, r2.yyyw, r2.xxxz
if_nz r0.z
  ushr r2.xyzw, r0.xyyy, l(1, 1, 1, 1)
  mov r1.w, l(0)
  store_uav_typed u10.xyzw, r2.xyzw, r1.xyzw
endif
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r1.x
sync_g_t
ld_structured r0.z, r3.z, l(0), g0.xxxx
add r0.z, r0.z, r1.x
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r1.y
sync_g_t
ld_structured r1.x, r3.z, l(0), g0.xxxx
add r1.x, r1.x, r1.y
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r1.z
sync_g_t
ld_structured r1.y, r3.z, l(0), g0.xxxx
add r1.y, r1.y, r1.z
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r0.z
sync_g_t
ld_structured r1.z, r3.w, l(0), g0.xxxx
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r1.x
sync_g_t
ld_structured r1.w, r3.w, l(0), g0.xxxx
sync_g_t
store_structured g0.x, vThreadIDInGroupFlattened.x, l(0), r1.y
sync_g_t
if_nz r0.w
  add r2.x, r0.z, r1.z
  add r2.y, r1.w, r1.x
  ld_structured r0.z, r3.w, l(0), g0.xxxx
  add r2.z, r0.z, r1.y
  mul r1.xyz, r2.xyzx, l(0.250000, 0.250000, 0.250000, 0.000000)
  ushr r0.xyzw, r0.xyyy, l(2, 2, 2, 2)
  mov r1.w, l(0)
  store_uav_typed u11.xyzw, r0.xyzw, r1.xyzw
endif
ret
// Approximately 192 instruction slots used
