//Yakuza 6 chromatic aberration.
// ---- Created with 3Dmigoto v1.3.16 on Sat Apr 03 00:19:56 2021

cbuffer _Globals : register(b0)
{
  float2 fParam_DepthCastScaleOffset : packoffset(c0) = {1,0};
  float4 fParam_DepthOfFieldFactorScaleOffset : packoffset(c1) = {0.5,0.5,2,-1};
  float4 fParam_HDRFormatFactor_LOGRGB : packoffset(c2);
  float4 fParam_HDRFormatFactor_RGBALUM : packoffset(c3);
  float4 fParam_HDRFormatFactor_REINHARDRGB : packoffset(c4);
  float2 fParam_ScreenSpaceScale : packoffset(c5) = {1,-1};
  float4x4 m44_ModelViewProject : packoffset(c6);
  float4 fParam_GammaCorrection : packoffset(c10) = {0.454545468,0.454545468,0.454545468,0.454545468};
  float4 fParam_DitherOffsetScale : packoffset(c11) = {0.00392156886,0.00392156886,-0.00392156886,0};
  float4 fParam_TonemapMaxMappingLuminance : packoffset(c12) = {1,1,1.015625,1};
  float4 fParam_BrightPass_LensDistortion : packoffset(c13);
  float4 afRGBA_Modulate[32] : packoffset(c14);
  float4 afRGBA_Offset[16] : packoffset(c46);
  float4 afUV_TexCoordOffsetV16[16] : packoffset(c62);
  float4x4 m44_ColorTransformMatrix : packoffset(c78);
  float4x4 m44_PreTonemapColorTransformMatrix : packoffset(c82);
  float4x4 m44_PreTonemapGlareColorTransformMatrix : packoffset(c86);
  float4 fParam_VignetteSimulate : packoffset(c90);
  float4 fParam_VignettePowerOfCosine : packoffset(c91);
  float4 afUVWQ_TexCoordScaleOffset[4] : packoffset(c92);
  float4 fParam_PerspectiveFactor : packoffset(c96);
  float fParam_FocusDistance : packoffset(c97);
  float4 fParam_DepthOfFieldConvertDepthFactor : packoffset(c98);
  float2 afXY_DepthOfFieldLevelBlendFactor16[16] : packoffset(c99);
  float fParam_DepthOfFieldLayerMaskThreshold : packoffset(c114.z) = {0.25};
  float fParam_DepthOfFieldFactorThreshold : packoffset(c114.w) = {0.00039999999};
  float4 afParam_TexCoordScaler8[8] : packoffset(c115);
  float4 fRGBA_Constant : packoffset(c123);
  float4 afRGBA_Constant[4] : packoffset(c124);
  float4x4 am44_TransformMatrix[8] : packoffset(c128);
  float4 afUV_TexCoordOffsetP32[96] : packoffset(c160);
}

SamplerState asamp2D_Texture_s : register(s0);
Texture2D<float4> atex2D_Texture : register(t0);


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


void main(
  float4 v0 : TEXCOORD0,
  float4 v1 : TEXCOORD1,
  float4 v2 : TEXCOORD2,
  float4 v3 : TEXCOORD3,
  float4 v4 : TEXCOORD4,
  float4 v5 : TEXCOORD5,
  float2 v6 : TEXCOORD6,
  out float4 o0 : SV_TARGET0)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;
  
  float4 stereo = StereoParams.Load(0);
  
  r0.xyzw = atex2D_Texture.SampleLevel(asamp2D_Texture_s, v1.xy, 0).xyzw;
  r0.xyzw = afRGBA_Modulate[1].xyzw * r0.xyzw;
  r1.xyzw = atex2D_Texture.SampleLevel(asamp2D_Texture_s, v0.xy, 0).xyzw;
  r0.xyzw = r1.xyzw * afRGBA_Modulate[0].xyzw + r0.xyzw;
  r1.xyzw = atex2D_Texture.SampleLevel(asamp2D_Texture_s, v2.xy, 0).xyzw;
  r0.xyzw = r1.xyzw * afRGBA_Modulate[2].xyzw + r0.xyzw;
  r1.xyzw = atex2D_Texture.SampleLevel(asamp2D_Texture_s, v3.xy, 0).xyzw;
  r0.xyzw = r1.xyzw * afRGBA_Modulate[3].xyzw + r0.xyzw;
  r1.xyzw = atex2D_Texture.SampleLevel(asamp2D_Texture_s, v4.xy, 0).xyzw;
  r0.xyzw = r1.xyzw * afRGBA_Modulate[4].xyzw + r0.xyzw;
  r1.xyzw = atex2D_Texture.SampleLevel(asamp2D_Texture_s, v5.xy, 0).xyzw;
  r0.xyzw = r1.xyzw * afRGBA_Modulate[5].xyzw + r0.xyzw;
  r1.xyzw = atex2D_Texture.SampleLevel(asamp2D_Texture_s, v6.xy, 0).xyzw;
  o0.xyzw = r1.xyzw * afRGBA_Modulate[6].xyzw + r0.xyzw;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.3.16 on Sat Apr 03 00:19:56 2021
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
//   float2 fParam_DepthCastScaleOffset;// Offset:    0 Size:     8 [unused]
//      = 0x3f800000 0x00000000
//   float4 fParam_DepthOfFieldFactorScaleOffset;// Offset:   16 Size:    16 [unused]
//      = 0x3f000000 0x3f000000 0x40000000 0xbf800000
//   float4 fParam_HDRFormatFactor_LOGRGB;// Offset:   32 Size:    16 [unused]
//   float4 fParam_HDRFormatFactor_RGBALUM;// Offset:   48 Size:    16 [unused]
//   float4 fParam_HDRFormatFactor_REINHARDRGB;// Offset:   64 Size:    16 [unused]
//   float2 fParam_ScreenSpaceScale;    // Offset:   80 Size:     8 [unused]
//      = 0x3f800000 0xbf800000
//   float4x4 m44_ModelViewProject;     // Offset:   96 Size:    64 [unused]
//   float4 fParam_GammaCorrection;     // Offset:  160 Size:    16 [unused]
//      = 0x3ee8ba2f 0x3ee8ba2f 0x3ee8ba2f 0x3ee8ba2f
//   float4 fParam_DitherOffsetScale;   // Offset:  176 Size:    16 [unused]
//      = 0x3b808081 0x3b808081 0xbb808081 0x00000000
//   float4 fParam_TonemapMaxMappingLuminance;// Offset:  192 Size:    16 [unused]
//      = 0x3f800000 0x3f800000 0x3f820000 0x3f800000
//   float4 fParam_BrightPass_LensDistortion;// Offset:  208 Size:    16 [unused]
//   float4 afRGBA_Modulate[32];        // Offset:  224 Size:   512
//   float4 afRGBA_Offset[16];          // Offset:  736 Size:   256 [unused]
//   float4 afUV_TexCoordOffsetV16[16]; // Offset:  992 Size:   256 [unused]
//   float4x4 m44_ColorTransformMatrix; // Offset: 1248 Size:    64 [unused]
//   float4x4 m44_PreTonemapColorTransformMatrix;// Offset: 1312 Size:    64 [unused]
//   float4x4 m44_PreTonemapGlareColorTransformMatrix;// Offset: 1376 Size:    64 [unused]
//   float4 fParam_VignetteSimulate;    // Offset: 1440 Size:    16 [unused]
//   float4 fParam_VignettePowerOfCosine;// Offset: 1456 Size:    16 [unused]
//   float4 afUVWQ_TexCoordScaleOffset[4];// Offset: 1472 Size:    64 [unused]
//   float4 fParam_PerspectiveFactor;   // Offset: 1536 Size:    16 [unused]
//   float fParam_FocusDistance;        // Offset: 1552 Size:     4 [unused]
//   float4 fParam_DepthOfFieldConvertDepthFactor;// Offset: 1568 Size:    16 [unused]
//   float2 afXY_DepthOfFieldLevelBlendFactor16[16];// Offset: 1584 Size:   248 [unused]
//   float fParam_DepthOfFieldLayerMaskThreshold;// Offset: 1832 Size:     4 [unused]
//      = 0x3e800000
//   float fParam_DepthOfFieldFactorThreshold;// Offset: 1836 Size:     4 [unused]
//      = 0x39d1b717
//   float4 afParam_TexCoordScaler8[8]; // Offset: 1840 Size:   128 [unused]
//   float4 fRGBA_Constant;             // Offset: 1968 Size:    16 [unused]
//   float4 afRGBA_Constant[4];         // Offset: 1984 Size:    64 [unused]
//   float4x4 am44_TransformMatrix[8];  // Offset: 2048 Size:   512 [unused]
//   float4 afUV_TexCoordOffsetP32[96]; // Offset: 2560 Size:  1536 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// asamp2D_Texture                   sampler      NA          NA    0        1
// atex2D_Texture                    texture  float4          2d    0        1
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 0   xy          0     NONE   float   xy
// TEXCOORD                 1   xy          1     NONE   float   xy
// TEXCOORD                 2   xy          2     NONE   float   xy
// TEXCOORD                 3   xy          3     NONE   float   xy
// TEXCOORD                 4   xy          4     NONE   float   xy
// TEXCOORD                 5   xy          5     NONE   float   xy
// TEXCOORD                 6   xy          6     NONE   float   xy
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET                0   xyzw        0   TARGET   float   xyzw
//
ps_4_0
dcl_constantbuffer cb0[21], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v0.xy
dcl_input_ps linear v1.xy
dcl_input_ps linear v2.xy
dcl_input_ps linear v3.xy
dcl_input_ps linear v4.xy
dcl_input_ps linear v5.xy
dcl_input_ps linear v6.xy
dcl_output o0.xyzw
dcl_temps 2
sample_l r0.xyzw, v1.xyxx, t0.xyzw, s0, l(0.000000)
mul r0.xyzw, r0.xyzw, cb0[15].xyzw
sample_l r1.xyzw, v0.xyxx, t0.xyzw, s0, l(0.000000)
mad r0.xyzw, r1.xyzw, cb0[14].xyzw, r0.xyzw
sample_l r1.xyzw, v2.xyxx, t0.xyzw, s0, l(0.000000)
mad r0.xyzw, r1.xyzw, cb0[16].xyzw, r0.xyzw
sample_l r1.xyzw, v3.xyxx, t0.xyzw, s0, l(0.000000)
mad r0.xyzw, r1.xyzw, cb0[17].xyzw, r0.xyzw
sample_l r1.xyzw, v4.xyxx, t0.xyzw, s0, l(0.000000)
mad r0.xyzw, r1.xyzw, cb0[18].xyzw, r0.xyzw
sample_l r1.xyzw, v5.xyxx, t0.xyzw, s0, l(0.000000)
mad r0.xyzw, r1.xyzw, cb0[19].xyzw, r0.xyzw
sample_l r1.xyzw, v6.xyxx, t0.xyzw, s0, l(0.000000)
mad o0.xyzw, r1.xyzw, cb0[20].xyzw, r0.xyzw
ret
// Approximately 15 instruction slots used

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