Navigation
API > API/Plugins > API/Plugins/ShaderAuditCore
A database that maps OutputHash -> shader metadata (and optionally bytecode).
Designed for two-phase use:
Import: Load .ushaderbytecode headers (fast, small memory footprint). This gives size/frequency per shader.
(Future) On-demand bytecode: Load individual shader bytecodes for disassembly, clustering, diffing.
The OutputHash is the common key between .shk files (FStableShaderKeyAndValue::OutputHash) and .ushaderbytecode files (FSerializedShaderArchive::ShaderHashes[i]).
Thread safety: Import methods are not thread-safe. Call from game thread only. After import, Find() is safe for concurrent reads.
| Name | FShaderBytecodeDatabase |
| Type | class |
| Header File | /Engine/Plugins/Developer/ShaderToolkit/Source/ShaderAuditCore/Public/ShaderBytecodeDatabase.h |
| Include Path | #include "ShaderBytecodeDatabase.h" |
Syntax
class FShaderBytecodeDatabase
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Archives | TArray< FShaderArchiveSource > | ShaderBytecodeDatabase.h | ||
| Entries | TMap< FShaderHash, FShaderBytecodeInfo > | ShaderBytecodeDatabase.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
const FShaderBytecodeInfo * Find
(
const FShaderHash& Hash |
Look up a shader by OutputHash. Returns nullptr if not found. | ShaderBytecodeDatabase.h | |
const TArray< FShaderArchiveSource > & GetArchives() |
Access to the archive sources (for on-demand bytecode loading). | ShaderBytecodeDatabase.h | |
int32 ImportDirectory
(
const FString& DirectoryPath |
Load headers from all .ushaderbytecode files in a directory. Returns number of files loaded. | ShaderBytecodeDatabase.h | |
int32 ImportShaderArchive
(
const FString& FilePath |
Load a single .ushaderbytecode file's header. Returns number of new shaders added. | ShaderBytecodeDatabase.h | |
int32 Num() |
Total number of unique shaders in the database. | ShaderBytecodeDatabase.h | |
int32 NumArchives() |
Total number of loaded archive files. | ShaderBytecodeDatabase.h | |
int32 ReadAllCompressedBlobs
(
TMap< FShaderHash, TArray< uint8 > >& OutBlobs, |
Read all compressed shader blobs from disk in archive-sequential order. | ShaderBytecodeDatabase.h | |
void Reset() |
Clear all data. | ShaderBytecodeDatabase.h |