1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
//! # EX Tier (Tier 1) - Explicit, Ergonomic Managers
//!
//! The EX (Explicit) tier provides safe, ergonomic managers built on CORE tier primitives.
//! This tier achieves **4x-8x code reduction** while maintaining zero-cost abstractions
//! and full explicit configuration control.
//!
//! ## Philosophy
//!
//! - **Safe**: Correct drop order guaranteed by Rust's ownership system
//! - **Explicit**: No hidden defaults or magic behavior - you configure everything
//! - **Flexible**: Drop down to CORE tier anytime for advanced features
//! - **Ergonomic**: Fluent APIs and helper utilities reduce boilerplate
//! - **Zero-cost**: All abstractions inline away to raw Vulkan calls
//!
//! ## Key Components
//!
//! The EX tier consists of 3 core managers and 3 helper modules:
//!
//! ### Core Managers
//!
//! | Component | Purpose | LOC | Tests |
//! |-----------|---------|-----|-------|
//! | `RuntimeManager` | Instance/Device/Queue/Sync/Command lifecycle | 530 | 4 |
//! | `ShaderManager` | Shader compilation, reflection, and pipelines | 470 | 4 |
//! | `PipelineBuilder` | Fluent graphics pipeline configuration | 490 | - |
//!
//! ### Helper Utilities
//!
//! | Module | Purpose | LOC | Tests |
//! |--------|---------|-----|-------|
//! | `helpers::buffer` | Vertex, uniform, storage buffer creation | 350 | 5 |
//! | `helpers::image` | Textures, render targets, layout transitions | 476 | 6 |
//! | `helpers::descriptor` | Set layouts, pools, batched updates | 545 | 6 |
//!
//! ## Code Reduction
//!
//! EX tier achieves significant code reduction over CORE tier:
//!
//! - **Triangle**: 400 lines → 100 lines (4x reduction)
//! - **Textured Quad**: 450 lines → 55 lines (8x reduction)
//! - **Buffer Creation**: 30 lines → 1 line (30x reduction)
//! - **Descriptor Sets**: 150 lines → 20 lines (7.5x reduction)
//!
//! ## Usage Example
//!
//! ```rust,no_run
//! use shdrlib::ex::*;
//! use shdrlib::core::ShaderStage;
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Setup (5 lines vs 80+ in CORE)
//! let mut runtime = RuntimeManager::new(RuntimeConfig::default())?;
//! let device = runtime.device();
//! let mut shaders = ShaderManager::new(device)?;
//!
//! // Load shaders (3 lines vs 30+ in CORE)
//! let vert_id = shaders.add_shader(VERTEX_SHADER, ShaderStage::Vertex, "triangle_vert")?;
//! let frag_id = shaders.add_shader(FRAGMENT_SHADER, ShaderStage::Fragment, "triangle_frag")?;
//!
//! // Build pipeline (5 lines vs 50+ in CORE)
//! let pipeline_id = shaders.build_pipeline(
//! PipelineBuilder::new()
//! .vertex_shader(shaders.get_shader(vert_id)?.handle(), "main")
//! .fragment_shader(shaders.get_shader(frag_id)?.handle(), "main")
//! .color_attachment_formats(vec![ash::vk::Format::R8G8B8A8_UNORM]),
//! "triangle_pipeline"
//! )?;
//!
//! // Cleanup is automatic!
//! # Ok(())
//! # }
//! # const VERTEX_SHADER: &str = "#version 450\nvoid main() {}";
//! # const FRAGMENT_SHADER: &str = "#version 450\nvoid main() {}";
//! ```
//!
//! ## When to Use EX
//!
//! **Use EX when:**
//! - Building applications, games, or rendering tools
//! - Want safety guarantees with explicit control
//! - Need 4x-8x code reduction over raw Vulkan
//! - Require type-safe resource management
//! - Want zero-cost abstractions with full configuration
//!
//! **Don't use EX when:**
//! - Need absolute control over every detail (use CORE tier)
//! - Rapid prototyping with minimal setup (use EZ tier when available)
//! - Building custom framework with different patterns (use CORE tier)
pub use ;
pub use *;
pub use PipelineBuilder;
pub use ;
pub use ShaderManager;
// Re-export CORE for dropping down when needed
pub use cratecore;