[WebGPU] validate polygon mode (#4196)

This commit is contained in:
Teodor Tanasoaia
2023-10-04 14:27:27 +02:00
committed by GitHub
parent 32b761a591
commit 7d1005faad
2 changed files with 13 additions and 0 deletions

View File

@@ -161,6 +161,7 @@ By @teoxoy in [#4185](https://github.com/gfx-rs/wgpu/pull/4185)
#### WebGPU
- Ensure that limit requests and reporting is done correctly. By @OptimisticPeach in [#4107](https://github.com/gfx-rs/wgpu/pull/4107)
- Validate usage of polygon mode. By @teoxoy in [#4196](https://github.com/gfx-rs/wgpu/pull/4196)
#### Testing

View File

@@ -343,6 +343,18 @@ fn map_primitive_state(primitive: &wgt::PrimitiveState) -> web_sys::GpuPrimitive
//TODO:
//mapped.unclipped_depth(primitive.unclipped_depth);
match primitive.polygon_mode {
wgt::PolygonMode::Fill => {}
wgt::PolygonMode::Line => panic!(
"{:?} is not enabled for this backend",
wgt::Features::POLYGON_MODE_LINE
),
wgt::PolygonMode::Point => panic!(
"{:?} is not enabled for this backend",
wgt::Features::POLYGON_MODE_POINT
),
}
mapped
}