From 61be38f39cc96ad9644f17f6ab8d262875e99e9e Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 23 Jul 2020 15:33:04 -0700 Subject: Run array specialization in a sperate pass. (#1449) * Run array specialization in a sperate pass. * rename specializeFunctionCall->specializeFunctionCalls Co-authored-by: Tim Foley --- source/slang/slang-ir-specialize-function-call.h | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 source/slang/slang-ir-specialize-function-call.h (limited to 'source/slang/slang-ir-specialize-function-call.h') diff --git a/source/slang/slang-ir-specialize-function-call.h b/source/slang/slang-ir-specialize-function-call.h new file mode 100644 index 000000000..90c463374 --- /dev/null +++ b/source/slang/slang-ir-specialize-function-call.h @@ -0,0 +1,32 @@ +// slang-ir-specialize-function-call.h +#pragma once + +namespace Slang +{ + class BackEndCompileRequest; + class TargetRequest; + struct IRModule; + struct IRParam; + + class FunctionCallSpecializeCondition + { + public: + virtual bool doesParamNeedSpecialization(IRParam* param) = 0; + }; + + + /// 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); +} -- cgit v1.2.3