//DMC5 HUD 5.
// ---- Created with 3Dmigoto v1.3.15 on Sat Mar 09 18:07:35 2019

cbuffer GUIConstant : register(b0)
{
  row_major float4x4 guiViewMatrix : packoffset(c0);
  row_major float4x4 guiProjMatrix : packoffset(c4);
  row_major float4x4 guiWorldMat : packoffset(c8);
  float guiIntensity : packoffset(c12);
  float guiSaturation : packoffset(c12.y);
  float guiSoftParticleDist : packoffset(c12.z);
  float guiFilterParam : packoffset(c12.w);
  float guiFilterMipLevel : packoffset(c13);
  float guiAlphaBlendRate : packoffset(c13.y);
  float guiStencilScale : packoffset(c13.z);
  float guiConstantPadding0 : packoffset(c13.w);
}

cbuffer DriverStereoParams : register(b12)
{
    float driver_neg_sep_conv;
    float driver_sep;
}

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


void main(
  float3 v0 : POSITION0,
  float4 v1 : COLOR0,
  float2 v2 : TEXCOORD0,
  out float4 o0 : SV_Position0,
  out float4 o1 : Color0,
  out float2 o2 : TexCoord0,
  out float2 p2 : TexCoord1)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;

  float4 stereo = StereoParams.Load(0);
  float4 iniparams = IniParams.Load(0);
  float4 iniparams1 = IniParams.Load(int2(1,0));
  float4 iniparams3 = IniParams.Load(int2(3,0));
  
  r0.xyzw = guiWorldMat._m10_m11_m12_m13 * v0.yyyy;
  r0.xyzw = v0.xxxx * guiWorldMat._m00_m01_m02_m03 + r0.xyzw;
  r0.xyzw = v0.zzzz * guiWorldMat._m20_m21_m22_m23 + r0.xyzw;
  r0.xyzw = guiWorldMat._m30_m31_m32_m33 + r0.xyzw;
  r1.xyzw = guiViewMatrix._m10_m11_m12_m13 * r0.yyyy;
  r1.xyzw = r0.xxxx * guiViewMatrix._m00_m01_m02_m03 + r1.xyzw;
  r1.xyzw = r0.zzzz * guiViewMatrix._m20_m21_m22_m23 + r1.xyzw;
  r0.xyzw = r0.wwww * guiViewMatrix._m30_m31_m32_m33 + r1.xyzw;
  r1.xyzw = guiProjMatrix._m10_m11_m12_m13 * r0.yyyy;
  r1.xyzw = r0.xxxx * guiProjMatrix._m00_m01_m02_m03 + r1.xyzw;
  r1.xyzw = r0.zzzz * guiProjMatrix._m20_m21_m22_m23 + r1.xyzw;
  r0.xyzw = r0.wwww * guiProjMatrix._m30_m31_m32_m33 + r1.xyzw;
  o0.xyzw = r0.xyzw;
  r0.xy = float2(1,1) + r0.xy;
  r0.xy = float2(0.5,0.5) * r0.xy;
  p2.xy = r0.xy * float2(1,-1) + float2(0,1);
  o1.xyzw = v1.xyzw;
  o2.xy = v2.xy;
  if (driver_sep)
  {
	o0.x += driver_sep * o0.w + driver_neg_sep_conv;
  }
  else
  {
	//o0.x+=stereo.x*(o0.w-stereo.y);
  }
  o0.x=o0.x*iniparams.y;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v1.3.15 on Sat Mar 09 18:07:35 2019
//
//
// Buffer Definitions:
//
// cbuffer GUIConstant
// {
//
//   row_major float4x4 guiViewMatrix;  // Offset:    0 Size:    64
//   row_major float4x4 guiProjMatrix;  // Offset:   64 Size:    64
//   row_major float4x4 guiWorldMat;    // Offset:  128 Size:    64
//   float guiIntensity;                // Offset:  192 Size:     4 [unused]
//   float guiSaturation;               // Offset:  196 Size:     4 [unused]
//   float guiSoftParticleDist;         // Offset:  200 Size:     4 [unused]
//   float guiFilterParam;              // Offset:  204 Size:     4 [unused]
//   float guiFilterMipLevel;           // Offset:  208 Size:     4 [unused]
//   float guiAlphaBlendRate;           // Offset:  212 Size:     4 [unused]
//   float guiStencilScale;             // Offset:  216 Size:     4 [unused]
//   float guiConstantPadding0;         // Offset:  220 Size:     4 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// GUIConstant                       cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyz         0     NONE   float   xyz
// COLOR                    0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 0   xy          2     NONE   float   xy
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// Color                    0   xyzw        1     NONE   float   xyzw
// TexCoord                 0   xy          2     NONE   float   xy
// TexCoord                 1     zw        2     NONE   float     zw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[12], immediateIndexed
dcl_input v0.xyz
dcl_input v1.xyzw
dcl_input v2.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xy
dcl_output o2.zw
dcl_temps 2
mul r0.xyzw, v0.yyyy, cb0[9].xyzw
mad r0.xyzw, v0.xxxx, cb0[8].xyzw, r0.xyzw
mad r0.xyzw, v0.zzzz, cb0[10].xyzw, r0.xyzw
add r0.xyzw, r0.xyzw, cb0[11].xyzw
mul r1.xyzw, r0.yyyy, cb0[1].xyzw
mad r1.xyzw, r0.xxxx, cb0[0].xyzw, r1.xyzw
mad r1.xyzw, r0.zzzz, cb0[2].xyzw, r1.xyzw
mad r0.xyzw, r0.wwww, cb0[3].xyzw, r1.xyzw
mul r1.xyzw, r0.yyyy, cb0[5].xyzw
mad r1.xyzw, r0.xxxx, cb0[4].xyzw, r1.xyzw
mad r1.xyzw, r0.zzzz, cb0[6].xyzw, r1.xyzw
mad r0.xyzw, r0.wwww, cb0[7].xyzw, r1.xyzw
mov o0.xyzw, r0.xyzw
add r0.xy, r0.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)
mul r0.xy, r0.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
mad o2.zw, r0.xxxy, l(0.000000, 0.000000, 1.000000, -1.000000), l(0.000000, 0.000000, 0.000000, 1.000000)
mov o1.xyzw, v1.xyzw
mov o2.xy, v2.xyxx
ret
// Approximately 19 instruction slots used

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