Allow strip index format None if no indexed drawing is done

This commit is contained in:
Dzmitry Malyshau
2021-12-07 18:31:48 -05:00
parent 6af7ca015e
commit c1c855bb98
4 changed files with 0 additions and 13 deletions

View File

@@ -2290,14 +2290,6 @@ impl<A: HalApi> Device<A> {
);
}
if desc.primitive.strip_index_format.is_none() && desc.primitive.topology.is_strip() {
return Err(
pipeline::CreateRenderPipelineError::NoStripIndexFormatForStripTopology {
topology: desc.primitive.topology,
},
);
}
if desc.primitive.unclipped_depth {
self.require_features(wgt::Features::DEPTH_CLIP_CONTROL)?;
}

View File

@@ -324,8 +324,6 @@ pub enum CreateRenderPipelineError {
strip_index_format: Option<wgt::IndexFormat>,
topology: wgt::PrimitiveTopology,
},
#[error("strip index format is None while using the strip topology {topology:?}")]
NoStripIndexFormatForStripTopology { topology: wgt::PrimitiveTopology },
#[error("Conservative Rasterization is only supported for wgt::PolygonMode::Fill")]
ConservativeRasterizationNonFillPolygonMode,
#[error(transparent)]

View File

@@ -157,7 +157,6 @@ impl framework::Example for Example {
primitive: wgpu::PrimitiveState {
polygon_mode: wgpu::PolygonMode::Line,
topology: wgpu::PrimitiveTopology::LineStrip,
strip_index_format: Some(wgpu::IndexFormat::Uint32),
..Default::default()
},
depth_stencil: None,

View File

@@ -99,7 +99,6 @@ impl Example {
}),
primitive: wgpu::PrimitiveState {
topology: wgpu::PrimitiveTopology::TriangleStrip,
strip_index_format: Some(wgpu::IndexFormat::Uint16),
..Default::default()
},
depth_stencil: None,
@@ -294,7 +293,6 @@ impl framework::Example for Example {
}),
primitive: wgpu::PrimitiveState {
topology: wgpu::PrimitiveTopology::TriangleStrip,
strip_index_format: Some(wgpu::IndexFormat::Uint16),
front_face: wgpu::FrontFace::Ccw,
cull_mode: Some(wgpu::Face::Back),
..Default::default()