Public Member Functions | Private Attributes | Static Private Attributes | List of all members
gte::Fluid2SolvePoisson Class Reference

#include <GteFluid2SolvePoisson.h>

Public Member Functions

void Execute (std::shared_ptr< GraphicsEngine > const &engine, std::shared_ptr< Texture2 > const &divergence)
 
 Fluid2SolvePoisson (std::shared_ptr< ProgramFactory > const &factory, int xSize, int ySize, int numXThreads, int numYThreads, std::shared_ptr< ConstantBuffer > const &parameters, int numIterations)
 
std::shared_ptr< Texture2 > const & GetPoisson () const
 

Private Attributes

int mNumIterations
 
int mNumXGroups
 
int mNumYGroups
 
std::shared_ptr< Texture2mPoisson0
 
std::shared_ptr< Texture2mPoisson1
 
std::shared_ptr< ComputeProgrammSolvePoisson
 
std::shared_ptr< ComputeProgrammWriteXEdge
 
std::shared_ptr< ComputeProgrammWriteYEdge
 
std::shared_ptr< ComputeProgrammZeroPoisson
 

Static Private Attributes

static std::string const * msEnforceSource [ProgramFactory::PF_NUM_API]
 
static std::string const msGLSLEnforceSource
 
static std::string const msGLSLSolveSource
 
static std::string const msGLSLZeroSource
 
static std::string const msHLSLEnforceSource
 
static std::string const msHLSLSolveSource
 
static std::string const msHLSLZeroSource
 
static std::string const * msSolveSource [ProgramFactory::PF_NUM_API]
 
static std::string const * msZeroSource [ProgramFactory::PF_NUM_API]
 

Detailed Description

Definition at line 20 of file GteFluid2SolvePoisson.h.

Constructor & Destructor Documentation

Fluid2SolvePoisson::Fluid2SolvePoisson ( std::shared_ptr< ProgramFactory > const &  factory,
int  xSize,
int  ySize,
int  numXThreads,
int  numYThreads,
std::shared_ptr< ConstantBuffer > const &  parameters,
int  numIterations 
)

Definition at line 14 of file GteFluid2SolvePoisson.cpp.

Member Function Documentation

void Fluid2SolvePoisson::Execute ( std::shared_ptr< GraphicsEngine > const &  engine,
std::shared_ptr< Texture2 > const &  divergence 
)

Definition at line 59 of file GteFluid2SolvePoisson.cpp.

std::shared_ptr< Texture2 > const & gte::Fluid2SolvePoisson::GetPoisson ( ) const
inline

Definition at line 60 of file GteFluid2SolvePoisson.h.

Member Data Documentation

int gte::Fluid2SolvePoisson::mNumIterations
private

Definition at line 46 of file GteFluid2SolvePoisson.h.

int gte::Fluid2SolvePoisson::mNumXGroups
private

Definition at line 39 of file GteFluid2SolvePoisson.h.

int gte::Fluid2SolvePoisson::mNumYGroups
private

Definition at line 39 of file GteFluid2SolvePoisson.h.

std::shared_ptr<Texture2> gte::Fluid2SolvePoisson::mPoisson0
private

Definition at line 44 of file GteFluid2SolvePoisson.h.

std::shared_ptr<Texture2> gte::Fluid2SolvePoisson::mPoisson1
private

Definition at line 45 of file GteFluid2SolvePoisson.h.

std::string const * Fluid2SolvePoisson::msEnforceSource
staticprivate
Initial value:

Definition at line 57 of file GteFluid2SolvePoisson.h.

std::string const Fluid2SolvePoisson::msGLSLEnforceSource
staticprivate
Initial value:
=
"#if USE_ZERO_X_EDGE\n"
"layout(r32f) uniform writeonly image2D image;\n"
"\n"
"layout (local_size_x = 1, local_size_y = NUM_Y_THREADS, local_size_z = 1) in;\n"
"void main()\n"
"{\n"
" ivec2 c = ivec2(gl_GlobalInvocationID.xy);\n"
" ivec2 dim = imageSize(image);\n"
" imageStore(image, ivec2(0, c.y), vec4(0.0f, 0.0f, 0.0f, 0.0f));\n"
" imageStore(image, ivec2(dim.x - 1, c.y), vec4(0.0f, 0.0f, 0.0f, 0.0f));\n"
"}\n"
"#endif\n"
"\n"
"#if USE_ZERO_Y_EDGE\n"
"layout(r32f) uniform writeonly image2D image;\n"
"\n"
"layout (local_size_x = NUM_X_THREADS, local_size_y = 1, local_size_z = 1) in;\n"
"void main()\n"
"{\n"
" ivec2 c = ivec2(gl_GlobalInvocationID.xy);\n"
" ivec2 dim = imageSize(image);\n"
" imageStore(image, ivec2(c.x, 0), vec4(0.0f, 0.0f, 0.0f, 0.0f));\n"
" imageStore(image, ivec2(c.x, dim.y - 1), vec4(0.0f, 0.0f, 0.0f, 0.0f));\n"
"}\n"
"#endif\n"

Definition at line 51 of file GteFluid2SolvePoisson.h.

std::string const Fluid2SolvePoisson::msGLSLSolveSource
staticprivate

Definition at line 50 of file GteFluid2SolvePoisson.h.

std::string const Fluid2SolvePoisson::msGLSLZeroSource
staticprivate
Initial value:
=
"layout(r32f) uniform writeonly image2D poisson;\n"
"\n"
"layout (local_size_x = NUM_X_THREADS, local_size_y = NUM_Y_THREADS, local_size_z = 1) in;\n"
"void main()\n"
"{\n"
" ivec2 c = ivec2(gl_GlobalInvocationID.xy);\n"
" imageStore(poisson, c, vec4(0.0f, 0.0f, 0.0f, 0.0f));\n"
"}\n"

Definition at line 49 of file GteFluid2SolvePoisson.h.

std::string const Fluid2SolvePoisson::msHLSLEnforceSource
staticprivate
Initial value:
=
"#if USE_ZERO_X_EDGE\n"
"RWTexture2D<float> image;\n"
"\n"
"[numthreads(1, NUM_Y_THREADS, 1)]\n"
"void CSMain(uint2 c : SV_DispatchThreadID)\n"
"{\n"
" uint2 dim;\n"
" image.GetDimensions(dim.x, dim.y);\n"
" image[uint2(0, c.y)] = 0.0f;\n"
" image[uint2(dim.x - 1, c.y)] = 0.0f;\n"
"}\n"
"#endif\n"
"\n"
"#if USE_ZERO_Y_EDGE\n"
"RWTexture2D<float> image;\n"
"\n"
"[numthreads(NUM_X_THREADS, 1, 1)]\n"
"void CSMain(uint2 c : SV_DispatchThreadID)\n"
"{\n"
" uint2 dim;\n"
" image.GetDimensions(dim.x, dim.y);\n"
" image[uint2(c.x, 0)] = 0.0f;\n"
" image[uint2(c.x, dim.y - 1)] = 0.0f;\n"
"}\n"
"#endif\n"

Definition at line 54 of file GteFluid2SolvePoisson.h.

std::string const Fluid2SolvePoisson::msHLSLSolveSource
staticprivate

Definition at line 53 of file GteFluid2SolvePoisson.h.

std::string const Fluid2SolvePoisson::msHLSLZeroSource
staticprivate
Initial value:
=
"RWTexture2D<float> poisson;\n"
"\n"
"[numthreads(NUM_X_THREADS, NUM_Y_THREADS, 1)]\n"
"void CSMain(uint2 c : SV_DispatchThreadID)\n"
"{\n"
" poisson[c] = 0.0f;\n"
"}\n"

Definition at line 52 of file GteFluid2SolvePoisson.h.

std::shared_ptr<ComputeProgram> gte::Fluid2SolvePoisson::mSolvePoisson
private

Definition at line 41 of file GteFluid2SolvePoisson.h.

std::string const * Fluid2SolvePoisson::msSolveSource
staticprivate
Initial value:

Definition at line 56 of file GteFluid2SolvePoisson.h.

std::string const * Fluid2SolvePoisson::msZeroSource
staticprivate
Initial value:

Definition at line 55 of file GteFluid2SolvePoisson.h.

std::shared_ptr<ComputeProgram> gte::Fluid2SolvePoisson::mWriteXEdge
private

Definition at line 42 of file GteFluid2SolvePoisson.h.

std::shared_ptr<ComputeProgram> gte::Fluid2SolvePoisson::mWriteYEdge
private

Definition at line 43 of file GteFluid2SolvePoisson.h.

std::shared_ptr<ComputeProgram> gte::Fluid2SolvePoisson::mZeroPoisson
private

Definition at line 40 of file GteFluid2SolvePoisson.h.


The documentation for this class was generated from the following files:


geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 04:00:06