Files
UnrealEngineUWP/Engine/Source/Developer/ShaderPreprocessor/Public/ShaderPreprocessor.h
T

71 lines
2.9 KiB
C++
Raw Normal View History

2019-12-26 15:32:37 -05:00
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "HAL/Platform.h"
#include "ShaderCore.h"
class FShaderCompilerDefinitions;
2023-05-03 10:17:48 -04:00
class FShaderPreprocessOutput;
class FString;
struct FShaderCompilerInput;
struct FShaderCompilerOutput;
2023-12-06 13:32:32 -05:00
enum class
UE_DEPRECATED(5.4, "EDumpShaderDefines is no longer used. Shader defines will always be included in preprocessed source debug dumps, but no longer explicitly added to the source by preprocessing.")
EDumpShaderDefines : uint8
{
/** Will not be dumped unless Input.DumpDebugInfoPath is set */
DontCare,
/** No defines */
DontIncludeDefines,
/** Defines will be added in the comments */
AlwaysIncludeDefines
};
UE_DEPRECATED(5.4, "Please use overload of PreprocessShader accepting a FShaderPreprocessOutput struct.")
extern SHADERPREPROCESSOR_API bool PreprocessShader(
FString& OutPreprocessedShader,
FShaderCompilerOutput& ShaderOutput,
const FShaderCompilerInput& ShaderInput,
PRAGMA_DISABLE_DEPRECATION_WARNINGS // FShaderCompilerDefinitions will be made internal in the future, marked deprecated until then
const FShaderCompilerDefinitions& AdditionalDefines,
2023-12-06 13:32:32 -05:00
EDumpShaderDefines DefinesPolicy = EDumpShaderDefines::DontCare
PRAGMA_ENABLE_DEPRECATION_WARNINGS
2023-12-06 13:32:32 -05:00
);
2023-05-03 10:17:48 -04:00
/**
* Preprocess a shader.
* @param Output - Preprocess output struct. Source, directives and possibly errors will be populated.
* @param Input - The shader compiler input.
* @param MergedEnvironment - The result of merging the Environment and SharedEnvironment from the FShaderCompilerInput
* (it is assumed this overload is called outside of the worker process which merges this in-place, so this merge step must be
* performed by the caller)
* @param AdditionalDefines - Additional defines with which to preprocess the shader.
* @returns true if the shader is preprocessed without error.
*/
extern SHADERPREPROCESSOR_API bool PreprocessShader(
FShaderPreprocessOutput& Output,
const FShaderCompilerInput& Input,
const FShaderCompilerEnvironment& MergedEnvironment,
PRAGMA_DISABLE_DEPRECATION_WARNINGS // FShaderCompilerDefinitions will be made internal in the future, marked deprecated until then
2023-12-06 13:32:32 -05:00
const FShaderCompilerDefinitions& AdditionalDefines = FShaderCompilerDefinitions()
PRAGMA_ENABLE_DEPRECATION_WARNINGS
2023-12-06 13:32:32 -05:00
);
UE_DEPRECATED(5.4, "EDumpShaderDefines is no longer used. Shader defines will always be included in preprocessed source debug dumps, but no longer explicitly added to the source by preprocessing.")
inline bool PreprocessShader(
FShaderPreprocessOutput& Output,
const FShaderCompilerInput& Input,
const FShaderCompilerEnvironment& MergedEnvironment,
PRAGMA_DISABLE_DEPRECATION_WARNINGS // FShaderCompilerDefinitions will be made internal in the future, marked deprecated until then
const FShaderCompilerDefinitions& AdditionalDefines,
EDumpShaderDefines DefinesPolicy
PRAGMA_ENABLE_DEPRECATION_WARNINGS
)
{
return PreprocessShader(Output, Input, MergedEnvironment, AdditionalDefines);
}