FShader

A compiled shader and its parameter bindings.

Windows
MacOS
Linux

Inheritance Hierarchy

FDeferredCleanupInterface

FShader

FGlobalShader

FAYUVConvertPS

FBMPConvertPS

FClearBufferReplacementCS

FClearReplacementPS

FClearReplacementVS

FClearTexture2DArrayReplacementCS

FClearTexture2DReplacementCS

FClearTexture2DReplacementScissorCS

FClearVolumeReplacementCS

FCopyRectPS

FCopyTexture2DCS

FCubemapTexturePropertiesPS

FCubemapTexturePropertiesVS

FFillTextureCS

FHdrCustomResolve2xPS

FHdrCustomResolve4xPS

FHdrCustomResolve8xPS

FHdrCustomResolveFMask2xPS

FHdrCustomResolveFMask4xPS

FHdrCustomResolveFMask8xPS

FHdrCustomResolveVS

FIESLightProfilePS

FInvertAlphaPS

FLongGPUTaskPS

FMediaShadersVS

FNiagaraCopyIntBufferRegionCS

FNiagaraDrawIndirectArgsGenCS

FNiagaraSortKeyGenCS

FNULLPS

FNV12ConvertPS

FNV21ConvertPS

FOculusAlphaInverseShader

FOculusBlackShader

FOculusCubemapPS

FOculusVertexShader

FOculusWhiteShader

FOneColorPS

TOneColorPixelShaderMRT

FResolveDepth2XPS

FResolveDepth4XPS

FResolveDepth8XPS

FResolveDepthNonMSPS

FResolveDepthPS

FResolveSingleSamplePS

FResolveVS

FRGB10toYUVv210ConvertPS

FRGB8toUYVY8ConvertPS

FRGBConvertPS

FScreenPS

FScreenPS_OSE

FScreenPSsRGBSource

FScreenVertexShaderVS

FScreenVS

TScreenVSForGS

FSetAlphaOnePS

FSimpleElementColorChannelMaskPS

FSimpleElementHitProxyPS

FSimpleElementPS

FSimpleElementAlphaOnlyPS

FSimpleElementGammaBasePS

FSimpleElementGammaAlphaOnlyPS

FSimpleElementGammaPS

FSimpleElementMaskedGammaBasePS

FSimpleElementDistanceFieldGammaPS

FSimpleElementMaskedGammaPS

FSimpleElementVS

FStereoLayerPS_Base

FStereoLayerPS

FStereoLayerPS_External

FStereoLayerVS

FUpdateTexture2DSubresouceCS

FUpdateTexture3DSubresouceCS

FUYVYConvertPS

FWmfMediaHardwareVideoDecodingShader

FHardwareVideoDecodingPassThroughPS

FHardwareVideoDecodingPS

FHardwareVideoDecodingVS

FHardwareVideoDecodingY416PS

FWriteToSliceGS

FWriteToSliceVS

FYCbCrConvertPS

FYCbCrConvertPS_4x4Matrix

FYUVConvertPS

FYUVv210ConvertPS

FYUY2ConvertPS

FYVYUConvertPS

TCopyDataCS

TCopyTexture2DCS

TOneColorVS

TUpdateTexture2DSubresouceCS

FMaterialShader

FMeshMaterialShader

FNiagaraShader

FNiagaraEmitterInstanceShader

FOpenColorIOPixelShader

References

Module

RenderCore

Header

/Engine/Source/Runtime/RenderCore/Public/Shader.h

Include

#include "Shader.h"

Syntax

class FShader : public FDeferredCleanupInterface

Remarks

A compiled shader and its parameter bindings.

Variables

Name Description

Public variable

FShaderParamete...

 

Bindings

Shader parameter bindings.

Protected variable

TArray< FShader...

 

UniformBufferParameters

Protected variable

TArray< const F...

 

UniformBufferParameterStructs

Indexed the same as UniformBufferParameters. Packed densely for coherent traversal.

Constructors

Name Description

Public function

FShader()

Used to construct a shader for deserialization.

Public function

FShader

(
    const CompiledShaderInitializerType...
)

Construct a shader from shader compiler output.

Destructors

Name Description

Public function Virtual

~FShader()

Functions

Name Description

Public function

void

 

AddRef()

Reference counting.

Public function

void

 

BeginInitializeResources()

Public function

void

 

Deregister()

Removes this shader from the ID lookup map.

Public function

void

 

DiscardSerializedResource()

Discards the serialized resource, used when the engine is using NullRHI

Public function

void

 

DumpDebugInfo()

Public function Const

const FShade...

 

FindAutomaticallyBoundUniformBufferStruct

(
    int32 BaseIndex
)

Public function Virtual Const

uint32

 

GetAllocatedSize()

Returns the size of all allocations owned by this shader, e.g. TArrays.

Public function Const

const TArray...

 

GetCode()

Public function Const

FRHIComputeS...

 

GetComputeShader()

Public function Const

FRHIDomainSh...

 

GetDomainShader()

Public function Const

FRHIGeometry...

 

GetGeometryShader()

Public function Const

const FSHAHa...

 

GetHash()

Returns the hash of the shader file that this shader was compiled with.

Public function Const

FRHIHullShad...

 

GetHullShader()

Public function Const

FShaderId

 

GetId()

Public function Const

uint32

 

GetNumInstructions()

Public function Const

int32

 

GetNumRefs()

Public function Const

uint32

 

GetNumTextureSamplers()

Public function Const

FSHAHash

 

GetOutputHash()

Public function Const

const FShade...

 

GetParameterMapInfo()

Public function Const

int32

 

GetPermutationId()

Public function Const

FRHIPixelSha...

 

GetPixelShader()

Public function Const

FShaderResou...

 

GetResourceId()

Public function Const

uint32

 

GetResourceSizeBytes()

Public function Static

const FShade...

 

GetRootParametersMetadata()

Returns the meta data for the root shader parameter struct.

Public function

FShader *...

 

GetShader()

Gets the shader.

Public function Const

EShaderPlatf...

 

GetShaderPlatform()

Returns the shader platform of the shader file that this shader was compiled with.

Public function Const

uint32

 

GetSizeBytes()

Public function Static

void

 

GetStreamOutElements

(
    FStreamOutElementList& ElementList,
    TArray< uint32 >& StreamStrides,
    int32& RasterizedStream
)

Implement for geometry shaders that want to use stream out.

Public function Const

const FShade...

 

GetTarget()

Public function Const

FShaderType ...

 

GetType()

Accessors.

Public function Virtual Const

uint32

 

GetTypeSize()

Returns the size of the concrete type of this shader.

Public function Const

const TShade...

 

GetUniformBufferParameter()

Finds an automatically bound uniform buffer matching the given uniform buffer type if one exists, or returns an unbound parameter.

Public function Const

const FShade...

 

GetUniformBufferParameter

(
    const FShaderParametersMetadata...
)

Finds an automatically bound uniform buffer matching the given uniform buffer struct if one exists, or returns an unbound parameter.

Public function Virtual Const

const FVerte...

 

GetVertexFactoryParameterRef()

Public function Const

FVertexFacto...

 

GetVertexFactoryType()

Public function Const

FRHIVertexSh...

 

GetVertexShader()

Public function

void

 

Register

(
    bool bLoadedByCookedMaterial
)

Registers this shader for lookup by ID.

Public function

void

 

RegisterSerializedResource()

Called from the main thread to register and set the serialized resource

Public function

void

 

Release()

Public function

void

 

SaveShaderStableKeys

(
    EShaderPlatform TargetShaderPlatfor...,
    const FStableShaderKeyAndValue& Sa...
)

Public function Virtual

bool

 

Serialize

(
    FArchive& Ar
)

Public function

bool

 

SerializeBase

(
    FArchive& Ar,
    bool bShadersInline,
    bool bLoadedByCookedMaterial
)

/ ** Can be overridden by FShader subclasses to modify their compile environment just before compilation occurs.

Public function

void

 

SetNumInstructions

(
    uint32 Num
)

Public function

void

 

SetResource

(
    FShaderResource* InResource
)

Classes

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback