https://github.com/shader-slang/slang
Raw File
Tip revision: e59516fa8c3a16eb7b99a928c5b85b97bf44fd72 authored by Yong He on 01 February 2022, 00:26:03 UTC
Revise entrypoint renaming interface. (#2113)
Tip revision: e59516f
slang-ir-specialize-function-call.h
// slang-ir-specialize-function-call.h
#pragma once

namespace Slang
{
    class BackEndCompileRequest;
    class TargetRequest;
    struct IRInst;
    struct IRModule;
    struct IRParam;

    class FunctionCallSpecializeCondition
    {
    public:
        virtual bool doesParamWantSpecialization(IRParam* param, IRInst* arg) = 0;

        virtual bool isParamSuitableForSpecialization(IRParam* param, IRInst* arg);
    };


    /// Specialize calls to functions with certain type of parameters.
    ///
    /// For any function that has a specific type of input parameters
    /// this pass will rewrite its call sites that pass suitable arguments
    /// (e.g., direct references to global shader parameters) to instead call
    /// a specialized variant of the function that does not have
    /// those resource parameters (and instead, e.g, refers to the
    /// global shader parameters directly).
    ///
    void specializeFunctionCalls(
        BackEndCompileRequest* compileRequest,
        TargetRequest* targetRequest,
        IRModule* module,
        FunctionCallSpecializeCondition* condition);
}
back to top