https://github.com/shader-slang/slang
Raw File
Tip revision: 0586f3298fa7d554fa2682103eefba88740d6758 authored by jsmall-nvidia on 18 January 2023, 19:11:50 UTC
Upgrade slang-llvm-13.x-33 (#2600)
Tip revision: 0586f32
slang-ir-specialize-resources.h
// slang-ir-specialize-resources.h
#pragma once

namespace Slang
{
    struct CodeGenContext;
    struct IRModule;
    struct IRType;

        /// 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).
        ///
    bool specializeResourceParameters(
        CodeGenContext* codeGenContext,
        IRModule*       module);

    bool specializeResourceOutputs(
        CodeGenContext* codeGenContext,
        IRModule*       module);

        /// Combined iterative passes of `specializeResourceParameters` and `specializeResourceOutputs`.
    bool specializeResourceUsage(
        CodeGenContext* codeGenContext,
        IRModule*       irModule);

    bool isIllegalGLSLParameterType(IRType* type);

}
back to top