use std::ops::Range;
use crate::{bind_group::BindGroup, buffer::BufferSlice, render_pipeline::RenderPipeline};
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
pub struct RasteriserState {
pub front_face: wgpu::FrontFace,
pub cull_mode: Option<wgpu::Face>,
pub depth_write: bool,
pub depth_compare: wgpu::CompareFunction,
pub polygon_mode: wgpu::PolygonMode,
}
impl Default for RasteriserState {
fn default() -> Self {
Self {
front_face: wgpu::FrontFace::Ccw,
cull_mode: None,
depth_write: true,
depth_compare: wgpu::CompareFunction::LessEqual,
polygon_mode: wgpu::PolygonMode::Fill,
}
}
}
#[derive(Debug)]
pub struct DrawCall {
pub bind_groups: Vec<BindGroup>,
pub bind_group_offsets: Vec<Vec<u32>>,
pub pipeline: RenderPipeline,
pub vertices: Vec<BufferSlice>,
pub indices: Option<BufferSlice>,
pub element_range: Range<usize>,
pub instance_range: Range<usize>,
pub rasteriser_state: RasteriserState,
}