Class ComputeProgram
Synopsis
#include <Source/Falcor/Core/Program/ComputeProgram.h>
class dlldecl ComputeProgram : public Program
Description
Compute program. See GraphicsProgram to manage graphics programs.
Inheritance
Ancestors: Program
Methods
ComputeProgram | ||
~ComputeProgram | ||
create | Create a new compute program | |
createFromFile | Create a new compute program from file | |
dispatchCompute | Dispatch the program using the argument values set in pVars . |
Source
Lines 35-71 in Source/Falcor/Core/Program/ComputeProgram.h.
class dlldecl ComputeProgram : public Program
{
public:
using SharedPtr = std::shared_ptr<ComputeProgram>;
using SharedConstPtr = std::shared_ptr<const ComputeProgram>;
~ComputeProgram() = default;
/** Create a new compute program from file.
Note that this call merely creates a program object. The actual compilation and link happens at a later time.
\param[in] filename Compute program filename.
\param[in] csEntry Name of the entry point in the program.
\param[in] programDefines Optional list of macro definitions to set into the program.
\param[in] flags Optional program compilation flags.
\param[in] shaderModel Optional string describing which shader model to use.
\return A new object, or an exception is thrown if creation failed.
*/
static SharedPtr createFromFile(const std::string& filename, const std::string& csEntry, const DefineList& programDefines = DefineList(), Shader::CompilerFlags flags = Shader::CompilerFlags::None, const std::string& shaderModel = "");
/** Create a new compute program.
Note that this call merely creates a program object. The actual compilation and link happens at a later time.
\param[in] desc The program description.
\param[in] programDefines Optional list of macro definitions to set into the program.
\return A new object, or an exception is thrown if creation failed.
*/
static SharedPtr create(const Program::Desc& desc, const DefineList& programDefines = DefineList());
/** Dispatch the program using the argument values set in `pVars`.
*/
virtual void dispatchCompute(
ComputeContext* pContext,
ComputeVars* pVars,
uint3 const& threadGroupCount);
protected:
ComputeProgram() = default;
};