Skip to main content

Module fxc

Module fxc 

Source
Expand description

Compiled shader containers (.fxc) of the Warscape games.

These files, under fxc/ in the packs, hold one compiled DirectX shader each, with the defines and includes it was compiled with. Newer games use HlslCompiled instead.

§File Format

All values are little endian:

[u32]      signature (0x075BCD15)
[u32]      version
[u32]      define count
[...]      defines: name and value, each a u32 size and that many bytes, NUL included
[u32]      timestamp of the source
[u32]      include count
[...]      includes: path (u16 size and that many bytes, no NUL), u32 hash
[...]      DXBC shader blob, up to the end of the file

Only version 4 is known, used by Attila’s DX11 shaders.

§Usage

ⓘ
use rpfm_lib::files::fxc::Fxc;
use rpfm_lib::files::Decodeable;

let fxc = Fxc::decode(&mut data, &None)?;
let dxbc = fxc.shader();

Structs§

Fxc
A compiled shader with the defines and includes it was compiled with.
FxcDefine
A preprocessor define of a compiled shader.
FxcInclude
A file included by the source of a compiled shader.

Constants§

EXTENSION
File extension of compiled shader containers.
SIGNATURE
Signature at the start of every fxc file.