// AUTOMATICALLY CONVERTED FROM SHADER FIXES 
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v0.6.181 on Wed Apr  3 22:57:01 2024
//
//
// Buffer Definitions:
//
// cbuffer M_Common_PSConstants_Camera
// {
//
//   float4x4 mViewProj;                // Index:    0 1 2 3          Components:    16 [unused]
//   float4 mDepthConvertToOrthoCoeffsNearFar;// Index:    4.xyzw           Components:     4 [unused]
//   float4 mDepthToTextureCoefficients;// Index:    5.xyzw           Components:     4 [unused]
//   float4 mDepthCoefficientsMtl;      // Index:    6.xyzw           Components:     4
//   float4 mShadowMapBiasScaleOffset;  // Index:    7.xyzw           Components:     4 [unused]
//   float4x4 mView;                    // Index:    8 9 10 11        Components:    16 [unused]
//   float4x4 mProj;                    // Index:   12 13 14 15       Components:    16
//   float4x4 mViewInv;                 // Index:   16 17 18 19       Components:    16 [unused]
//   float4 mInvProj;                   // Index:   20.xyzw           Components:     4
//   float4 mEyePos;                    // Index:   21.xyzw           Components:     4 [unused]
//   float3 mEyeDir;                    // Index:   22.xyz            Components:     3 [unused]
//   uint3 mDebugMode;                  // Index:   23.xyz            Components:     3 [unused]
//
// }
//
// cbuffer BlurAgent_PSConstants
// {
//
//   float4 mDepthCoefficients;         // Index:    0.xyzw           Components:     4 [unused]
//   float4 mInvWidthHeight;            // Index:    1.xyzw           Components:     4 [unused]
//   float4 mNearFocusFarRadius;        // Index:    2.xyzw           Components:     4 [unused]
//   float4 mAutoFocusUVs1;             // Index:    3.xyzw           Components:     4 [unused]
//   float4 mAutoFocusUVs2;             // Index:    4.xyzw           Components:     4 [unused]
//   float4 mAutoFocusUVs3;             // Index:    5.xyzw           Components:     4 [unused]
//   float4 mViewportConstants;         // Index:    6.xyzw           Components:     4
//   float4 mInvProjectionScalesOffset; // Index:    7.xyzw           Components:     4 [unused]
//   float4x4 mDeltaMatrix;             // Index:    8 9 10 11        Components:    16
//   float4 mMotionBlurControls;        // Index:   12.xyzw           Components:     4 [unused]
//   float2 mBlurViewportScale;         // Index:   13.xy             Components:     2
//   float2 mUIMaskScale;               // Index:   13.zw             Components:     2 [unused]
//   float2 mTemporalJitterCorrection;  // Index:   14.xy             Components:     2
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// depthMap_sampler_s                sampler      NA          NA    2        1
// depthMap                          texture  float4          2d    2        1
// StereoParams                      texture  float4          2d  125        1
// M_Common_PSConstants_Camera       cbuffer      NA          NA    0        1
// BlurAgent_PSConstants             cbuffer      NA          NA    9        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 0   xy          0     NONE   float   xy
// SV_POSITION              0   xyzw        1      POS   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 CB0[21], immediateIndexed
dcl_constantbuffer CB9[15], immediateIndexed
dcl_sampler s2, mode_default
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_buffer (float,float,float,float) t125
dcl_input_ps linear v0.xy
dcl_input_ps_siv linear noperspective v1.xy, position
dcl_output o0.xyzw
dcl_temps 2
mad r0.xy, v0.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), cb0[20].zwzz
add r0.xy, r0.xyxx, l(-1.000000, -1.000000, 0.000000, 0.000000)
mul r0.xy, r0.xyxx, cb0[20].xyxx
ld_indexable(buffer)(float,float,float,float) r0.zw, l(0, 0, 0, 0), t125.zwxy
mul r1.xy, v0.xyxx, cb9[13].xyxx
sample_l_indexable(texture2d)(float,float,float,float) r1.x, r1.xyxx, t2.xyzw, s2, l(0.000000)
add r1.x, r1.x, -cb0[6].x
div r1.z, cb0[6].y, r1.x
add r0.w, -r0.w, r1.z
mul r0.z, r0.w, r0.z
div r0.z, r0.z, cb0[12].x
mad r1.x, r1.z, r0.x, -r0.z
mul r1.y, r0.y, r1.z
mov r1.w, l(1.000000)
dp4 r0.x, r1.xyzw, cb9[8].xyzw
dp4 r0.y, r1.xyzw, cb9[11].xyzw
dp4 r1.y, r1.xyzw, cb9[9].xyzw
mov o0.zw, r1.zzzw
ld_indexable(buffer)(float,float,float,float) r0.zw, l(2, 0, 0, 0), t125.zwxy
add r0.w, -r0.w, r0.y
mad r1.x, r0.z, r0.w, r0.x
div r0.xy, r1.xyxx, r0.yyyy
add r0.zw, v1.xxxy, cb9[6].zzzw
mad r0.xy, r0.zwzz, cb9[6].xyxx, -r0.xyxx
mad o0.xy, r0.xyxx, l(0.500000, -0.500000, 0.000000, 0.000000), cb9[14].xyxx
ret
// Approximately 26 instruction slots used

///////////////////////////////// HLSL Code /////////////////////////////////
// // ---- Created with 3Dmigoto v0.6.181 on Wed Apr  3 22:57:01 2024
//
// cbuffer M_Common_PSConstants_Camera : register(b0)
// {
//   float4x4 mViewProj : packoffset(c0);
//   float4 mDepthConvertToOrthoCoeffsNearFar : packoffset(c4);
//   float4 mDepthToTextureCoefficients : packoffset(c5);
//   float4 mDepthCoefficientsMtl : packoffset(c6);
//   float4 mShadowMapBiasScaleOffset : packoffset(c7);
//   float4x4 mView : packoffset(c8);
//   float4x4 mProj : packoffset(c12);
//   float4x4 mViewInv : packoffset(c16);
//   float4 mInvProj : packoffset(c20);
//   float4 mEyePos : packoffset(c21);
//   float3 mEyeDir : packoffset(c22);
//   uint3 mDebugMode : packoffset(c23);
// }
//
// cbuffer BlurAgent_PSConstants : register(b9)
// {
//   float4 mDepthCoefficients : packoffset(c0);
//   float4 mInvWidthHeight : packoffset(c1);
//   float4 mNearFocusFarRadius : packoffset(c2);
//   float4 mAutoFocusUVs1 : packoffset(c3);
//   float4 mAutoFocusUVs2 : packoffset(c4);
//   float4 mAutoFocusUVs3 : packoffset(c5);
//   float4 mViewportConstants : packoffset(c6);
//   float4 mInvProjectionScalesOffset : packoffset(c7);
//   float4x4 mDeltaMatrix : packoffset(c8);
//   float4 mMotionBlurControls : packoffset(c12);
//   float2 mBlurViewportScale : packoffset(c13);
//   float2 mUIMaskScale : packoffset(c13.z);
//   float2 mTemporalJitterCorrection : packoffset(c14);
// }
//
// SamplerState depthMap_sampler_s_s : register(s2);
// Texture2D<float4> depthMap : register(t2);
//
//
// // 3Dmigoto declarations
// #define cmp -
// Texture1D<float4> IniParams : register(t120);
// Buffer<float4> StereoParams : register(t125);
//
//
// void main(
//   float2 v0 : TEXCOORD0,
//   float4 v1 : SV_POSITION0,
//   out float4 o0 : SV_TARGET0)
// {
//   float4 r0,r1;
//   uint4 bitmask, uiDest;
//   float4 fDest;
//
//   r0.xy = v0.xy * float2(2,2) + mInvProj.zw;
//   r0.xy = float2(-1,-1) + r0.xy;
//   r0.xy = mInvProj.xy * r0.xy;
//   r0.zw = StereoParams.Load(float4(0,0,0,0)).xy;
//   r1.xy = mBlurViewportScale.xy * v0.xy;
//   r1.x = depthMap.SampleLevel(depthMap_sampler_s_s, r1.xy, 0).x;
//   r1.x = -mDepthCoefficientsMtl.x + r1.x;
//   r1.z = mDepthCoefficientsMtl.y / r1.x;
//   r0.w = r1.z + -r0.w;
//   r0.z = r0.z * r0.w;
//   r0.z = r0.z / mProj._m00;
//   r1.x = r1.z * r0.x + -r0.z;
//   r1.y = r1.z * r0.y;
//   r1.w = 1;
//   r0.x = dot(r1.xyzw, mDeltaMatrix._m00_m10_m20_m30);
//   r0.y = dot(r1.xyzw, mDeltaMatrix._m03_m13_m23_m33);
//   r1.y = dot(r1.xyzw, mDeltaMatrix._m01_m11_m21_m31);
//   o0.zw = r1.zw;
//   r0.zw = StereoParams.Load(float4(2,0,0,0)).xy;
//   r0.w = r0.y + -r0.w;
//   r1.x = r0.z * r0.w + r0.x;
//   r0.xy = r1.xy / r0.yy;
//   r0.zw = mViewportConstants.zw + v1.xy;
//   r0.xy = r0.zw * mViewportConstants.xy + -r0.xy;
//   o0.xy = r0.xy * float2(0.5,-0.5) + mTemporalJitterCorrection.xy;
//   return;
// }
/////////////////////////////////////////////////////////////////////////////
