Class VfxProgramData
Namespace: ValveResourceFormat.CompiledShader
Assembly: ValveResourceFormat.dll
Represents a compiled VFX shader program with all its associated data.
public class VfxProgramData : IDisposableInheritance
Implements
Constructors
VfxProgramData()
Initializes a new instance of the class.
public VfxProgramData()Fields
MAGIC
Magic number for VCS2 files ("vcs2").
public const int MAGIC = 846422902Field Value
Properties
AdditionalFiles
Gets flags indicating which additional files are present.
public VcsAdditionalFileFlags AdditionalFiles { get; }Property Value
DataReader
Gets or sets the binary reader for this shader data.
public BinaryReader? DataReader { get; set; }Property Value
DynamicComboArray
Gets the dynamic combo configuration array.
public VfxCombo[] DynamicComboArray { get; }Property Value
VfxCombo[]
DynamicComboRules
Gets the dynamic combo constraint rules.
public VfxRule[] DynamicComboRules { get; }Property Value
VfxRule[]
ExtConstantBufferDescriptions
Gets the external constant buffer descriptions.
public ConstantBufferDescription[] ExtConstantBufferDescriptions { get; }Property Value
FeaturesHeader
Gets the features header block for feature files.
public FeaturesHeaderBlock? FeaturesHeader { get; }Property Value
FilenamePath
Gets the file path of the shader.
public string? FilenamePath { get; }Property Value
IsSbox
Gets whether this is an S&box shader.
public bool IsSbox { get; init; }Property Value
ProgramHashes
Gets the MD5 hashes of each program.
public List<Guid> ProgramHashes { get; }Property Value
Resource
The resource this was read from. Starting from VCS version 70.
public Resource? Resource { get; }Property Value
ShaderName
Gets the shader name.
public string? ShaderName { get; }Property Value
StaticComboArray
Gets the static combo definitions. For programs this array holds the feature definitions instead.
public VfxCombo[] StaticComboArray { get; }Property Value
VfxCombo[]
StaticComboCache
Gets the static combo cache for efficiently retrieving parsed static combos.
public StaticComboCache StaticComboCache { get; }Property Value
StaticComboEntries
Gets the static combo entries, keyed by static combo ID.
public SortedDictionary<long, VfxStaticComboVcsEntry> StaticComboEntries { get; }Property Value
SortedDictionary<long, VfxStaticComboVcsEntry>
Remarks
Each entry holds the information needed to locate and decompress its static combo; to save processing, static combos are only decompressed on request.
StaticComboRules
Gets the static combo constraint rules. For programs this array holds the feature rules instead.
public VfxRule[] StaticComboRules { get; }Property Value
VfxRule[]
TextureChannelProcessors
Gets the texture channel processor configurations.
public VfxTextureChannelProcessor[] TextureChannelProcessors { get; }Property Value
VariableDescriptionVersionHash
Gets the variable description version hash, shared by multiple different vcs files.
public Guid VariableDescriptionVersionHash { get; }Property Value
VariableDescriptions
Gets the variable descriptions array.
public VfxVariableDescription[] VariableDescriptions { get; }Property Value
VariableSourceMax
Gets the maximum variable source value; grows as values are added to .
public int VariableSourceMax { get; }Property Value
VcsPlatformType
Gets the VCS platform type (e.g., PC, Vulkan).
public VcsPlatformType VcsPlatformType { get; }Property Value
VcsProgramType
Gets the VCS program type (e.g., vertex shader, pixel shader).
public VcsProgramType VcsProgramType { get; }Property Value
VcsShaderModelType
Gets the VCS shader model type (e.g., 4.0, 5.0, 6.0).
public VcsShaderModelType VcsShaderModelType { get; }Property Value
VcsVersion
Gets the VCS file format version.
public int VcsVersion { get; }Property Value
VsInputSignatures
Gets the vertex shader input signatures.
public VsInputSignature[] VsInputSignatures { get; }Property Value
Methods
Dispose()
Releases streams, readers, and any cached combo data.
public void Dispose()Dispose(bool)
Releases the unmanaged resources used by the and optionally releases the managed resources.
protected virtual void Dispose(bool disposing)Parameters
disposing bool
True to release both managed and unmanaged resources; false to release only unmanaged resources.
GetDynamicComboConfig(long)
Gets the configuration state for a dynamic combo.
public int[] GetDynamicComboConfig(long dynamicComboId)Parameters
dynamicComboId long
The dynamic combo ID.
Returns
int[]
The configuration state array.
GetStaticCombo(long)
Retrieves and unserializes a static combo by its ID. This decompresses the combo on every call; use for repeated access.
public VfxStaticComboData GetStaticCombo(long id)Parameters
id long
The static combo ID.
Returns
The unserialized static combo data.
PrintSummary(IndentedTextWriter?, VfxProgramData?)
Prints a summary of the shader program data to the console or a provided writer.
public void PrintSummary(IndentedTextWriter? outputWriter = null, VfxProgramData? featuresProgram = null)Parameters
outputWriter IndentedTextWriter?
Optional indented text writer for output.
featuresProgram VfxProgramData?
Optional features program for resolving feature names.
Read(string)
Opens and reads the given filename. The file is held open until the object is disposed.
public void Read(string filenamepath)Parameters
filenamepath string
The file to open and read.
Read(string, Stream)
Reads the given .
public void Read(string filenamepath, Stream input)Parameters
filenamepath string
The filename .
input Stream
The input to read from.

