Function createFromFile

Synopsis

#include <Source/Falcor/Core/Program/ComputeProgram.h>

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="")

Description

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.

Parameters:

[ in ] filename - Compute program filename.

[ in ] csEntry - Name of the entry point in the program.

[ in ] programDefines - Optional list of macro definitions to set into the program.

[ in ] flags - Optional program compilation flags.

[ in ] shaderModel - Optional string describing which shader model to use.

Return
A new object, or an exception is thrown if creation failed.

Source

Lines 33-40 in Source/Falcor/Core/Program/ComputeProgram.cpp. Line 52 in Source/Falcor/Core/Program/ComputeProgram.h.

ComputeProgram::SharedPtr ComputeProgram::createFromFile(const std::string& filename, const std::string& csEntry, const DefineList& programDefines, Shader::CompilerFlags flags, const std::string& shaderModel)
{
    Desc d(filename);
    if (!shaderModel.empty()) d.setShaderModel(shaderModel);
    d.setCompilerFlags(flags);
    d.csEntry(csEntry);
    return create(d, programDefines);
}





Add Discussion as Guest

Log in to DocsForge