//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.17672
//
//   using 3Dmigoto v1.2.27 on Mon Feb 08 02:32:01 2016
//
//
// Buffer Definitions: 
//
// cbuffer SceneBuffer
// {
//
//   row_major float4x4 View;           // Offset:    0 Size:    64 [unused]
//   row_major float4x4 ScreenMatrix;   // Offset:   64 Size:    64 [unused]
//   float2 DepthExportScale;           // Offset:  128 Size:     8 [unused]
//   float2 __padding0;                 // Offset:  136 Size:     8 [unused]
//   float4 FogParams;                  // Offset:  144 Size:    16 [unused]
//   float3 __CameraPosition;           // Offset:  160 Size:    12 [unused]
//   float __padding12;                 // Offset:  172 Size:     4 [unused]
//   float3 CameraDirection;            // Offset:  176 Size:    12 [unused]
//   float __padding9;                  // Offset:  188 Size:     4 [unused]
//   float3 DepthFactors;               // Offset:  192 Size:    12 [unused]
//   float __padding10;                 // Offset:  204 Size:     4 [unused]
//   float3 ShadowDepthBiasAndLightType;// Offset:  208 Size:    12 [unused]
//   float __padding11;                 // Offset:  220 Size:     4 [unused]
//   float4 SubframeViewport;           // Offset:  224 Size:    16 [unused]
//   row_major float3x4 DepthToWorld;   // Offset:  240 Size:    48 [unused]
//   float4 DepthToView;                // Offset:  288 Size:    16 [unused]
//   float4 OneOverDepthToView;         // Offset:  304 Size:    16 [unused]
//   float4 DepthToW;                   // Offset:  320 Size:    16 [unused]
//   float4 ClipPlane;                  // Offset:  336 Size:    16 [unused]
//   float2 ViewportDepthScaleOffset;   // Offset:  352 Size:     8 [unused]
//   float2 __padding1;                 // Offset:  360 Size:     8 [unused]
//   float2 ColorDOFDepthScaleOffset;   // Offset:  368 Size:     8 [unused]
//   float2 __padding2;                 // Offset:  376 Size:     8 [unused]
//   float4 TimeVector;                 // Offset:  384 Size:    16 [unused]
//   float4 FogParams2;                 // Offset:  400 Size:    16 [unused]
//   float4 FogParams3;                 // Offset:  416 Size:    16 [unused]
//   float3 GlobalAmbient;              // Offset:  432 Size:    12
//   float __padding8;                  // Offset:  444 Size:     4 [unused]
//   float4 GlobalParams[16];           // Offset:  448 Size:   256
//   float4 ViewToFogH;                 // Offset:  704 Size:    16 [unused]
//   float4 ScreenExtents;              // Offset:  720 Size:    16
//   float2 ScreenResolution;           // Offset:  736 Size:     8 [unused]
//   float2 __padding3;                 // Offset:  744 Size:     8 [unused]
//   float4 PSSMToMap1Lin;              // Offset:  752 Size:    16 [unused]
//   float4 PSSMToMap1Const;            // Offset:  768 Size:    16 [unused]
//   float4 PSSMToMap2Lin;              // Offset:  784 Size:    16 [unused]
//   float4 PSSMToMap2Const;            // Offset:  800 Size:    16 [unused]
//   float4 PSSMToMap3Lin;              // Offset:  816 Size:    16 [unused]
//   float4 PSSMToMap3Const;            // Offset:  832 Size:    16 [unused]
//   float4 PSSMDistances;              // Offset:  848 Size:    16 [unused]
//   row_major float4x4 WorldToPSSM0;   // Offset:  864 Size:    64 [unused]
//   row_major float4x4 PrevViewProject;// Offset:  928 Size:    64 [unused]
//   row_major float4x4 PrevWorld;      // Offset:  992 Size:    64 [unused]
//   row_major float4x4 ViewT;          // Offset: 1056 Size:    64 [unused]
//   float4 PSSMExtents;                // Offset: 1120 Size:    16 [unused]
//   float4 ShadowAtlasResolution;      // Offset: 1136 Size:    16 [unused]
//   float4 UnitRimData[3];             // Offset: 1152 Size:    48 [unused]
//   float3 __CameraPositionForCorrection;// Offset: 1200 Size:    12 [unused]
//   float __padding7;                  // Offset: 1212 Size:     4 [unused]
//   row_major float4x4 CameraViewProject;// Offset: 1216 Size:    64 [unused]
//   float4 BackBufferResolution;       // Offset: 1280 Size:    16 [unused]
//   row_major float4x4 InverseProjection;// Offset: 1296 Size:    64 [unused]
//   float4 StereoOffset;               // Offset: 1360 Size:    16 [unused]
//   row_major float4x4 Projection;     // Offset: 1376 Size:    64 [unused]
//   row_major float4x4 ViewInv;        // Offset: 1440 Size:    64 [unused]
//   float4 ColorSSAO;                  // Offset: 1504 Size:    16 [unused]
//   float4 GlobalFogColor;             // Offset: 1520 Size:    16 [unused]
//   float4 VolumetricLightGlobalParams;// Offset: 1536 Size:    16 [unused]
//   float4 SnowParams01;               // Offset: 1552 Size:    16 [unused]
//   float4 SnowParams02;               // Offset: 1568 Size:    16 [unused]
//   float4 SnowParams03;               // Offset: 1584 Size:    16 [unused]
//   int SSREnabled;                    // Offset: 1600 Size:     4 [unused]
//   int __padding4;                    // Offset: 1604 Size:     4 [unused]
//   int __padding5;                    // Offset: 1608 Size:     4 [unused]
//   int __padding6;                    // Offset: 1612 Size:     4 [unused]
//
// }
//
// cbuffer MaterialBuffer
// {
//
//   float4 MaterialParams[512];        // Offset:    0 Size:  8192
//
// }
//
// cbuffer IrradianceBuffer
// {
//
//   float4 IrradianceStateRed0;        // Offset:    0 Size:    16
//   float4 IrradianceStateRed1;        // Offset:   16 Size:    16
//   float4 IrradianceStateGreen0;      // Offset:   32 Size:    16
//   float4 IrradianceStateGreen1;      // Offset:   48 Size:    16
//   float4 IrradianceStateBlue0;       // Offset:   64 Size:    16
//   float4 IrradianceStateBlue1;       // Offset:   80 Size:    16
//   float4 IrradianceStateBase;        // Offset:   96 Size:    16
//   float4 IrradianceConstantData;     // Offset:  112 Size:    16 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// SamplerGenericPointClamp          sampler      NA          NA   10        1
// SamplerGenericTrilinearWrap       sampler      NA          NA   11        1
// p_default_Material_n138_n184_661830C016465534_cp0_Param_texture    texture  float4          2d    0        1
// p_default_Setup_n33_n125_NormalBufferTexture_texture    texture  float4          2d    1        1
// p_default_Material_n139_n161_19B9FD0C15847118_Param_texture    texture  float4          2d    2        1
// p_default_Material_n139_n160_661830C016465534_cp0_Param_texture    texture  float4          2d    4        1
// p_default_Setup_n0_n80_Texture_texture    texture  float4          2d    5        1
// SceneBuffer                       cbuffer      NA          NA    2        1
// MaterialBuffer                    cbuffer      NA          NA    3        1
// IrradianceBuffer                  cbuffer      NA          NA    6        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xy  
// TEXCOORD                 0   xyzw        1     NONE   float   xy  
// PSIZE                    0   x           2     NONE    uint       
// SV_IsFrontFace           0   x           3    FFACE    uint       
//
//
// 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 cb2[46], immediateIndexed
dcl_constantbuffer cb3[3], immediateIndexed
dcl_constantbuffer cb6[7], immediateIndexed
dcl_sampler s10, mode_default
dcl_sampler s11, 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) t4
dcl_resource_texture2d (float,float,float,float) t5
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 4
mad r0.xy, v0.xyxx, cb2[45].zwzz, cb2[45].xyxx
sample_indexable(texture2d)(float,float,float,float) r1.xyz, r0.xyxx, t1.xyzw, s10
sample_indexable(texture2d)(float,float,float,float) r0.xyz, r0.xyxx, t2.xyzw, s11
mul r2.xyz, r1.yyyy, cb2[40].xyzx
mad r1.xyw, r1.xxxx, cb2[39].xyxz, r2.xyxz
mad r1.xyz, r1.zzzz, cb2[41].xyzx, r1.xywx
mul r0.w, r1.y, r1.y
mad r1.w, r1.x, r1.x, -r0.w
dp4 r2.x, r1.xyzw, cb6[1].xyzw
dp4 r2.y, r1.xyzw, cb6[3].xyzw
dp4 r2.z, r1.xyzw, cb6[5].xyzw
mul r3.xyzw, r1.yzzz, r1.xxyz
mad r0.w, r1.z, l(0.500000), l(0.500000)
dp4 r1.x, r3.xyzw, cb6[0].xyzw
dp4 r1.y, r3.xyzw, cb6[2].xyzw
dp4 r1.z, r3.xyzw, cb6[4].xyzw
add r1.xyz, r2.xyzx, r1.xyzx
add r1.xyz, r1.xyzx, cb6[6].xyzx
max r1.xyz, r1.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
add r2.xyz, cb2[27].xyzx, -cb2[38].xyzx
mad r2.xyz, r0.wwww, r2.xyzx, cb2[38].xyzx
add r1.xyz, r1.xyzx, r2.xyzx
add r0.xyz, r0.xyzx, r1.xyzx
ftoi r2.xy, v0.xyxx
mov r2.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r0.w, r2.xyww, t4.yzwx
ld_indexable(texture2d)(float,float,float,float) r1.w, r2.xyzw, t0.yzwx
mad r0.xyz, r0.wwww, r0.xyzx, r1.xyzx
mul r0.xyz, r0.xyzx, r1.wwww
mad r1.xy, v1.xyxx, cb3[1].xyxx, cb3[1].zwzz
sample_indexable(texture2d)(float,float,float,float) r1.xyzw, r1.xyxx, t5.xyzw, s11
mul r1.xyz, r1.xyzx, cb3[0].xyzx
mad_sat o0.w, r1.w, cb3[0].w, cb3[2].x
mul r0.xyz, r0.xyzx, r1.xyzx
mul o0.xyz, r0.xyzx, cb2[29].wwww
ret 
// Approximately 36 instruction slots used
