lib.rs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //! Xbox Series shaders to host shaders.
  2. //!
  3. //! An Xbox Series shader is a standard DXBC container ([`dxbc`]). Its `DXIL`
  4. //! part ([`dxil`]) may carry Xbox additions around the LLVM bitcode: an
  5. //! `XDAT` table before it indexing blobs after it, among them `xbop`
  6. //! (compiler options) and the zlib-compressed GFX10 code. The bitcode may use
  7. //! console-only intrinsics, so the GFX10 code is translated in general.
  8. pub mod dxbc;
  9. pub mod dxil;
  10. pub mod emit;
  11. pub mod gfx10;
  12. pub mod io;
  13. pub mod ir;
  14. pub mod native;
  15. pub mod resource;
  16. pub mod structure;
  17. pub use dxbc::{Container, FourCC, Part};
  18. pub use dxil::{DxilProgram, ShaderKind, XboxExtras};
  19. pub use native::{
  20. HwStage, NativeProgram, ResourceType, RootParam, RootType, UsedResource, native_programs,
  21. };
  22. #[derive(Debug, thiserror::Error, PartialEq, Eq)]
  23. pub enum ShaderError {
  24. #[error("not a DXBC container")]
  25. NotDxbc,
  26. #[error("malformed shader: {0}")]
  27. Malformed(&'static str),
  28. #[error("GFX10 code at {offset:#x}: {reason}")]
  29. Isa { offset: usize, reason: &'static str },
  30. /// Valid code the translator cannot handle yet: an opcode name or a construct.
  31. #[error("GFX10 code at {offset:#x}: {what} is not supported")]
  32. Unsupported { offset: usize, what: &'static str },
  33. }