//! Xenos GPU emulation for xenia-rs.
//!
//! Modules:
//! - [`pm4`]: packet format decoder + Type-3 opcode set.
//! - [`ring_view`]: ring-buffer bookkeeping (base/size/read/write pointers).
//! - [`register_file`]: 0x6000-entry register array backing the CP + state.
//! - [`gpu_system`]: top-level `GpuSystem` + PM4 executor running one packet
//!   per call (see the plan's P2 for the design rationale).
//!
//! Legacy module `ring_drain` and `command_processor` are retained while P3+
//! migrations finish; they will be removed once every caller is on
//! [`gpu_system::GpuSystem`].

pub mod command_processor;
pub mod draw_capture;
pub mod draw_state;
pub mod edram;
pub mod gpu_system;
pub mod handle;
pub mod mmio_region;
pub mod pm4;
pub mod primitive;
pub mod prof;
pub mod register_file;
pub mod ring_drain;
pub mod ring_view;
pub mod render_target_cache;
pub mod resolve;
pub mod shader_metrics;
pub mod shaders;
pub mod texture_cache;
pub mod tiled_address;
pub mod translator;
pub mod ucode;
pub mod xenos_constants;

pub use gpu_system::{
    ExecOutcome, GpuBlock, GpuMmio, GpuStats, GpuSystem, InterruptSource, PendingInterrupt,
    PHYSICAL_BACKING_BASE, ShaderBlob, SwapNotification, WaitCmp, physical_to_backing,
};
pub use handle::{
    DrainReply, GpuBackend, GpuCommand, GpuDigestSnapshot, GpuHandle, GpuWorker,
    shutdown_and_join_with_timeout, spawn_gpu_worker, spawn_noop_worker,
};
pub use mmio_region::build_region as build_mmio_region;
pub use pm4::{
    PacketHeader, PacketKind, PM4_INTERRUPT, PM4_NOP, PM4_XE_SWAP, SWAP_SIGNATURE,
    type3_opcode_name,
};
pub use ring_drain::{DrainResult, drain};
pub use ring_view::RingBufferView;
