26 lines
926 B
Rust
26 lines
926 B
Rust
//! Xbox Series shaders to host shaders.
|
|||
|
|
//!
|
||
|
|
//! An Xbox Series shader is a standard DXBC container ([`dxbc`]). Its `DXIL`
|
||
|
|
//! part ([`dxil`]) may carry Xbox additions around the LLVM bitcode: an
|
||
|
|
//! `XDAT` table before it indexing blobs after it, among them `xbop`
|
||
|
|
//! (compiler options) and the zlib-compressed GFX10 code. The bitcode may use
|
||
|
|
//! console-only intrinsics, so the GFX10 code is translated in general.
|
||
|
|
|
||
|
|
pub mod dxbc;
|
||
|
|
pub mod dxil;
|
||
|
|
pub mod gfx10;
|
||
|
|
pub mod native;
|
||
|
|
|
||
|
|
pub use dxbc::{Container, FourCC, Part};
|
||
|
|
pub use dxil::{DxilProgram, ShaderKind, XboxExtras};
|
||
|
|
pub use native::{HwStage, NativeProgram, native_programs};
|
||
|
|
|
||
|
|
#[derive(Debug, thiserror::Error, PartialEq, Eq)]
|
||
|
|
pub enum ShaderError {
|
||
|
|
#[error("not a DXBC container")]
|
||
|
|
NotDxbc,
|
||
|
|
#[error("malformed shader: {0}")]
|
||
|
|
Malformed(&'static str),
|
||
|
|
#[error("GFX10 code at {offset:#x}: {reason}")]
|
||
|
|
Isa { offset: usize, reason: &'static str },
|
||
|
|
}
|