1use std::ops::Range;
2
3use crate::{bind_group::BindGroup, buffer::BufferSlice, render_pipeline::RenderPipeline};
4
5#[derive(Debug, Clone, Hash, PartialEq, Eq)]
7pub struct RasteriserState {
8 pub front_face: wgpu::FrontFace,
9 pub cull_mode: Option<wgpu::Face>,
10 pub depth_write: bool,
11 pub depth_compare: wgpu::CompareFunction,
12 pub polygon_mode: wgpu::PolygonMode,
13}
14
15impl Default for RasteriserState {
16 fn default() -> Self {
17 Self {
18 front_face: wgpu::FrontFace::Ccw,
19 cull_mode: None,
20 depth_write: true,
21 depth_compare: wgpu::CompareFunction::LessEqual,
22 polygon_mode: wgpu::PolygonMode::Fill,
23 }
24 }
25}
26
27#[derive(Debug)]
29pub struct DrawCall {
30 pub bind_groups: Vec<BindGroup>,
31 pub bind_group_offsets: Vec<Vec<u32>>,
32 pub pipeline: RenderPipeline,
33 pub vertices: Vec<BufferSlice>,
37 pub indices: Option<BufferSlice>,
41 pub element_range: Range<usize>,
43 pub instance_range: Range<usize>,
47 pub rasteriser_state: RasteriserState,
49}