summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-specialize-function-call.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2020-07-23 15:33:04 -0700
committerGitHub <noreply@github.com>2020-07-23 15:33:04 -0700
commit61be38f39cc96ad9644f17f6ab8d262875e99e9e (patch)
tree84d208568e9c412d938cfde42015f096c82fb99a /source/slang/slang-ir-specialize-function-call.h
parentfed4292a581364b611a82a0f6c1c1c95f82dfeb2 (diff)
Run array specialization in a sperate pass. (#1449)
* Run array specialization in a sperate pass. * rename specializeFunctionCall->specializeFunctionCalls Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com>
Diffstat (limited to 'source/slang/slang-ir-specialize-function-call.h')
-rw-r--r--source/slang/slang-ir-specialize-function-call.h32
1 files changed, 32 insertions, 0 deletions
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);
+}