FShaderResource

Compiled shader bytecode and its corresponding RHI resource.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

RenderCore

Header

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

Include

#include "Shader.h"

Syntax

class FShaderResource :
    public FRenderResource,
    public FDeferredCleanupInterface

Remarks

Compiled shader bytecode and its corresponding RHI resource. This can be shared by multiple FShaders with identical compiled output.

Constructors

Name Description

Public function

FShaderResource()

Constructor used for deserialization.

Public function

FShaderResource

(
    const FShaderCompilerOutput& Outpu...,
    FShaderType* InSpecificType,
    int32 InSpecificPermutationId
)

Constructor used when creating a new shader resource from compiled output.

Destructors

Name Description

Public function

~FShaderResource()

Functions

Name Description

Public function

void

 

AddRef()

Reference counting.

Public function Static

bool

 

ArePlatformsCompatible

(
    EShaderPlatform CurrentPlatform,
    EShaderPlatform TargetPlatform
)

Returns true if and only if TargetPlatform is compatible for use with CurrentPlatform.

Public function Static

FSHAHash &

 

FilterShaderSourceHashForSerialization

(
    const FArchive& Ar,
    FSHAHash& HashToSerialize
)

Passes back a zeroed out hash to serialize when saving out cooked data.

Public function Static

FShaderResou...

 

FindOrCreateShaderResource

(
    const FShaderCompilerOutput& Outpu...,
    FShaderType* SpecificType,
    int32 SpecificPermutationId
)

Finds a matching shader resource in memory or creates a new one with the given compiler output.

Public function Static

FShaderResou...

 

FindShaderResourceById

(
    const FShaderResourceId& Id
)

Finds a matching shader resource in memory if possible.

Public function Static

void

 

GetAllShaderResourceId

(
    TArray< FShaderResourceId >& Ids
)

Return a list of all shader Ids currently known

Public function

FRHIComputeS...

 

GetComputeShader()

Public function

FRHIDomainSh...

 

GetDomainShader()

Public function

FRHIGeometry...

 

GetGeometryShader()

Public function

FRHIHullShad...

 

GetHullShader()

Public function Const

FShaderResou...

 

GetId()

Public function

FRHIPixelSha...

 

GetPixelShader()

Public function Const

void

 

GetShaderCode

(
    TArray< uint8 >& OutCode
)

Public function Const

uint32

 

GetSizeBytes()

Public function

FRHIVertexSh...

 

GetVertexShader()

Public function

void

 

Register()

Public function

void

 

Release()

Public function

void

 

Serialize

(
    FArchive& Ar,
    bool bLoadedByCookedMaterial
)

Overridden from FRenderResource

Name Description

Public function Virtual

void

 

InitRHI()

Initializes the RHI resources used by this resource.

Public function Virtual

void

 

ReleaseRHI()

Releases the RHI resources used by this resource.

Constants

Name

Description

ShaderResourceIdMap

Tracks loaded shader resources by id.

ShaderResourceIdMapCritical

Critical section for ShaderResourceIdMap.

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