use super::*;
#[derive(Clone, Copy, Data, Debug, Default, Eq, Hash, New, PartialEq)]
pub struct GpuGlyphPlacement {
#[get(type(copy))]
pub(crate) x: u32,
#[get(type(copy))]
pub(crate) y: u32,
#[get(type(copy))]
pub(crate) width: u32,
#[get(type(copy))]
pub(crate) height: u32,
#[get(type(copy))]
pub(crate) uv_rect: [u16; 4],
}
#[derive(Clone, Data, Debug)]
pub struct IncrementalGpuGlyphAtlas {
#[get(type(copy))]
pub(crate) width: u32,
#[get(type(copy))]
pub(crate) height: u32,
pub(crate) pixels: Vec<u8>,
#[get(type(copy))]
pub(crate) cursor_x: u32,
#[get(type(copy))]
pub(crate) cursor_y: u32,
#[get(type(copy))]
pub(crate) shelf_height: u32,
pub(crate) placements: HashMap<GlyphKey, GpuGlyphPlacement>,
pub(crate) pending_dirty_rects: Vec<PixelDirtyRect>,
pub(crate) submission_dirty_rects: Vec<PixelDirtyRect>,
#[get(type(copy))]
pub(crate) synced_revision: u64,
#[get(type(copy))]
pub(crate) synced_entry_count: usize,
#[get(type(copy))]
pub(crate) needs_full_upload: bool,
#[get(type(copy))]
pub(crate) submission_needs_full_upload: bool,
#[get(type(copy))]
pub(crate) total_uploaded_bytes: u64,
}
#[derive(Clone, Copy, Data, Debug, Default, Eq, Hash, New, PartialEq)]
pub struct GpuImagePlacement {
#[get(type(copy))]
pub(crate) x: u32,
#[get(type(copy))]
pub(crate) y: u32,
#[get(type(copy))]
pub(crate) width: u32,
#[get(type(copy))]
pub(crate) height: u32,
#[get(type(copy))]
pub(crate) uv_rect: [u16; 4],
}
#[derive(Clone, Data, Debug)]
pub struct IncrementalGpuImageAtlas {
#[get(type(copy))]
pub(crate) width: u32,
#[get(type(copy))]
pub(crate) height: u32,
pub(crate) pixels: Vec<u8>,
#[get(type(copy))]
pub(crate) cursor_x: u32,
#[get(type(copy))]
pub(crate) cursor_y: u32,
#[get(type(copy))]
pub(crate) shelf_height: u32,
pub(crate) placements: HashMap<u64, GpuImagePlacement>,
pub(crate) submission_dirty_rects: Vec<PixelDirtyRect>,
#[get(type(copy))]
pub(crate) submission_needs_full_upload: bool,
#[get(type(copy))]
pub(crate) revision: u64,
}
#[derive(Clone, Data, Debug, Default, PartialEq)]
pub struct RenderGraphFramePlan {
pub(crate) passes: Vec<RenderGraphPassKind>,
#[get(type(copy))]
pub(crate) width: u32,
#[get(type(copy))]
pub(crate) height: u32,
#[get(type(copy))]
pub(crate) dirty_span_count: usize,
#[get(type(copy))]
pub(crate) atlas_dirty_rect_count: usize,
#[get(type(copy))]
pub(crate) blur_pass_count: usize,
#[get(type(copy))]
pub(crate) external_texture_handle: usize,
}
#[derive(Clone, Data, Debug, Default, PartialEq)]
pub struct RenderGraphExecutionReceipt {
pub(crate) executed_passes: Vec<RenderGraphPassKind>,
#[get(type(copy))]
pub(crate) submitted_fence_id: u64,
#[get(type(copy))]
pub(crate) observed_completed_fence_id: u64,
#[get(type(copy))]
pub(crate) dirty_upload_bytes: usize,
#[get(type(copy))]
pub(crate) full_upload_bytes: usize,
#[get(type(copy))]
pub(crate) atlas_upload_bytes: usize,
#[get(type(copy))]
pub(crate) blur_passes_executed: usize,
#[get(type(copy))]
pub(crate) draw_calls: usize,
#[get(type(copy))]
pub(crate) gpu_compute_ns: u64,
#[get(type(copy))]
pub(crate) gpu_render_ns: u64,
}
#[derive(Clone, Copy, Data, Debug, Default, PartialEq)]
pub struct RenderGraphFrameTarget {
#[get(type(copy))]
pub(crate) width: u32,
#[get(type(copy))]
pub(crate) height: u32,
#[get(type(copy))]
pub(crate) clear_color: Color,
#[get(type(copy))]
pub(crate) external_texture_handle: usize,
}
#[derive(Clone, Copy, Data, Debug, Default, Eq, Hash, New, PartialEq)]
pub struct RenderGraphPlanCounts {
#[get(type(copy))]
pub(crate) has_compute_layout: bool,
#[get(type(copy))]
pub(crate) dirty_span_count: usize,
#[get(type(copy))]
pub(crate) atlas_dirty_rect_count: usize,
#[get(type(copy))]
pub(crate) blur_pass_count: usize,
}
#[derive(Clone, Data, Debug)]
pub struct RenderGraph {
#[get(type(copy))]
pub(crate) max_frames_in_flight: u32,
pub(crate) dirty_coalescer: DirtySpanCoalescer,
pub(crate) gpu_glyph_atlas: IncrementalGpuGlyphAtlas,
pub(crate) last_plan: RenderGraphFramePlan,
pub(crate) last_receipt: RenderGraphExecutionReceipt,
#[get(type(copy))]
pub(crate) executed_frames: u64,
}