FOpenGLFrontend

Windows
MacOS
Linux

References

Module

ShaderFormatOpenGL

Header

/Engine/Source/Developer/ShaderFormatOpenGL/Public/ShaderFormatOpenGL.h

Include

#include "ShaderFormatOpenGL.h"

Syntax

class FOpenGLFrontend

Destructors

Name Description

Public function Virtual

~FOpenGLFrontend()

Functions

Name Description

Protected function

void

 

BuildShaderOutput

(
    FShaderCompilerOutput& ShaderOutpu...,
    const FShaderCompilerInput& Shader...,
    const ANSICHAR* InShaderSource,
    int32 SourceLen,
    GLSLVersion Version
)

Construct the final microcode from the compiled and verified shader source.

Protected function Virtual

uint32

 

CalculateCrossCompilerFlags

(
    GLSLVersion Version,
    const bool bFullPrecisionInPS,
    const FShaderCompilerFlags& Compil...
)

Protected function

void

 

CompileOffline

(
    const FShaderCompilerInput& Shader...,
    FShaderCompilerOutput& Output,
    const GLSLVersion ShaderVersion,
    const ANSICHAR* InShaderSource
)

Public function

void

 

CompileShader

(
    const FShaderCompilerInput& Input,
    FShaderCompilerOutput& Output,
    const FString& WorkingDirectory,
    GLSLVersion Version
)

Compile a shader for OpenGL on Windows.

Protected function Virtual

void

 

ConvertOpenGLVersionFromGLSLVersion

(
    GLSLVersion InVersion,
    int& OutMajorVersion,
    int& OutMinorVersion
)

Protected function Virtual

FGlslCodeBac...

 

CreateBackend

(
    GLSLVersion Version,
    uint32 CCFlags,
    EHlslCompileTarget HlslCompilerTarg...
)

Create the compiling backend

Protected function Virtual

FGlslLanguag...

 

CreateLanguageSpec

(
    GLSLVersion Version,
    bool bDefaultPrecisionIsHalf
)

Create the language spec

Protected function Const

void

 

FillDeviceCapsOfflineCompilation

(
    FDeviceCapabilities& Caps,
    const GLSLVersion ShaderVersion
)

Fills device capabilities in 'offline', mostly hardcoded values

Protected function Virtual

uint32

 

GetMaxSamplers

(
    GLSLVersion Version
)

What is the max number of samplers the shader platform can use?

Protected function Virtual

bool

 

IsSM5

(
    GLSLVersion Version
)

Protected function Virtual

bool

 

OptionalSerializeOutputAndReturnIfSerialized

(
    FArchive& Ar
)

Allow subclass to write out different output, returning true if it did write everything it needed

Protected function Virtual

bool

 

OutputTrueParameterNames()

If true, the shader output map will contain true names (i.e. ColorModifier) instead of helper names for runtime binding (i.e. pb_5)

Protected function

void

 

PlatformCompileOffline

(
    const FShaderCompilerInput& Input,
    FShaderCompilerOutput& ShaderOutpu...,
    const ANSICHAR* ShaderSource,
    const GLSLVersion ShaderVersion
)

Based on ShaderVersion decides what platform specific compiler to use

Protected function Const

bool

 

PlatformSupportsOfflineCompilation

(
    const GLSLVersion ShaderVersion
)

Protected function Virtual

bool

 

PostProcessShaderSource

(
    GLSLVersion Version,
    EShaderFrequency Frequency,
    const ANSICHAR* ShaderSource,
    uint32 SourceLen,
    FShaderParameterMap& ParameterMap,
    TMap< FString, FString >& BindingN...,
    TArray< struct FShaderCompilerError...,
    const FShaderCompilerInput& Shader...
)

Allow a subclass to perform additional work on the cross compiled source code.

Protected function

void

 

PrecompileShader

(
    FShaderCompilerOutput& ShaderOutpu...,
    const FShaderCompilerInput& Shader...,
    const ANSICHAR* ShaderSource,
    GLSLVersion Version,
    EHlslShaderFrequency Frequency
)

Precompile a GLSL shader.

Protected function Const

TSharedPtr< ...

 

PrepareCodeForOfflineCompilation

(
    GLSLVersion ShaderVersion,
    EShaderFrequency Frequency,
    const ANSICHAR* InShaderSource
)

Final source code processing, based on device capabilities, before actual (offline) compilation; it mostly mirrors the behaviour of OpenGLShaders.cpp/GLSLToDeviceCompatibleGLSL()

Protected function Virtual

void

 

SetupPerVersionCompilationEnvironment

(
    GLSLVersion Version,
    FShaderCompilerDefinitions& Additi...,
    EHlslCompileTarget& HlslCompilerTa...
)

Set up compilation information like defines and HlslCompileTarget

Protected function Virtual

bool

 

SupportsSeparateShaderObjects

(
    GLSLVersion Version
)

Does the given version support SSO? Allows subclasses to device based on it's own format