// AUTOMATICALLY CONVERTED FROM SHADER FIXES 
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v0.6.193 on Fri May 24 21:00:50 2024
//
//
// Buffer Definitions:
//
// cbuffer CBClipVolume
// {
//
//   struct <unnamed>
//   {
//
//       row_major float4x4 transformMatrix;// Index:    0
//       float4 projRatioScreenScale;   // Index:    4
//       float4 blendPlane0;            // Index:    5
//       float4 blendPlane1;            // Index:    6
//       float2 screenScale;            // Index:    7
//       float LG_SceneSelector;        // Index:    7.z
//       float _padding;                // Index:    7.w
//
//   } cbClipVolume;                    // Index:    0-7              Components:    32
//
// }
//
// cbuffer CBPerViewGlobal
// {
//
//   row_major float4x4 CV_ViewProjZeroMatr;// Index:    0 1 2 3          Components:    16 [unused]
//   float4 CV_AnimGenParams;           // Index:    4.xyzw           Components:     4 [unused]
//   row_major float4x4 CV_ViewProjMatr;// Index:    5 6 7 8          Components:    16 [unused]
//   row_major float4x4 CV_ViewProjNearestMatr;// Index:    9 10 11 12       Components:    16 [unused]
//   row_major float4x4 CV_InvViewProj; // Index:   13 14 15 16       Components:    16 [unused]
//   row_major float4x4 CV_PrevViewProjMatr;// Index:   17 18 19 20       Components:    16 [unused]
//   row_major float4x4 CV_PrevViewProjNearestMatr;// Index:   21 22 23 24       Components:    16 [unused]
//   row_major float3x4 CV_ScreenToWorldBasis;// Index:   25 26 27          Components:    12 [unused]
//   float4 CV_TessInfo;                // Index:   28.xyzw           Components:     4 [unused]
//   float4 CV_CameraRightVector;       // Index:   29.xyzw           Components:     4 [unused]
//   float4 CV_CameraFrontVector;       // Index:   30.xyzw           Components:     4 [unused]
//   float4 CV_CameraUpVector;          // Index:   31.xyzw           Components:     4 [unused]
//   float4 CV_ScreenSize;              // Index:   32.xyzw           Components:     4 [unused]
//   float4 CV_HPosScale;               // Index:   33.xyzw           Components:     4 [unused]
//   float4 CV_HPosClamp;               // Index:   34.xyzw           Components:     4 [unused]
//   float4 CV_ProjRatio;               // Index:   35.xyzw           Components:     4 [unused]
//   float4 CV_NearestScaled;           // Index:   36.xyzw           Components:     4 [unused]
//   float4 CV_NearFarClipDist;         // Index:   37.xyzw           Components:     4
//   float4 CV_SunLightDir;             // Index:   38.xyzw           Components:     4 [unused]
//   float4 CV_SunColor;                // Index:   39.xyzw           Components:     4 [unused]
//   float4 CV_SkyColor;                // Index:   40.xyzw           Components:     4 [unused]
//   float4 CV_FogColor;                // Index:   41.xyzw           Components:     4 [unused]
//   float4 CV_TerrainInfo;             // Index:   42.xyzw           Components:     4 [unused]
//   float4 CV_DecalZFightingRemedy;    // Index:   43.xyzw           Components:     4 [unused]
//   row_major float4x4 CV_FrustumPlaneEquation;// Index:   44 45 46 47       Components:    16 [unused]
//   float4 CV_WindGridOffset;          // Index:   48.xyzw           Components:     4 [unused]
//   row_major float4x4 CV_ViewMatr;    // Index:   49 50 51 52       Components:    16 [unused]
//   row_major float4x4 CV_InvViewMatr; // Index:   53 54 55 56       Components:    16 [unused]
//   float CV_LookingGlass_SunSelector; // Index:   57.x              Components:     1 [unused]
//   float CV_LookingGlass_DepthScalar; // Index:   57.y              Components:     1 [unused]
//   float CV_PADDING0;                 // Index:   57.z              Components:     1 [unused]
//   float CV_PADDING1;                 // Index:   57.w              Components:     1 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// DepthTex                          texture  float4          2d    3        1
// StereoParams                      texture  float4          2d  125        1
// CBClipVolume                      cbuffer      NA          NA    0        1
// CBPerViewGlobal                   cbuffer      NA          NA    7        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      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[8], immediateIndexed
dcl_constantbuffer CB7[38], immediateIndexed
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_buffer (float,float,float,float) t125
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_output o0.xyzw
dcl_temps 3
round_z r0.xy, v0.xyxx
ftoi r0.xy, r0.xyxx
mov r0.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r0.x, r0.xyzw, t3.xyzw
mul r0.y, r0.x, cb7[37].y
div r0.x, cb0[4].y, r0.x
add r1.z, r0.x, cb0[4].x
ld_indexable(buffer)(float,float,float,float) r0.xz, l(0, 0, 0, 0), t125.xzyw
div r0.y, r0.z, r0.y
add r0.y, r0.y, l(-1.000000)
mul r0.x, r0.y, r0.x
mul r0.yz, v0.xxyx, cb0[4].zzwz
div r2.yz, r0.yyzy, cb0[7].xxyx
mad r2.x, r0.x, l(0.500000), r2.y
mad r1.xy, r2.xzxx, l(2.000000, -2.000000, 0.000000, 0.000000), l(-1.000000, 1.000000, 0.000000, 0.000000)
mov r1.w, l(1.000000)
dp4 r0.x, cb0[6].xyzw, r1.xyzw
dp4 r0.y, cb0[5].xyzw, r1.xyzw
max r0.xy, r0.xyxx, l(0.000000, 0.000000, 0.000000, 0.000000)
add r0.x, r0.x, r0.y
max r0.x, r0.x, l(0.000010)
div o0.xyzw, r0.yyyy, r0.xxxx
ret
// Approximately 23 instruction slots used

///////////////////////////////// HLSL Code /////////////////////////////////
// // ---- Created with geo-11 v0.6.193 on Fri May 24 21:00:50 2024
//
// cbuffer CBClipVolume : register(b0)
// {
//
//   struct
//   {
//     row_major float4x4 transformMatrix;
//     float4 projRatioScreenScale;
//     float4 blendPlane0;
//     float4 blendPlane1;
//     float2 screenScale;
//     float LG_SceneSelector;
//     float _padding;
//   } cbClipVolume : packoffset(c0);
//
// }
//
// cbuffer CBPerViewGlobal : register(b7)
// {
//   row_major float4x4 CV_ViewProjZeroMatr : packoffset(c0);
//   float4 CV_AnimGenParams : packoffset(c4);
//   row_major float4x4 CV_ViewProjMatr : packoffset(c5);
//   row_major float4x4 CV_ViewProjNearestMatr : packoffset(c9);
//   row_major float4x4 CV_InvViewProj : packoffset(c13);
//   row_major float4x4 CV_PrevViewProjMatr : packoffset(c17);
//   row_major float4x4 CV_PrevViewProjNearestMatr : packoffset(c21);
//   row_major float3x4 CV_ScreenToWorldBasis : packoffset(c25);
//   float4 CV_TessInfo : packoffset(c28);
//   float4 CV_CameraRightVector : packoffset(c29);
//   float4 CV_CameraFrontVector : packoffset(c30);
//   float4 CV_CameraUpVector : packoffset(c31);
//   float4 CV_ScreenSize : packoffset(c32);
//   float4 CV_HPosScale : packoffset(c33);
//   float4 CV_HPosClamp : packoffset(c34);
//   float4 CV_ProjRatio : packoffset(c35);
//   float4 CV_NearestScaled : packoffset(c36);
//   float4 CV_NearFarClipDist : packoffset(c37);
//   float4 CV_SunLightDir : packoffset(c38);
//   float4 CV_SunColor : packoffset(c39);
//   float4 CV_SkyColor : packoffset(c40);
//   float4 CV_FogColor : packoffset(c41);
//   float4 CV_TerrainInfo : packoffset(c42);
//   float4 CV_DecalZFightingRemedy : packoffset(c43);
//   row_major float4x4 CV_FrustumPlaneEquation : packoffset(c44);
//   float4 CV_WindGridOffset : packoffset(c48);
//   row_major float4x4 CV_ViewMatr : packoffset(c49);
//   row_major float4x4 CV_InvViewMatr : packoffset(c53);
//   float CV_LookingGlass_SunSelector : packoffset(c57);
//   float CV_LookingGlass_DepthScalar : packoffset(c57.y);
//   float CV_PADDING0 : packoffset(c57.z);
//   float CV_PADDING1 : packoffset(c57.w);
// }
//
// Texture2D<float4> DepthTex : register(t3);
//
//
// // 3Dmigoto declarations
// #define cmp -
// Texture1D<float4> IniParams : register(t120);
// Buffer<float4> StereoParams : register(t125);
//
//
// void main(
//   float4 v0 : SV_POSITION0,
//   out float4 o0 : SV_Target0)
// {
//   float4 r0,r1,r2;
//   uint4 bitmask, uiDest;
//   float4 fDest;
//
//   r0.xy = trunc(v0.xy);
//   r0.xy = (int2)r0.xy;
//   r0.zw = float2(0,0);
//   r0.x = DepthTex.Load(r0.xyz).x;
//   r0.y = CV_NearFarClipDist.y * r0.x;
//   r0.x = cbClipVolume.projRatioScreenScale.y / r0.x;
//   r1.z = cbClipVolume.projRatioScreenScale.x + r0.x;
//   r0.xz = StereoParams.Load(float4(0,0,0,0)).xy;
//   r0.y = r0.z / r0.y;
//   r0.y = -1 + r0.y;
//   r0.x = r0.x * r0.y;
//   r0.yz = cbClipVolume.projRatioScreenScale.zw * v0.xy;
//   r2.yz = r0.yz / cbClipVolume.screenScale.xy;
//   r2.x = r0.x * 0.5 + r2.y;
//   r1.xy = r2.xz * float2(2,-2) + float2(-1,1);
//   r1.w = 1;
//   r0.x = dot(cbClipVolume.blendPlane1.xyzw, r1.xyzw);
//   r0.y = dot(cbClipVolume.blendPlane0.xyzw, r1.xyzw);
//   r0.xy = max(float2(0,0), r0.xy);
//   r0.x = r0.y + r0.x;
//   r0.x = max(9.99999975e-06, r0.x);
//   o0.xyzw = r0.yyyy / r0.xxxx;
//   return;
// }
/////////////////////////////////////////////////////////////////////////////
