Expand description
Mabda — GPU foundation layer for AGNOS
Mabda (Arabic: مبدأ — origin, principle, starting point) provides the shared GPU foundation that all AGNOS GPU consumers build upon. It owns the wgpu dependency and exposes device lifecycle, buffer management, compute dispatch, texture handling, profiling, and capability detection.
§Features
graphics— render targets, texture loading, surface helperscompute— compute pipeline, storage buffers, dispatch utilitiesfull— enables bothgraphicsandcompute
§Consumers
- soorat — rendering engine (sprites, PBR, shadows, post-fx)
- rasa — image editor (GPU compute filters)
- ranga — image processing library (GPU pixel ops)
- bijli — electromagnetic simulation (FDTD compute)
- aethersafta — desktop compositor (GPU compositing)
- kiran — game engine (via soorat)
§Modules
- Core:
context,error,capabilities,color,buffer,typed_buffer,debug,resource - Compute:
compute(feature-gated) - Graphics:
texture,render_target,render_pipeline,render_pass,vertex,sampler,surface,depth,blend,bind_group,instancing(feature-gated) - Caching:
shader,pipeline_cache - Profiling:
profiler
Re-exports§
pub use capabilities::GpuCapabilities;pub use color::Color;pub use context::GpuContext;pub use context::GpuContextBuilder;pub use debug::DebugScope;pub use error::GpuError;pub use error::Result;pub use resource::FrameResources;pub use bind_group_cache::BindGroupCache;pub use buffer::GrowableBuffer;pub use buffer::PendingReadback;pub use buffer::create_dispatch_indirect_buffer;pub use buffer::create_staging_buffer;pub use buffer::create_storage_buffer;pub use buffer::create_storage_buffer_empty;pub use buffer::create_uniform_buffer;pub use buffer::read_buffer;pub use buffer::read_buffer_async;pub use buffer::read_buffer_typed;pub use pipeline_cache::PipelineCache;pub use shader::ShaderCache;pub use compute::ComputePipeline;pub use compute::PingPongBuffer;pub use compute::validate_dispatch;pub use compute::workgroups_1d;pub use compute::workgroups_2d;pub use bind_group::BindGroupLayoutBuilder;pub use blend::BlendPreset;pub use blend::blend_state;pub use buffer::create_draw_indexed_indirect_buffer;pub use buffer::create_draw_indirect_buffer;pub use buffer::create_index_buffer;pub use buffer::create_vertex_buffer;pub use depth::DepthTexture;pub use instancing::InstanceBuffer;pub use instancing::InstanceData;pub use render_pass::RenderPassBuilder;pub use render_pipeline::DrawCommand;pub use render_pipeline::RenderPipeline;pub use render_pipeline::RenderPipelineBuilder;pub use render_target::RenderTarget;pub use render_target::RenderTargetBuilder;pub use sampler::SamplerPreset;pub use sampler::create_sampler;pub use sampler::create_sampler_custom;pub use surface::PresentModePreference;pub use surface::SurfaceState;pub use texture::CubemapTexture;pub use texture::Texture;pub use texture::TextureCache;pub use texture::copy_texture_to_texture;pub use texture::create_default_sampler;pub use texture::mip_level_count;pub use texture::validate_dimensions;pub use vertex::SkinnedVertex3D;pub use vertex::Vertex2D;pub use vertex::Vertex3D;pub use vertex::VertexLayout;pub use typed_buffer::StorageBuffer;pub use typed_buffer::UniformBuffer;pub use profiler::FrameProfiler;pub use profiler::GpuTimestamps;pub use profiler::PassTiming;pub use profiler::ProfileScope;
Modules§
- bind_
group - Bind group layout builder with preset entry helpers.
- bind_
group_ cache - Bind group caching — deduplicates bind group creation by caller-provided key.
- blend
- Blend state presets for common rendering modes.
- buffer
- GPU buffer creation and readback utilities.
- capabilities
- GPU capability reporting — feature detection and limit queries.
- color
- Color types and utilities.
- compute
- Compute shader pipeline — general-purpose GPU compute.
- context
- GPU device and surface management.
- debug
- Debug labels and marker groups for GPU command encoders.
- depth
- Depth and stencil texture management.
- error
- Error types for mabda GPU operations.
- instancing
- Instanced rendering — per-instance transform and color data.
- pipeline_
cache - Pipeline caching — deduplicates GPU pipeline creation by descriptor hash.
- profiler
- Frame profiling — CPU timing and GPU timestamp queries.
- render_
pass - Render pass builder for fluent attachment configuration.
- render_
pipeline - Render pipeline abstraction.
- render_
target - Offscreen render targets (framebuffers).
- resource
- GPU resource lifecycle helpers.
- sampler
- Sampler presets and creation helpers.
- shader
- Shader module caching.
- surface
- Surface lifecycle management.
- texture
- Texture loading and management.
- typed_
buffer - Typed GPU buffer wrappers with alignment enforcement.
- vertex
- Vertex types and buffer layout descriptors.