Language:
Discover
By Skill Level
By Category

FShader

Choose your OS:

Inheritance Hierarchy

Syntax

class FShader : public FDeferredCleanupInterface

Remarks

A compiled shader and its parameter bindings.

Variables

Name Description

Protected variable

TArray < FShader ...

 

UniformBufferParameters

Protected variable

TArray < FUnifor ...

 

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

 

CheckShaderIsValid()

Checks that the shader is valid by asserting the canary value is set as expected.

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 Virtual

uint32

 

GetAllocatedSize()

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

Public function

const TArray ...

 

GetCode()

Public function

const FCompu ...

 

GetComputeShader()

The shader's compute shader

Public function

const FDomai ...

 

GetDomainShader()

The shader's domain shader

Public function

const FGeome ...

 

GetGeometryShader()

The shader's geometry shader

Public function

const FSHAHa ...

 

GetHash()

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

Public function

const FHullS ...

 

GetHullShader()

The shader's hull shader

Public function

FShaderId

 

GetId()

Public function

FSHAHash

 

GetMaterialShaderMapHash()

Public function

uint32

 

GetNumInstructions()

Public function

int32

 

GetNumRefs()

Public function

uint32

 

GetNumTextureSamplers()

Public function

FSHAHash

 

GetOutputHash()

Public function

const FPixel ...

 

GetPixelShader()

The shader's pixel shader

Public function

FShaderResou ...

 

GetResourceId()

Public function

uint32

 

GetResourceSizeBytes()

Public function

FShader *...

 

GetShaderChecked()

Checks that the shader is valid and returns itself.

Public function

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 FShade ...

 

GetTarget()

Public function

FShaderType ...

 

GetType()

Accessors.

Public function Virtual

uint32

 

GetTypeSize()

Returns the size of the concrete type of this shader.

Public function

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 FShade ...

 

GetUniformBufferParameter

(
    FUniformBufferStruct * SearchSt...
)

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

Public function Virtual

const FVerte ...

 

GetVertexFactoryParameterRef()

If the shader is linked with a vertex factory, returns the vertex factory's parameter object.

Public function

FVertexFacto ...

 

GetVertexFactoryType()

Public function

const FVerte ...

 

GetVertexShader()

The shader's vertex shader

Public function

void

 

Register()

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 Virtual

bool

 

Serialize

(
    FArchive & Ar
)

Public function

bool

 

SerializeBase

(
    FArchive & Ar,
    bool bShadersInline
)

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

Public function

void

 

SetResource

(
    FShaderResource * InResource
)

Overridden from FDeferredCleanupInterface

Name Description

Public function Virtual

void

 

FinishCleanup()

FDeferredCleanupInterface implementation.

Classes

Constants

Name

Description

ShaderMagic_CleaningUp

Canary is set to this if the FShader is a valid pointer but in the process of being cleaned up.

ShaderMagic_Initialized

Canary is set to this if the FShader is a valid pointer and initialized.

ShaderMagic_Uninitialized

Canary is set to this if the FShader is a valid pointer but uninitialized.

References

Module

ShaderCore

Header

Runtime/ShaderCore/Public/Shader.h