Navigation
API > API/Plugins > API/Plugins/ShaderAuditCore
A loaded SHK session the core data unit shared between the editor plugin and the standalone ShaderAuditViewer.
Contains the raw SHK data, the analyzed model for the spreadsheet views, and an optional shader database for bytecode metadata.
| Name | FShaderAuditSession |
| Type | struct |
| Header File | /Engine/Plugins/Developer/ShaderToolkit/Source/ShaderAuditCore/Public/ShaderAuditSession.h |
| Include Path | #include "ShaderAuditSession.h" |
Syntax
struct FShaderAuditSession
Structs
| Name | Remarks |
|---|---|
| FExtensionData | Base for extension-owned per-session data. |
| FMaterialPackage | |
| FUniqueMaterial | |
| FUniqueShader | Per-unique-shader data. Index = unique shader ID. |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| BytecodeDatabase | TSharedPtr< FShaderBytecodeDatabase > | Optional shader database linking OutputHash -> bytecode metadata from .ushaderbytecode files. | ShaderAuditSession.h | |
| EntryMaterialIndex | TArray< int32 > | Per-entry: which material index this SHK entry belongs to. | ShaderAuditSession.h | |
| ExtensionData | TMap< FName, TSharedPtr< FExtensionData > > | Opaque per-extension data attached to this session. | ShaderAuditSession.h | |
| Filename | FString | The source SHK file path. | ShaderAuditSession.h | |
| MaterialPackages | TArray< FMaterialPackage > | ShaderAuditSession.h | ||
| NumMaterialParents | int32 | ShaderAuditSession.h | ||
| SessionId | int32 | Unique session ID, assigned at construction. | ShaderAuditSession.h | |
| SessionName | FString | Session name parsed from the SHK filename convention (e.g. "PCD3D_SM6"). | ShaderAuditSession.h | |
| ShaderHashToIndex | TMap< FShaderHash, int32 > | OutputHash -> unique shader ID. The one hash->index map. | ShaderAuditSession.h | |
| StableShaderKeyAndValueArray | TArray< FStableShaderKeyAndValue > | Raw shader entries loaded from the SHK file. | ShaderAuditSession.h | |
| UniqueMaterials | TArray< FUniqueMaterial > | ShaderAuditSession.h | ||
| UniqueShaders | TArray< FUniqueShader > | ShaderAuditSession.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FString BuildHierarchyPath
(
int32 MaterialIndex |
Build a hierarchy path string for a material by walking its parent chain. | ShaderAuditSession.h | |
void BuildIndex() |
Build the indexes from StableShaderKeyAndValueArray. Called once after loading. | ShaderAuditSession.h | |
int32 GetBytecodeArchiveCount() |
Number of .ushaderbytecode archive files loaded. | ShaderAuditSession.h | |
FString GetBytecodeArchiveDirectory() |
Directory containing the first loaded bytecode archive, or empty. | ShaderAuditSession.h | |
T * GetExtensionData
(
FName Key |
Retrieve typed extension data. Returns null if not set. | ShaderAuditSession.h | |
int32 GetHashRefCount
(
const FShaderHash& Hash |
Number of distinct materials that reference this hash. | ShaderAuditSession.h | |
bool GetShaderBytecodeInfo
(
const FShaderHash& Hash, |
Look up per-shader bytecode metadata by OutputHash. | ShaderAuditSession.h | |
const FStableShaderKeyAndValue & GetShaderEntry
(
int32 UniqueShaderID |
Access the SHK entry for a unique shader. | ShaderAuditSession.h | |
bool HasBytecodeDatabase() |
Returns true if a bytecode database is loaded for this session. | ShaderAuditSession.h | |
bool HasMaterialHierarchy() |
Has a material parent map been populated (from any source)? | ShaderAuditSession.h | |
int32 ReadAllCompressedShaderBlobs
(
TMap< FShaderHash, TArray< uint8 > >& OutBlobs, |
Read all compressed shader blobs from disk in archive-sequential order. | ShaderAuditSession.h | |
void SetExtensionData
(
FName Key, |
Store typed extension data. Replaces any previous value for this key. | ShaderAuditSession.h | |
| ShaderAuditSession.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static int32 AllocateSessionId() |
ShaderAuditSession.h | ||
static bool CloseSession
(
int32 Id |
Remove a session by ID. Returns true if found and removed. | ShaderAuditSession.h | |
static bool DetectSubObject
(
const FString& Path, |
Detect sub-object materials produced by FCompactFullName::AppendString flattening. | ShaderAuditSession.h | |
static TSharedPtr< FShaderAuditSession > FindSession
(
int32 Id |
Find a session by its unique ID. Returns null if not found. | ShaderAuditSession.h | |
static TArray< TSharedPtr< FShaderAuditSession > > & GetSessions() |
The global session list. Both editor subsystem and standalone viewer use this. | ShaderAuditSession.h | |
| ShaderAuditSession.h | |||
static TArray< TSharedPtr< FShaderAuditSession > > LoadFromInventory
(
const FSessionFileInventory& Inventory |
Load from a pre-gathered inventory the primary loading entry point. | ShaderAuditSession.h |