// AUTOMATICALLY CONVERTED FROM SHADER FIXES 
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v0.6.89 on Mon Dec 26 00:11:14 2022
//
//
// Buffer Definitions:
//
// cbuffer RenderView
// {
//
//   float4x4 uProjectionMatrix;        // Index:    0 1 2 3          Components:    16
//   float4x4 uModelViewMatrix;         // Index:    4 5 6 7          Components:    16 [unused]
//   float4x4 uInverseProjectionMatrix; // Index:    8 9 10 11        Components:    16 [unused]
//   float4x4 uPrevProjection;          // Index:   12 13 14 15       Components:    16 [unused]
//   float4x4 uInverseModelViewMatrix;  // Index:   16 17 18 19       Components:    16
//   float4x4 uPrevModelView;           // Index:   20 21 22 23       Components:    16 [unused]
//   float4x4 uRotationMatrix;          // Index:   24 25 26 27       Components:    16 [unused]
//   float4x4 uInverseRotationMatrix;   // Index:   28 29 30 31       Components:    16 [unused]
//   float4x4 uTransposedRotationMatrix;// Index:   32 33 34 35       Components:    16 [unused]
//   float4x4 uClipMatrix;              // Index:   36 37 38 39       Components:    16 [unused]
//   float4x4 uInverseClipMatrix;       // Index:   40 41 42 43       Components:    16 [unused]
//   float4x4 uPrevClipMatrix;          // Index:   44 45 46 47       Components:    16 [unused]
//   float4x4 uNormalMatrix;            // Index:   48 49 50 51       Components:    16 [unused]
//   float3 uViewOrigin;                // Index:   52.xyz            Components:     3
//   float uViewWidth;                  // Index:   52.w              Components:     1
//   float uViewHeight;                 // Index:   53.x              Components:     1
//   float uZNear;                      // Index:   53.y              Components:     1 [unused]
//   float uZFar;                       // Index:   53.z              Components:     1 [unused]
//   float2 uInvFocalCoords;            // Index:   54.xy             Components:     2
//   float4 uResolutionScale;           // Index:   55.xyzw           Components:     4
//   float4 uScreenBounds;              // Index:   56.xyzw           Components:     4
//   float4 uFrustumCorners[4];         // Index:   57 58 59 60       Components:    16 [unused]
//
// }
//
// cbuffer WorldFog
// {
//
//   float4 uFogColor;                  // Index:    0.xyzw           Components:     4
//
// }
//
// cbuffer QuakeSkyParams
// {
//
//   float uSpeedScale;                 // Index:    0.x              Components:     1
//   float uSkyFogFactor;               // Index:    0.y              Components:     1
//   float uSkyAlpha;                   // Index:    0.z              Components:     1
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// uSampletQuakeImage_s              sampler      NA          NA    0        1
// uTex_tQuakeImage                  texture  float4          2d    0        1
// StereoParams                      texture  float4          2d  125        1
// RenderView                        cbuffer      NA          NA    0        1
// WorldFog                          cbuffer      NA          NA    1        1
// QuakeSkyParams                    cbuffer      NA          NA    2        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xy
// POSITION                 0   xyz         1     NONE   float     z
// POSITION                 1   xyzw        2     NONE   float
// POSITION                 2   xyzw        3     NONE   float
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_4_0
dcl_constantbuffer CB0[57], immediateIndexed
dcl_constantbuffer CB1[1], immediateIndexed
dcl_constantbuffer CB2[1], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_buffer (float,float,float,float) t125
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v1.z
dcl_output o0.xyzw
dcl_temps 4
ld r0.xyzw, l(0, 0, 0, 0), t125.xyzw
mad r0.y, r0.y, l(0.200000), v1.z
mul r0.x, r0.y, r0.x
div r0.x, r0.x, cb0[0].x
div r1.x, v0.x, cb0[52].w
div r1.y, v0.y, cb0[53].x
mul r0.yz, cb0[55].zzwz, cb0[56].xxyx
mad r1.xy, r1.xyxx, cb0[55].zwzz, -r0.yzyy
add r1.z, -r1.y, l(1.000000)
mad r0.yz, r1.xxzx, l(0.000000, 2.000000, 2.000000, 0.000000), l(0.000000, -1.000000, -1.000000, 0.000000)
mul r0.yz, r0.yyzy, cb0[54].xxyx
mad r0.x, -v1.z, r0.y, r0.x
mul r0.y, r0.z, -v1.z
mul r0.yzw, r0.yyyy, cb0[17].xxyz
mad r0.xyz, cb0[16].xyzx, r0.xxxx, r0.yzwy
mad r0.xyz, cb0[18].xyzx, v1.zzzz, r0.xyzx
add r0.xyz, r0.xyzx, cb0[19].xyzx
add r0.xyz, r0.xyzx, -cb0[52].xyzx
mul r0.w, r0.z, l(3.000000)
dp3 r0.z, r0.xywx, r0.xywx
sqrt r0.z, r0.z
div r0.z, l(378.000000), r0.z
mad r0.xy, r0.xyxx, r0.zzzz, cb2[0].xxxx
mad r1.xyz, r0.xyxx, l(0.00781250000, 0.00781250000, 0.00781250000, 0.000000), l(0.00781250000, 0.000000, -0.00781250000, 0.000000)
sample r2.xyzw, r1.xyxx, t0.xyzw, s0
sample r1.xyzw, r1.zyzz, t0.xyzw, s0
add r0.z, r1.w, r2.w
mad r1.xyz, r0.xyyx, l(0.00781250000, 0.00781250000, 0.00781250000, 0.000000), l(0.000000, 0.00781250000, -0.00781250000, 0.000000)
sample r2.xyzw, r1.xyxx, t0.xyzw, s0
sample r1.xyzw, r1.xzxx, t0.xyzw, s0
add r0.z, r0.z, r2.w
add r0.z, r1.w, r0.z
mad r1.xyzw, r0.xyxy, l(0.00781250000, 0.00781250000, 0.00781250000, 0.00781250000), l(0.00781250000, 0.00781250000, -0.00781250000, -0.00781250000)
sample r2.xyzw, r1.xyxx, t0.xyzw, s0
add r0.z, r0.z, r2.w
sample r2.xyzw, r1.zwzz, t0.xyzw, s0
add r0.z, r0.z, r2.w
sample r2.xyzw, r1.xwxx, t0.xyzw, s0
sample r1.xyzw, r1.zyzz, t0.xyzw, s0
add r0.z, r0.z, r2.w
add r0.z, r1.w, r0.z
mad r1.xyz, r0.xyxx, l(0.00781250000, 0.00781250000, 0.00781250000, 0.000000), l(0.015625, 0.000000, -0.015625, 0.000000)
sample r2.xyzw, r1.xyxx, t0.xyzw, s0
sample r1.xyzw, r1.zyzz, t0.xyzw, s0
add r0.z, r0.z, r2.w
add r0.z, r1.w, r0.z
mad r1.xyz, r0.xyyx, l(0.00781250000, 0.00781250000, 0.00781250000, 0.000000), l(0.000000, 0.015625, -0.015625, 0.000000)
sample r2.xyzw, r1.xyxx, t0.xyzw, s0
sample r1.xyzw, r1.xzxx, t0.xyzw, s0
add r0.z, r0.z, r2.w
add r0.z, r1.w, r0.z
mad r1.xyzw, r0.xyxy, l(0.00781250000, 0.00781250000, 0.00781250000, 0.00781250000), l(0.015625, 0.015625, -0.015625, -0.015625)
mul r0.xy, r0.xyxx, l(0.00781250000, 0.00781250000, 0.000000, 0.000000)
sample r2.xyzw, r0.xyxx, t0.xyzw, s0
sample r3.xyzw, r1.xyxx, t0.xyzw, s0
add r0.x, r0.z, r3.w
sample r3.xyzw, r1.zwzz, t0.xyzw, s0
add r0.x, r0.x, r3.w
sample r3.xyzw, r1.xwxx, t0.xyzw, s0
sample r1.xyzw, r1.zyzz, t0.xyzw, s0
add r0.x, r0.x, r3.w
add r0.x, r1.w, r0.x
mul r0.x, r2.w, r0.x
mul o0.w, r0.x, l(0.062500)
mul r0.xyz, r2.xyzx, cb2[0].zzzz
mad r1.xyz, -r2.xyzx, cb2[0].zzzz, cb1[0].xyzx
mad o0.xyz, cb2[0].yyyy, r1.xyzx, r0.xyzx
ret
// Approximately 68 instruction slots used
