
280 VI Compute
Texture3D<float4> g_VelocityRO : register ( t0 );
Texture3D<float4> g_PressureRO : register ( t1 );
Texture3D<float4> g_VorticityRO : register( t2 );
RWTexture3D <float4> g_VelocityRW : register( u0 );
[ numthreads (8 , 4, 4) ]
void main ( uint3 idx : SV_DispatchThreadID )
{
float4 FC = g_VelocityRO [ idx ];
// Apply the density force .
{
float U = g_PressureRO [ idx + int3 (0 , 1, 0) ] . x ;
float D = g_PressureRO [ idx − int3(0 , 1 , 0) ] . x ;
float L = g_PressureRO [ idx − int3(1 , 0 , 0) ] . x ;
float R = g_PressureRO [ idx + int3 (1 , 0, 0) ] . x ;
float F = g_PressureRO [ idx + int3 (0 , 0, 1) ] . x ;
float B = g_PressureRO [ idx − int3 ...