summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-specialize-resources.h
blob: 62a2728bcbdcfa8fd7cf21da644c194da9391a3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// slang-ir-specialize-resources.h
#pragma once

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

        /// Specialize calls to functions with resource-type parameters.
        ///
        /// For any function that has resource-type input parameters that
        /// would be invalid on the chosen target, this pass will rewrite
        /// any 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 specializeResourceParameters(
        BackEndCompileRequest* compileRequest,
        TargetRequest*  targetRequest,
        IRModule*       module);

    void specializeResourceOutputs(
        BackEndCompileRequest*  compileRequest,
        TargetRequest*          targetRequest,
        IRModule*               module);
}