UE::ShaderCompilerCommon::RemoveDeadCode

Rewrites a fully preprocessed shader source code, removing any functions or structs that are not reachable from a given entry point or list of symbols.

Unreal Engine C++ API Reference > Developer > ShaderCompilerCommon > UE::ShaderCompilerCommon::RemoveDeadCode

References

   
Module ShaderCompilerCommon
Header /Engine/Source/Developer/ShaderCompilerCommon/Public/ShaderCompilerCommon.h
Include #include "ShaderCompilerCommon.h"
Source /Engine/Source/Developer/ShaderCompilerCommon/Private/ShaderCompilerCommon.cpp
namespace UE
{
    namespace ShaderCompilerCommon
    {
        bool UE::ShaderCompilerCommon::RemoveDeadCode
        (
            [FString](API\Runtime\Core\Containers\FString) & InOutPreprocessedShaderSource,
            const [FString](API\Runtime\Core\Containers\FString) & EntryPoint,
            [TArray](API\Runtime\Core\Containers\TArray)< [FShaderCompilerError](API\Runtime\RenderCore\FShaderCompilerError) > & OutErrors
        )
    }
}

Remarks

Rewrites a fully preprocessed shader source code, removing any functions or structs that are not reachable from a given entry point or list of symbols. This is a high-level wrapper for UE::ShaderMinifier that should be used in all shader compiler back-ends for consistency. Any errors encountered during parsing or minification are added to OutErrors. InOutPreprocessedShaderSource is replaced with the rewritten code on success and is kept intact on failure.


Ask questions and help your peers Developer Forums

Write your own tutorials or read those from others Learning Library