Navigation
API > API/Runtime > API/Runtime/RenderCore
Class used in shader compilation pipelines which wraps source code and ensures sufficient padding such that 16-byte wide SIMD operations on the source are guaranteed to read valid memory even if starting from the last character.
| Name | FShaderSource |
| Type | class |
| Header File | /Engine/Source/Runtime/RenderCore/Public/ShaderSource.h |
| Include Path | #include "ShaderSource.h" |
Syntax
class FShaderSource
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FShaderSource
(
FViewType InSrc, |
Given a string view construct a shader source object containing the contents of that string. | ShaderSource.h | |
| Construct an empty shader source object; will still contain padding | ShaderSource.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| CharType | ANSICHAR | ShaderSource.h | |
| FCStringType | FCStringAnsi | ShaderSource.h | |
| FStringType | FAnsiString | ShaderSource.h | |
| FViewType | FAnsiStringView | ShaderSource.h | |
| TStringBuilder | TAnsiStringBuilder< NumChars > | ShaderSource.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| ShaderSourceSimdPadding | int32 | ShaderSource.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| DecompressedCharCount | int32 | ShaderSource.h | ||
| Source | TArray< CharType > | ShaderSource.h | ||
| SourceCompressed | TArray< uint8 > | ShaderSource.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void Compress() |
ShaderSource.h | ||
void Decompress() |
ShaderSource.h | ||
CharType * GetData() |
Direct data pointer accessor. Will decompress data if it was previously compressed. | ShaderSource.h | |
int32 GetDecompressedSize() |
ShaderSource.h | ||
FViewType GetView() |
String view accessor. Will decompress data if it was previously compressed. | ShaderSource.h | |
bool IsCompressed() |
ShaderSource.h | ||
bool IsEmpty() |
IsEmpty predicate | ShaderSource.h | |
int32 Len() |
Length accessor. | ShaderSource.h | |
void Set
(
FViewType InSrc, |
Set the given string as the contents of this shader source object. | ShaderSource.h | |
void ShrinkToLen
(
int32 Num, |
Reduces the set size of the stored string length, optionally shrinking the allocation. | ShaderSource.h | |
void ShrinkToLen
(
int32 Num, |
ShaderSource.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static int32 GetSimdCharCount() |
Constexpr function returning the number of characters read in a single SIMD compare op | ShaderSource.h | |
static int32 GetSingleCharMask() |
Constexpr function returning a mask value for a single character | ShaderSource.h | |
static bool IsWide() |
Constexpr predicate indicating whether wide or ansi chars are used | ShaderSource.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FShaderSource & operator=
(
FStringType&& InSrc |
Move assignment operator accepting a string object. | ShaderSource.h |