// ---- Created with 3Dmigoto v1.2.35 on Tue Apr 26 22:30:59 2016

cbuffer fcbFluidParam : register(b0)
{
  float m_fTextureHeight : packoffset(c0);
  float m_fTextureWidth : packoffset(c0.y);
  float m_fTextureDepth : packoffset(c0.z);
  int m_fTextureNumber : packoffset(c0.w);
  float4 m_fObstVelocity : packoffset(c1);
  float m_fModulate : packoffset(c2);
  float m_fSize : packoffset(c2.y);
  float m_Dummy00 : packoffset(c2.z);
  float m_Dummy01 : packoffset(c2.w);
  float3 m_fCenter : packoffset(c3);
  float m_Dummy10 : packoffset(c3.w);
  float4 m_fSplatColor : packoffset(c4);
  float m_fEpsilon : packoffset(c5);
  float m_fTimestep : packoffset(c5.y);
  float m_fForward : packoffset(c5.z);
  float m_Dummy20 : packoffset(c5.w);
  float3 m_fHalfVolumeDim : packoffset(c6);
  float m_Dummy30 : packoffset(c6.w);
  float3 m_fBoxLBDcorner : packoffset(c7);
  float m_Dummy40 : packoffset(c7.w);
  float3 m_fBoxRTUcorner : packoffset(c8);
  float m_Dummy50 : packoffset(c8.w);
  int4 m_SlideDirection : packoffset(c9);
}

SamplerState g_samPointClamp_s : register(s7);
SamplerState g_samLinearClamp_s : register(s9);
Texture3D<float4> g_Texture_velocity0 : register(t0);


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


void main( 
  float4 v0 : SV_Position0,
  float4 v1 : TEXCOORD0,
  float4 v2 : TEXCOORD1,
  float2 v3 : TEXCOORD2,
  float2 w3 : TEXCOORD3,
  float2 v4 : TEXCOORD4,
  uint v5 : SV_RenderTargetArrayIndex0,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.x = m_fTimestep * m_fForward;
  r0.yzw = g_Texture_velocity0.SampleLevel(g_samPointClamp_s, v2.xyz, 0).xyz;
  r0.xyz = -r0.xxx * r0.yzw + v1.xyz;
  r0.z = 0.5 + r0.z;
  r1.xyz = r0.xyz / m_fTextureWidth;
  r0.xyzw = g_Texture_velocity0.SampleLevel(g_samLinearClamp_s, r1.xyz, 0).xyzw;
  o0.xyzw = m_fModulate * r0.xyzw;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
//
// Buffer Definitions: 
//
// cbuffer fcbFluidParam
// {
//
//   float m_fTextureHeight;            // Offset:    0 Size:     4
//   float m_fTextureWidth;             // Offset:    4 Size:     4
//   float m_fTextureDepth;             // Offset:    8 Size:     4
//   int m_fTextureNumber;              // Offset:   12 Size:     4 [unused]
//   float4 m_fObstVelocity;            // Offset:   16 Size:    16 [unused]
//   float m_fModulate;                 // Offset:   32 Size:     4
//   float m_fSize;                     // Offset:   36 Size:     4 [unused]
//   float m_Dummy00;                   // Offset:   40 Size:     4 [unused]
//   float m_Dummy01;                   // Offset:   44 Size:     4 [unused]
//   float3 m_fCenter;                  // Offset:   48 Size:    12 [unused]
//   float m_Dummy10;                   // Offset:   60 Size:     4 [unused]
//   float4 m_fSplatColor;              // Offset:   64 Size:    16 [unused]
//   float m_fEpsilon;                  // Offset:   80 Size:     4 [unused]
//   float m_fTimestep;                 // Offset:   84 Size:     4
//   float m_fForward;                  // Offset:   88 Size:     4
//   float m_Dummy20;                   // Offset:   92 Size:     4 [unused]
//   float3 m_fHalfVolumeDim;           // Offset:   96 Size:    12 [unused]
//   float m_Dummy30;                   // Offset:  108 Size:     4 [unused]
//   float3 m_fBoxLBDcorner;            // Offset:  112 Size:    12 [unused]
//   float m_Dummy40;                   // Offset:  124 Size:     4 [unused]
//   float3 m_fBoxRTUcorner;            // Offset:  128 Size:    12 [unused]
//   float m_Dummy50;                   // Offset:  140 Size:     4 [unused]
//   int4 m_SlideDirection;             // Offset:  144 Size:    16 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// g_samPointClamp                   sampler      NA          NA    7        1
// g_samLinearClamp                  sampler      NA          NA    9        1
// g_Texture_velocity0               texture  float4          3d    0        1
// fcbFluidParam                     cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float       
// TEXCOORD                 0   xyz         1     NONE   float   xyz 
// TEXCOORD                 1   xyz         2     NONE   float   xyz 
// TEXCOORD                 2   xy          3     NONE   float       
// TEXCOORD                 3     zw        3     NONE   float       
// TEXCOORD                 4   xy          4     NONE   float       
// SV_RenderTargetArrayIndex     0   x           5  RTINDEX    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 cb0[6], immediateIndexed
dcl_sampler s7, mode_default
dcl_sampler s9, mode_default
dcl_resource_texture3d (float,float,float,float) t0
dcl_input_ps linear v1.xyz
dcl_input_ps linear v2.xyz
dcl_output o0.xyzw
dcl_temps 2
mul r0.x, cb0[5].z, cb0[5].y
sample_l_indexable(texture3d)(float,float,float,float) r0.yzw, v2.xyzx, t0.wxyz, s7, l(0.000000)
mad r0.xyz, -r0.xxxx, r0.yzwy, v1.xyzx
add r0.z, r0.z, l(0.500000)
div r1.xyz, r0.xyzx, cb0[0].yxzy
sample_l_indexable(texture3d)(float,float,float,float) r0.xyzw, r1.xyzx, t0.xyzw, s9, l(0.000000)
mul o0.xyzw, r0.xyzw, cb0[2].xxxx
ret 
// Approximately 8 instruction slots used

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