// ---- 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);
}



// 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,
  out float4 o1 : SV_TARGET1)
{
  float4 r0,r1;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyz = m_fBoxLBDcorner.xyz + float3(1,1,1);
  r1.xyz = m_fBoxRTUcorner.xyz + float3(-1,-1,-1);
  r0.xyz = cmp(r0.xyz < v1.xyz);
  r1.xyz = cmp(v1.xyz < r1.xyz);
  r0.x = r0.x ? r1.x : 0;
  r0.x = r0.y ? r0.x : 0;
  r0.x = r1.y ? r0.x : 0;
  r0.x = r0.z ? r0.x : 0;
  r0.x = r1.z ? r0.x : 0;
  if (r0.x != 0) {
    o0.xyzw = float4(0.5,0.5,0.5,0.5);
    o1.xyzw = float4(0,0,0,0);
    return;
  }
  r0.xyz = cmp(m_fBoxLBDcorner.xyz < v1.xyz);
  r1.xyz = cmp(v1.xyz < m_fBoxRTUcorner.xyz);
  r0.x = r0.x ? r1.x : 0;
  r0.x = r0.y ? r0.x : 0;
  r0.x = r1.y ? r0.x : 0;
  r0.x = r0.z ? r0.x : 0;
  r0.x = r1.z ? r0.x : 0;
  if (r0.x != 0) {
    o0.xyzw = float4(1,1,1,1);
    o1.xyz = m_fObstVelocity.xyz;
    o1.w = 1;
    return;
  }
  o0.xyzw = float4(0,0,0,0);
  o1.xyzw = float4(0,0,0,0);
  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 [unused]
//   float m_fTextureWidth;             // Offset:    4 Size:     4 [unused]
//   float m_fTextureDepth;             // Offset:    8 Size:     4 [unused]
//   int m_fTextureNumber;              // Offset:   12 Size:     4 [unused]
//   float4 m_fObstVelocity;            // Offset:   16 Size:    16
//   float m_fModulate;                 // Offset:   32 Size:     4 [unused]
//   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 [unused]
//   float m_fForward;                  // Offset:   88 Size:     4 [unused]
//   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
//   float m_Dummy40;                   // Offset:  124 Size:     4 [unused]
//   float3 m_fBoxRTUcorner;            // Offset:  128 Size:    12
//   float m_Dummy50;                   // Offset:  140 Size:     4 [unused]
//   int4 m_SlideDirection;             // Offset:  144 Size:    16 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// 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       
// 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
// SV_TARGET                1   xyzw        1   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[9], immediateIndexed
dcl_input_ps linear v1.xyz
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_temps 2
add r0.xyz, l(1.000000, 1.000000, 1.000000, 0.000000), cb0[7].xyzx
add r1.xyz, l(-1.000000, -1.000000, -1.000000, 0.000000), cb0[8].xyzx
lt r0.xyz, r0.xyzx, v1.xyzx
lt r1.xyz, v1.xyzx, r1.xyzx
and r0.x, r0.x, r1.x
and r0.x, r0.y, r0.x
and r0.x, r1.y, r0.x
and r0.x, r0.z, r0.x
and r0.x, r1.z, r0.x
if_nz r0.x
  mov o0.xyzw, l(0.500000,0.500000,0.500000,0.500000)
  mov o1.xyzw, l(0,0,0,0)
  ret 
endif 
lt r0.xyz, cb0[7].xyzx, v1.xyzx
lt r1.xyz, v1.xyzx, cb0[8].xyzx
and r0.x, r0.x, r1.x
and r0.x, r0.y, r0.x
and r0.x, r1.y, r0.x
and r0.x, r0.z, r0.x
and r0.x, r1.z, r0.x
if_nz r0.x
  mov o0.xyzw, l(1.000000,1.000000,1.000000,1.000000)
  mov o1.xyz, cb0[1].xyzx
  mov o1.w, l(1.000000)
  ret 
endif 
mov o0.xyzw, l(0,0,0,0)
mov o1.xyzw, l(0,0,0,0)
ret 
// Approximately 30 instruction slots used

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