Function setShaderModel

Synopsis

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

Desc & setShaderModel(const std::string &sm)

Description

Set the shader model string. This depends on the API you are using. For DirectX it should be 4_0, 4_1, 5_0, 5_1, 6_0, 6_1, 6_2, or 6_3. The default is 6_0. Shader model 6.x will use dxcompiler, previous shader models use fxc. For Vulkan, it should be 400, 410, 420, 430, 440 or 450. The default is 450

Source

Lines 127-154 in Source/Falcor/Core/Program/Program.cpp. Line 94 in Source/Falcor/Core/Program/Program.h.

Program::Desc& Program::Desc::setShaderModel(const std::string& sm)
{
    // Check that the model is supported
    bool b = false;
    for (size_t i = 0; i < arraysize(kSupportedShaderModels); i++)
    {
        if (kSupportedShaderModels[i] == sm)
        {
            b = true;
            break;
        }
    }
    if (b == false)
    {
        std::string warn = "Unsupported shader-model '" + sm + "' requested. Supported shader-models are ";
        for (size_t i = 0; i < arraysize(kSupportedShaderModels); i++)
        {
            warn += kSupportedShaderModels[i];
            warn += (i == kSupportedShaderModels->size() - 1) ? "." : ", ";
        }
        warn += "\nThis is not an error, but if something goes wrong try using one of the supported models.";
        logWarning(warn);
    }
    mShaderModel = sm;
    return *this;
}





Add Discussion as Guest

Log in to DocsForge