lib.rs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 bvh;
  9. pub mod dxbc;
  10. pub mod dxil;
  11. pub mod emit;
  12. pub mod gfx10;
  13. pub mod io;
  14. pub mod ir;
  15. pub mod native;
  16. pub mod resource;
  17. pub mod spill;
  18. pub mod structure;
  19. pub use dxbc::{Container, FourCC, Part};
  20. pub use dxil::{DxilProgram, ShaderKind, XboxExtras};
  21. pub use native::{
  22. HwStage, NativeProgram, ResourceType, RootParam, RootType, UsedResource, native_programs,
  23. };
  24. #[derive(Debug, thiserror::Error, PartialEq, Eq)]
  25. pub enum ShaderError {
  26. #[error("not a DXBC container")]
  27. NotDxbc,
  28. #[error("malformed shader: {0}")]
  29. Malformed(&'static str),
  30. #[error("GFX10 code at {offset:#x}: {reason}")]
  31. Isa { offset: usize, reason: &'static str },
  32. /// Valid code the translator cannot handle yet: an opcode name or a construct.
  33. #[error("GFX10 code at {offset:#x}: {what} is not supported")]
  34. Unsupported { offset: usize, what: &'static str },
  35. }