1#[cfg(feature = "d3d")]
2pub mod d3d;
3pub mod ganesh;
4#[cfg(feature = "gl")]
5pub mod gl;
6mod mutable_texture_state;
7mod types;
8#[cfg(feature = "vulkan")]
9pub mod vk;
10
11pub use ganesh::{
13 context_options::ContextOptions, images, BackendAPI, BackendFormat, BackendRenderTarget,
14 BackendSemaphore, BackendTexture, DirectContext, DirectContextId, DriverBugWorkarounds,
15 FlushInfo, PurgeResourceOptions, RecordingContext, SemaphoresSubmitted, SubmitInfo,
16 SurfaceOrigin, SyncCpu, YUVABackendTextureInfo, YUVABackendTextures,
17};
18
19pub use mutable_texture_state::*;
20pub use types::*;
21
22#[cfg(feature = "metal")]
23pub mod mtl {
24 pub use super::ganesh::mtl::{types::*, BackendContext};
25}
26
27pub mod surfaces {
28 #[cfg(feature = "metal")]
29 pub use super::ganesh::mtl::surface_metal::*;
30 pub use super::ganesh::surface_ganesh::*;
31}
32
33pub mod backend_formats {
34 #[cfg(feature = "d3d")]
35 pub use super::ganesh::d3d::backend_formats::*;
36 #[cfg(feature = "gl")]
37 pub use super::ganesh::gl::backend_formats::*;
38 #[cfg(feature = "metal")]
39 pub use super::ganesh::mtl::backend_formats::*;
40 #[cfg(feature = "vulkan")]
41 pub use super::ganesh::vk::backend_formats::*;
42}
43
44pub mod backend_textures {
45 #[cfg(feature = "d3d")]
46 pub use super::ganesh::d3d::backend_textures::*;
47 #[cfg(feature = "gl")]
48 pub use super::ganesh::gl::backend_textures::*;
49 #[cfg(feature = "metal")]
50 pub use super::ganesh::mtl::backend_textures::*;
51 #[cfg(feature = "vulkan")]
52 pub use super::ganesh::vk::backend_textures::*;
53}
54
55pub mod backend_render_targets {
56 #[cfg(feature = "d3d")]
57 pub use super::ganesh::d3d::backend_render_targets::*;
58 #[cfg(feature = "gl")]
59 pub use super::ganesh::gl::backend_render_targets::*;
60 #[cfg(feature = "metal")]
61 pub use super::ganesh::mtl::backend_render_targets::*;
62 #[cfg(feature = "vulkan")]
63 pub use super::ganesh::vk::backend_render_targets::*;
64}
65
66pub mod backend_semaphores {
67 #[cfg(feature = "d3d")]
68 pub use super::ganesh::d3d::backend_semaphores::*;
69}
70
71pub mod direct_contexts {
72 #[cfg(feature = "d3d")]
73 pub use super::ganesh::d3d::direct_contexts::*;
74 #[cfg(feature = "gl")]
75 pub use super::ganesh::gl::direct_contexts::*;
76 #[cfg(feature = "metal")]
77 pub use super::ganesh::mtl::direct_contexts::*;
78 #[cfg(feature = "vulkan")]
79 pub use super::ganesh::vk::direct_contexts::*;
80}
81
82#[cfg(feature = "gl")]
83pub mod interfaces {
84 #[cfg(feature = "egl")]
85 pub use super::ganesh::gl::make_egl_interface::interfaces::*;
86 #[cfg(target_os = "ios")]
87 pub use super::ganesh::gl::make_ios_interface::interfaces::*;
88 #[cfg(target_os = "macos")]
89 pub use super::ganesh::gl::make_mac_interface::interfaces::*;
90 #[cfg(target_arch = "wasm32")]
91 pub use super::ganesh::gl::make_web_gl_interface::interfaces::*;
92 #[cfg(target_os = "windows")]
93 pub use super::ganesh::gl::make_win_interface::interfaces::*;
94}
95
96#[cfg(test)]
97mod tests {
98 use super::{DirectContext, RecordingContext};
99
100 #[test]
101 fn implicit_deref_conversion_from_direct_context_to_context_to_recording_context() {
102 fn _recording_context(_context: &RecordingContext) {}
103 fn _context(context: &DirectContext) {
104 _recording_context(context)
105 }
106 fn _direct_context(context: &DirectContext) {
107 _context(context)
108 }
109
110 fn _recording_context_mut(_context: &mut RecordingContext) {}
111 fn _context_mut(context: &mut DirectContext) {
112 _recording_context_mut(context)
113 }
114 fn _direct_context_mut(context: &mut DirectContext) {
115 _context_mut(context)
116 }
117 }
118}