//Radial blur PS 1.
// ---- Created with 3Dmigoto v0.6.181 on Sat Dec 30 17:32:35 2023

cbuffer CommonBlock : register(b1)
{
  row_major float4x4 cTrapezoidalShadowTransformScreen : packoffset(c0);
  float cAlphaRef : packoffset(c4);
  float4 cConstantColor : packoffset(c5);
  float4 cFogParams : packoffset(c6);
  float3 cFogColor : packoffset(c7);
  float3 cView : packoffset(c8);
  float3 cLightDirection : packoffset(c9);
  float3 cAmbientLightColor : packoffset(c10);
  float3 cLightColor : packoffset(c11);
  float2 cShadowBias : packoffset(c12);
  float2 cShadowDetailDistanceRamp : packoffset(c13);
  row_major float4x4 cTrapezoidalShadowTransformTexture : packoffset(c14);
  row_major float4x4 cTrapezoidalShadowTransformTexture2 : packoffset(c18);
  float cSelfIllumScale : packoffset(c22);
  float2 cShadowMapSize : packoffset(c23);
  float4 cClipPlane0 : packoffset(c24);
}

cbuffer MiscBlock : register(b4)
{
  row_major float2x4 cTextureTransform2 : packoffset(c0);
  row_major float2x4 cTextureTransform3 : packoffset(c2);
  float3 cLightDirectionInertial : packoffset(c4);
  float3 cLight1Direction : packoffset(c5);
  float3 cLight1DirectionInertial : packoffset(c6);
  float3 cLight2Direction : packoffset(c7);
  float3 cLight2DirectionInertial : packoffset(c8);
  float3 cLight3Direction : packoffset(c9);
  float3 cLight3DirectionInertial : packoffset(c10);
  float4 cWater : packoffset(c11);
  float3 cAmbientLightColorTimesConstantColor : packoffset(c12);
  float3 cLightColorTimesConstantColor : packoffset(c13);
  float3 cOmniLightColor : packoffset(c14);
  float3 cOmniLightColorTimesConstantColor : packoffset(c15);
  float3 cLight1Color : packoffset(c16);
  float3 cLight1ColorTimesConstantColor : packoffset(c17);
  float3 cLight2Color : packoffset(c18);
  float3 cLight2ColorTimesConstantColor : packoffset(c19);
  float3 cLight3Color : packoffset(c20);
  float3 cLight3ColorTimesConstantColor : packoffset(c21);
  row_major float3x4 cObjectToLight : packoffset(c22);
  row_major float2x4 cObjectToVolume : packoffset(c25);
  float cSpecularExponent : packoffset(c27);
  float2 cClipPlanes : packoffset(c28);
  float2 cPixelSize : packoffset(c29);
  float2 cColorScale : packoffset(c30);
  float4 cDOFPlanes : packoffset(c31);
  float4 cDOFPeripheral : packoffset(c32);
  float3 cDecalTransformDir : packoffset(c33);
  float cBloomIntensity : packoffset(c34);
  float3 cContrastAndExposure : packoffset(c35);
  float cBrightPassThreshold : packoffset(c36);
  float4 cMaterialVariable0 : packoffset(c37);
  float4 cMaterialVariable1 : packoffset(c38);
  float4 cMaterialVariable2 : packoffset(c39);
  float4 cMaterialVariable3 : packoffset(c40);
  float4 cMaterialVariable4 : packoffset(c41);
  float4 cMaterialVariable5 : packoffset(c42);
  float4 cMaterialVariable6 : packoffset(c43);
  float4 cMaterialVariable7 : packoffset(c44);
  float4 cMemExportOffset : packoffset(c45);
  float4 cTextureSize : packoffset(c46);
  float4 cMetaBallConstants : packoffset(c47);
  float4 cMetaBallConstantsA : packoffset(c48);
  float4 cMetaBallConstantsB : packoffset(c49);
  float4 cMetaBallConstantsC : packoffset(c50);
  row_major float3x4 cDecalTransform : packoffset(c51);
  float4 cRadialBlurCenterStartWidth : packoffset(c54);
  row_major float4x4 cProjectionInverse : packoffset(c55);
  float4 cDebugVSVariables : packoffset(c59);
  float4 cDebugPSVariables : packoffset(c60);
  float4 cSampleOffsets[16] : packoffset(c61);
  float4 cSampleWeights[16] : packoffset(c77);
}

SamplerState tex_sampler_s : register(s0);
SamplerState maskTex_sampler_s : register(s1);
Texture2D<float4> tex : register(t0);
Texture2D<float4> maskTex : register(t1);


// 3Dmigoto declarations
#define cmp -
Texture1D<float4> IniParams : register(t120);
Texture2D<float4> StereoParams : register(t125);


void main(
  float4 v0 : SV_Position0,
  float2 v1 : TEXCOORD0,
  float4 v2 : COLOR0,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2,r3,r4,r10;
  uint4 bitmask, uiDest;
  float4 fDest;
  
  float4 stereo = StereoParams.Load(0);
  r10.xyzw = cRadialBlurCenterStartWidth.xyzw;
  r10.x+=stereo.x*0.5;
  
  r0.xy = float2(1,1) / cTextureSize.xy;
  r0.xy = r0.xy * float2(0.5,0.5) + v1.xy;
  r0.xy = -r10.xy + r0.xy;
  r0.zw = r0.xy * cRadialBlurCenterStartWidth.zz + r10.xy;
  r1.xyzw = tex.Sample(tex_sampler_s, r0.zw).xyzw;
  r2.xyzw = cRadialBlurCenterStartWidth.wwww * float4(0.0833333358,0.166666672,0.25,0.333333343) + cRadialBlurCenterStartWidth.zzzz;
  r3.xyzw = r0.xyxy * r2.xxyy + r10.xyxy;
  r2.xyzw = r0.xyxy * r2.zzww + r10.xyxy;
  r4.xyzw = tex.Sample(tex_sampler_s, r3.xy).xyzw;
  r3.xyzw = tex.Sample(tex_sampler_s, r3.zw).xyzw;
  r1.xyzw = r4.xyzw + r1.xyzw;
  r1.xyzw = r1.xyzw + r3.xyzw;
  r3.xyzw = tex.Sample(tex_sampler_s, r2.xy).xyzw;
  r2.xyzw = tex.Sample(tex_sampler_s, r2.zw).xyzw;
  r1.xyzw = r3.xyzw + r1.xyzw;
  r1.xyzw = r1.xyzw + r2.xyzw;
  r2.xyzw = cRadialBlurCenterStartWidth.wwww * float4(0.416666657,0.5,0.583333313,0.666666687) + cRadialBlurCenterStartWidth.zzzz;
  r3.xyzw = r0.xyxy * r2.xxyy + r10.xyxy;
  r2.xyzw = r0.xyxy * r2.zzww + r10.xyxy;
  r4.xyzw = tex.Sample(tex_sampler_s, r3.xy).xyzw;
  r3.xyzw = tex.Sample(tex_sampler_s, r3.zw).xyzw;
  r1.xyzw = r4.xyzw + r1.xyzw;
  r1.xyzw = r1.xyzw + r3.xyzw;
  r3.xyzw = tex.Sample(tex_sampler_s, r2.xy).xyzw;
  r2.xyzw = tex.Sample(tex_sampler_s, r2.zw).xyzw;
  r1.xyzw = r3.xyzw + r1.xyzw;
  r1.xyzw = r1.xyzw + r2.xyzw;
  r2.xyz = cRadialBlurCenterStartWidth.www * float3(0.75,0.833333313,0.916666687) + cRadialBlurCenterStartWidth.zzz;
  r3.xyzw = r0.xyxy * r2.xxyy + r10.xyxy;
  r0.xy = r0.xy * r2.zz + r10.xy;
  r0.xyzw = tex.Sample(tex_sampler_s, r0.xy).xyzw;
  r2.xyzw = tex.Sample(tex_sampler_s, r3.xy).xyzw;
  r3.xyzw = tex.Sample(tex_sampler_s, r3.zw).xyzw;
  r1.xyzw = r2.xyzw + r1.xyzw;
  r1.xyzw = r1.xyzw + r3.xyzw;
  r0.xyzw = r1.xyzw + r0.xyzw;
  r0.xyz = v2.xyz * r0.xyz;
  r0.w = cConstantColor.w * r0.w;
  o0.w = 0.0833333358 * r0.w;
  r1.xyz = tex.Sample(tex_sampler_s, v1.xy).xyz;
  r0.xyz = r0.xyz * float3(0.0833333358,0.0833333358,0.0833333358) + -r1.xyz;
  
  v1.x-=stereo.x*0.5;
  
  r0.w = maskTex.Sample(maskTex_sampler_s, v1.xy).x;
  r0.xyz = r0.www * r0.xyz + r1.xyz;
  o0.xyz = cConstantColor.xyz * r0.xyz;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v0.6.181 on Sat Dec 30 17:32:35 2023
//
//
// Buffer Definitions:
//
// cbuffer CommonBlock
// {
//
//   row_major float4x4 cTrapezoidalShadowTransformScreen;// Offset:    0 Size:    64 [unused]
//   float cAlphaRef;                   // Offset:   64 Size:     4 [unused]
//   float4 cConstantColor;             // Offset:   80 Size:    16
//   float4 cFogParams;                 // Offset:   96 Size:    16 [unused]
//   float3 cFogColor;                  // Offset:  112 Size:    12 [unused]
//   float3 cView;                      // Offset:  128 Size:    12 [unused]
//   float3 cLightDirection;            // Offset:  144 Size:    12 [unused]
//   float3 cAmbientLightColor;         // Offset:  160 Size:    12 [unused]
//   float3 cLightColor;                // Offset:  176 Size:    12 [unused]
//   float2 cShadowBias;                // Offset:  192 Size:     8 [unused]
//   float2 cShadowDetailDistanceRamp;  // Offset:  208 Size:     8 [unused]
//   row_major float4x4 cTrapezoidalShadowTransformTexture;// Offset:  224 Size:    64 [unused]
//   row_major float4x4 cTrapezoidalShadowTransformTexture2;// Offset:  288 Size:    64 [unused]
//   float cSelfIllumScale;             // Offset:  352 Size:     4 [unused]
//   float2 cShadowMapSize;             // Offset:  368 Size:     8 [unused]
//   float4 cClipPlane0;                // Offset:  384 Size:    16 [unused]
//
// }
//
// cbuffer MiscBlock
// {
//
//   row_major float2x4 cTextureTransform2;// Offset:    0 Size:    32 [unused]
//   row_major float2x4 cTextureTransform3;// Offset:   32 Size:    32 [unused]
//   float3 cLightDirectionInertial;    // Offset:   64 Size:    12 [unused]
//   float3 cLight1Direction;           // Offset:   80 Size:    12 [unused]
//   float3 cLight1DirectionInertial;   // Offset:   96 Size:    12 [unused]
//   float3 cLight2Direction;           // Offset:  112 Size:    12 [unused]
//   float3 cLight2DirectionInertial;   // Offset:  128 Size:    12 [unused]
//   float3 cLight3Direction;           // Offset:  144 Size:    12 [unused]
//   float3 cLight3DirectionInertial;   // Offset:  160 Size:    12 [unused]
//   float4 cWater;                     // Offset:  176 Size:    16 [unused]
//   float3 cAmbientLightColorTimesConstantColor;// Offset:  192 Size:    12 [unused]
//   float3 cLightColorTimesConstantColor;// Offset:  208 Size:    12 [unused]
//   float3 cOmniLightColor;            // Offset:  224 Size:    12 [unused]
//   float3 cOmniLightColorTimesConstantColor;// Offset:  240 Size:    12 [unused]
//   float3 cLight1Color;               // Offset:  256 Size:    12 [unused]
//   float3 cLight1ColorTimesConstantColor;// Offset:  272 Size:    12 [unused]
//   float3 cLight2Color;               // Offset:  288 Size:    12 [unused]
//   float3 cLight2ColorTimesConstantColor;// Offset:  304 Size:    12 [unused]
//   float3 cLight3Color;               // Offset:  320 Size:    12 [unused]
//   float3 cLight3ColorTimesConstantColor;// Offset:  336 Size:    12 [unused]
//   row_major float3x4 cObjectToLight; // Offset:  352 Size:    48 [unused]
//   row_major float2x4 cObjectToVolume;// Offset:  400 Size:    32 [unused]
//   float cSpecularExponent;           // Offset:  432 Size:     4 [unused]
//   float2 cClipPlanes;                // Offset:  448 Size:     8 [unused]
//   float2 cPixelSize;                 // Offset:  464 Size:     8 [unused]
//   float2 cColorScale;                // Offset:  480 Size:     8 [unused]
//   float4 cDOFPlanes;                 // Offset:  496 Size:    16 [unused]
//   float4 cDOFPeripheral;             // Offset:  512 Size:    16 [unused]
//   float3 cDecalTransformDir;         // Offset:  528 Size:    12 [unused]
//   float cBloomIntensity;             // Offset:  544 Size:     4 [unused]
//   float3 cContrastAndExposure;       // Offset:  560 Size:    12 [unused]
//   float cBrightPassThreshold;        // Offset:  576 Size:     4 [unused]
//   float4 cMaterialVariable0;         // Offset:  592 Size:    16 [unused]
//   float4 cMaterialVariable1;         // Offset:  608 Size:    16 [unused]
//   float4 cMaterialVariable2;         // Offset:  624 Size:    16 [unused]
//   float4 cMaterialVariable3;         // Offset:  640 Size:    16 [unused]
//   float4 cMaterialVariable4;         // Offset:  656 Size:    16 [unused]
//   float4 cMaterialVariable5;         // Offset:  672 Size:    16 [unused]
//   float4 cMaterialVariable6;         // Offset:  688 Size:    16 [unused]
//   float4 cMaterialVariable7;         // Offset:  704 Size:    16 [unused]
//   float4 cMemExportOffset;           // Offset:  720 Size:    16 [unused]
//   float4 cTextureSize;               // Offset:  736 Size:    16
//   float4 cMetaBallConstants;         // Offset:  752 Size:    16 [unused]
//   float4 cMetaBallConstantsA;        // Offset:  768 Size:    16 [unused]
//   float4 cMetaBallConstantsB;        // Offset:  784 Size:    16 [unused]
//   float4 cMetaBallConstantsC;        // Offset:  800 Size:    16 [unused]
//   row_major float3x4 cDecalTransform;// Offset:  816 Size:    48 [unused]
//   float4 cRadialBlurCenterStartWidth;// Offset:  864 Size:    16
//   row_major float4x4 cProjectionInverse;// Offset:  880 Size:    64 [unused]
//   float4 cDebugVSVariables;          // Offset:  944 Size:    16 [unused]
//   float4 cDebugPSVariables;          // Offset:  960 Size:    16 [unused]
//   float4 cSampleOffsets[16];         // Offset:  976 Size:   256 [unused]
//   float4 cSampleWeights[16];         // Offset: 1232 Size:   256 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// tex_sampler                       sampler      NA          NA    0        1
// maskTex_sampler                   sampler      NA          NA    1        1
// tex                               texture  float4          2d    0        1
// maskTex                           texture  float4          2d    1        1
// CommonBlock                       cbuffer      NA          NA    1        1
// MiscBlock                         cbuffer      NA          NA    4        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float
// TEXCOORD                 0   xy          1     NONE   float   xy
// COLOR                    0   xyzw        2     NONE   float   xyz
//
//
// 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 CB1[6], immediateIndexed
dcl_constantbuffer CB4[55], 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_input_ps linear v1.xy
dcl_input_ps linear v2.xyz
dcl_output o0.xyzw
dcl_temps 5
div r0.xy, l(1.000000, 1.000000, 1.000000, 1.000000), cb4[46].xyxx
mad r0.xy, r0.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), v1.xyxx
add r0.xy, r0.xyxx, -cb4[54].xyxx
mad r0.zw, r0.xxxy, cb4[54].zzzz, cb4[54].xxxy
sample_indexable(texture2d)(float,float,float,float) r1.xyzw, r0.zwzz, t0.xyzw, s0
mad r2.xyzw, cb4[54].wwww, l(0.0833333358, 0.166666672, 0.250000, 0.333333343), cb4[54].zzzz
mad r3.xyzw, r0.xyxy, r2.xxyy, cb4[54].xyxy
mad r2.xyzw, r0.xyxy, r2.zzww, cb4[54].xyxy
sample_indexable(texture2d)(float,float,float,float) r4.xyzw, r3.xyxx, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r3.zwzz, t0.xyzw, s0
add r1.xyzw, r1.xyzw, r4.xyzw
add r1.xyzw, r3.xyzw, r1.xyzw
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r2.xyxx, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, r2.zwzz, t0.xyzw, s0
add r1.xyzw, r1.xyzw, r3.xyzw
add r1.xyzw, r2.xyzw, r1.xyzw
mad r2.xyzw, cb4[54].wwww, l(0.416666657, 0.500000, 0.583333313, 0.666666687), cb4[54].zzzz
mad r3.xyzw, r0.xyxy, r2.xxyy, cb4[54].xyxy
mad r2.xyzw, r0.xyxy, r2.zzww, cb4[54].xyxy
sample_indexable(texture2d)(float,float,float,float) r4.xyzw, r3.xyxx, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r3.zwzz, t0.xyzw, s0
add r1.xyzw, r1.xyzw, r4.xyzw
add r1.xyzw, r3.xyzw, r1.xyzw
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r2.xyxx, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, r2.zwzz, t0.xyzw, s0
add r1.xyzw, r1.xyzw, r3.xyzw
add r1.xyzw, r2.xyzw, r1.xyzw
mad r2.xyz, cb4[54].wwww, l(0.750000, 0.833333313, 0.916666687, 0.000000), cb4[54].zzzz
mad r3.xyzw, r0.xyxy, r2.xxyy, cb4[54].xyxy
mad r0.xy, r0.xyxx, r2.zzzz, cb4[54].xyxx
sample_indexable(texture2d)(float,float,float,float) r0.xyzw, r0.xyxx, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, r3.xyxx, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r3.zwzz, t0.xyzw, s0
add r1.xyzw, r1.xyzw, r2.xyzw
add r1.xyzw, r3.xyzw, r1.xyzw
add r0.xyzw, r0.xyzw, r1.xyzw
mul r0.xyz, r0.xyzx, v2.xyzx
mul r0.w, r0.w, cb1[5].w
mul o0.w, r0.w, l(0.0833333358)
sample_indexable(texture2d)(float,float,float,float) r1.xyz, v1.xyxx, t0.xyzw, s0
mad r0.xyz, r0.xyzx, l(0.0833333358, 0.0833333358, 0.0833333358, 0.000000), -r1.xyzx
sample_indexable(texture2d)(float,float,float,float) r0.w, v1.xyxx, t1.yzwx, s1
mad r0.xyz, r0.wwww, r0.xyzx, r1.xyzx
mul o0.xyz, r0.xyzx, cb1[5].xyzx
ret
// Approximately 45 instruction slots used

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
