use super::*;
#[derive(Data)]
pub struct WebGpuChartBackend {
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) canvas: HtmlCanvasElement,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) device: JsValue,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) queue: JsValue,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) context: JsValue,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) format: String,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) api: WebGpuApi,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) encoder_api: Option<WebGpuEncoderApi>,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) pass_api: Option<WebGpuPassApi>,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) solid_pipeline: JsValue,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) textured_pipeline: JsValue,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) texture_layout: JsValue,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) sampler: JsValue,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) uniform_buffer: JsValue,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) uniform_bind_group: JsValue,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) pass_descriptor: JsValue,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) pass_attachment: JsValue,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) atlas: WebGpuAtlas,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) solid_buffer: WebGpuBuffer,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) solid_index_buffer: WebGpuBuffer,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) textured_buffer: WebGpuBuffer,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) textured_index_buffer: WebGpuBuffer,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) batches: Vec<WebGpuBatch>,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) images: Vec<WebGpuImage>,
#[get(pub(crate), type(copy))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) next_image_id: u32,
#[get(pub(crate), type(copy))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) atlas_glyphs: usize,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) fingerprint: Option<u64>,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) tessellator: Tessellator,
#[get(pub(crate), type(copy))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) width: f64,
#[get(pub(crate), type(copy))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) height: f64,
#[get(pub(crate), type(copy))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) dpr: f64,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) solid_vertices: Vec<u8>,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) solid_indices: Vec<u32>,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) textured_vertices: Vec<u8>,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) textured_indices: Vec<u32>,
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) clips: Vec<WebGpuScissor>,
}
#[derive(Data)]
pub(crate) struct WebGpuBuffer {
#[get(pub(crate))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) buffer: Option<JsValue>,
#[get(pub(crate), type(copy))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) capacity: u32,
}
#[derive(Clone, Debug)]
pub(crate) struct WebGpuAtlas {
pub(crate) texture: Option<JsValue>,
pub(crate) bind_group: Option<JsValue>,
pub(crate) width: u32,
pub(crate) height: u32,
}
pub(crate) struct WebGpuImage {
pub(crate) element: JsValue,
pub(crate) id: u32,
pub(crate) texture: Option<JsValue>,
pub(crate) bind_group: Option<JsValue>,
pub(crate) width: u32,
pub(crate) height: u32,
pub(crate) source: String,
}
pub(crate) struct WebGpuBatch {
pub(crate) kind: WebGpuBatchKind,
pub(crate) first_index: u32,
pub(crate) index_count: u32,
pub(crate) bind_group: Option<JsValue>,
pub(crate) scissor: Option<WebGpuScissor>,
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub(crate) struct WebGpuScissor {
pub(crate) x: u32,
pub(crate) y: u32,
pub(crate) width: u32,
pub(crate) height: u32,
}
#[derive(Clone)]
pub(crate) struct WebGpuApi {
pub(crate) create_command_encoder: Function,
pub(crate) submit: Function,
pub(crate) write_buffer: Function,
pub(crate) copy_external_image: Function,
pub(crate) get_current_texture: Function,
}
#[derive(Clone)]
pub(crate) struct WebGpuEncoderApi {
pub(crate) begin_render_pass: Function,
pub(crate) finish_encoder: Function,
}
#[derive(Clone)]
pub(crate) struct WebGpuPassApi {
pub(crate) set_pipeline: Function,
pub(crate) set_vertex_buffer: Function,
pub(crate) set_index_buffer: Function,
pub(crate) set_bind_group: Function,
pub(crate) set_scissor_rect: Function,
pub(crate) draw_indexed: Function,
pub(crate) end_pass: Function,
}
#[derive(Data)]
pub(crate) struct GpuHasher {
#[get(pub(crate), type(copy))]
#[get_mut(pub(crate))]
#[set(pub(crate))]
pub(crate) state: u64,
}