//DMC1 radial blur (pause).
// ---- Created with 3Dmigoto v1.3.16 on Sat May 21 13:32:08 2022

cbuffer PS_CONSTANT_BUFFER : register(b0)
{
  float4 RadialBlurParams : packoffset(c0);
}

SamplerState sampler_TexMain_s : register(s0);
Texture2D<float4> TexMain : register(t0);


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


void main(
  float4 v0 : SV_POSITION0,
  float2 v1 : TEXCOORD0,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12;
  uint4 bitmask, uiDest;
  float4 fDest;
  
  float4 stereo = StereoParams.Load(0);
  
  r0.xy = float2(-0.5,-0.5) + v1.xy;
  
  r0.x+=stereo.x*-0.5;
  
  r0.z = dot(r0.xy, r0.xy);
  r0.w = sqrt(r0.z);
  r1.x = cmp(0 >= r0.w);
  r0.z = rsqrt(r0.z);
  r0.xy = r0.xy * r0.zz;
  r0.xy = r0.xy * r0.ww;
  r0.zw = -RadialBlurParams.xx * r0.xy;
  r1.yz = saturate(v1.xy);
  r2.xyzw = TexMain.Sample(sampler_TexMain_s, r1.yz).xyzw;
  r0.xy = saturate(r0.xy * -RadialBlurParams.xx + v1.xy);
  r3.xyzw = TexMain.Sample(sampler_TexMain_s, r0.xy).xyzw;
  r0.xy = saturate(r0.zw * float2(2,2) + v1.xy);
  r4.xyzw = TexMain.Sample(sampler_TexMain_s, r0.xy).xyzw;
  r5.xyzw = saturate(r0.zwzw * float4(3,3,4,4) + v1.xyxy);
  r6.xyzw = TexMain.Sample(sampler_TexMain_s, r5.xy).xyzw;
  r5.xyzw = TexMain.Sample(sampler_TexMain_s, r5.zw).xyzw;
  r7.xyzw = saturate(r0.zwzw * float4(5,5,6,6) + v1.xyxy);
  r8.xyzw = TexMain.Sample(sampler_TexMain_s, r7.xy).xyzw;
  r7.xyzw = TexMain.Sample(sampler_TexMain_s, r7.zw).xyzw;
  r9.xyzw = saturate(r0.zwzw * float4(7,7,8,8) + v1.xyxy);
  r10.xyzw = TexMain.Sample(sampler_TexMain_s, r9.xy).xyzw;
  r9.xyzw = TexMain.Sample(sampler_TexMain_s, r9.zw).xyzw;
  r11.xyzw = saturate(r0.zwzw * float4(9,9,10,10) + v1.xyxy);
  r12.xyzw = TexMain.Sample(sampler_TexMain_s, r11.xy).xyzw;
  r11.xyzw = TexMain.Sample(sampler_TexMain_s, r11.zw).xyzw;
  r0.xy = saturate(r0.zw * float2(11,11) + v1.xy);
  r0.xyzw = TexMain.Sample(sampler_TexMain_s, r0.xy).xyzw;
  if (r1.x != 0) {
    r1.xyzw = TexMain.Sample(sampler_TexMain_s, v1.xy).xyzw;
  } else {
    r2.xyzw = r3.xyzw + r2.xyzw;
    r2.xyzw = r2.xyzw + r4.xyzw;
    r2.xyzw = r2.xyzw + r6.xyzw;
    r2.xyzw = r2.xyzw + r5.xyzw;
    r2.xyzw = r2.xyzw + r8.xyzw;
    r2.xyzw = r2.xyzw + r7.xyzw;
    r2.xyzw = r2.xyzw + r10.xyzw;
    r2.xyzw = r2.xyzw + r9.xyzw;
    r2.xyzw = r2.xyzw + r12.xyzw;
    r2.xyzw = r2.xyzw + r11.xyzw;
    r0.xyzw = r2.xyzw + r0.xyzw;
    r1.xyzw = float4(0.0833333358,0.0833333358,0.0833333358,0.0833333358) * r0.xyzw;
  }
  r0.xw = float2(1.39999998,1);
  r0.y = RadialBlurParams.z;
  r2.xyzw = TexMain.Sample(sampler_TexMain_s, v1.xy).xyzw;
  r0.xyzw = r1.xyzw * r0.xyyw + -r2.xyzw;
  o0.xyzw = RadialBlurParams.yyyy * r0.xyzw + r2.xyzw;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.16 on Sat May 21 13:32:08 2022
//
//
// Buffer Definitions:
//
// cbuffer PS_CONSTANT_BUFFER
// {
//
//   float4 RadialBlurParams;           // Offset:    0 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// sampler_TexMain                   sampler      NA          NA    0        1
// TexMain                           texture  float4          2d    0        1
// PS_CONSTANT_BUFFER                cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float
// TEXCOORD                 0   xy          1     NONE   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[1], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 13
add r0.xy, v1.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000)
dp2 r0.z, r0.xyxx, r0.xyxx
sqrt r0.w, r0.z
ge r1.x, l(0.000000), r0.w
rsq r0.z, r0.z
mul r0.xy, r0.zzzz, r0.xyxx
mul r0.xy, r0.wwww, r0.xyxx
mul r0.zw, r0.xxxy, -cb0[0].xxxx
mov_sat r1.yz, v1.xxyx
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, r1.yzyy, t0.xyzw, s0
mad_sat r0.xy, r0.xyxx, -cb0[0].xxxx, v1.xyxx
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r0.xyxx, t0.xyzw, s0
mad_sat r0.xy, r0.zwzz, l(2.000000, 2.000000, 0.000000, 0.000000), v1.xyxx
sample_indexable(texture2d)(float,float,float,float) r4.xyzw, r0.xyxx, t0.xyzw, s0
mad_sat r5.xyzw, r0.zwzw, l(3.000000, 3.000000, 4.000000, 4.000000), v1.xyxy
sample_indexable(texture2d)(float,float,float,float) r6.xyzw, r5.xyxx, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r5.xyzw, r5.zwzz, t0.xyzw, s0
mad_sat r7.xyzw, r0.zwzw, l(5.000000, 5.000000, 6.000000, 6.000000), v1.xyxy
sample_indexable(texture2d)(float,float,float,float) r8.xyzw, r7.xyxx, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r7.xyzw, r7.zwzz, t0.xyzw, s0
mad_sat r9.xyzw, r0.zwzw, l(7.000000, 7.000000, 8.000000, 8.000000), v1.xyxy
sample_indexable(texture2d)(float,float,float,float) r10.xyzw, r9.xyxx, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r9.xyzw, r9.zwzz, t0.xyzw, s0
mad_sat r11.xyzw, r0.zwzw, l(9.000000, 9.000000, 10.000000, 10.000000), v1.xyxy
sample_indexable(texture2d)(float,float,float,float) r12.xyzw, r11.xyxx, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r11.xyzw, r11.zwzz, t0.xyzw, s0
mad_sat r0.xy, r0.zwzz, l(11.000000, 11.000000, 0.000000, 0.000000), v1.xyxx
sample_indexable(texture2d)(float,float,float,float) r0.xyzw, r0.xyxx, t0.xyzw, s0
if_nz r1.x
  sample_indexable(texture2d)(float,float,float,float) r1.xyzw, v1.xyxx, t0.xyzw, s0
else
  add r2.xyzw, r2.xyzw, r3.xyzw
  add r2.xyzw, r4.xyzw, r2.xyzw
  add r2.xyzw, r6.xyzw, r2.xyzw
  add r2.xyzw, r5.xyzw, r2.xyzw
  add r2.xyzw, r8.xyzw, r2.xyzw
  add r2.xyzw, r7.xyzw, r2.xyzw
  add r2.xyzw, r10.xyzw, r2.xyzw
  add r2.xyzw, r9.xyzw, r2.xyzw
  add r2.xyzw, r12.xyzw, r2.xyzw
  add r2.xyzw, r11.xyzw, r2.xyzw
  add r0.xyzw, r0.xyzw, r2.xyzw
  mul r1.xyzw, r0.xyzw, l(0.0833333358, 0.0833333358, 0.0833333358, 0.0833333358)
endif
mov r0.xw, l(1.400000,0,0,1.000000)
mov r0.y, cb0[0].z
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, v1.xyxx, t0.xyzw, s0
mad r0.xyzw, r1.xyzw, r0.xyyw, -r2.xyzw
mad o0.xyzw, cb0[0].yyyy, r0.xyzw, r2.xyzw
ret
// Approximately 50 instruction slots used

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