[WebGPU] validate polygon mode (#4196)

This commit is contained in:
Teodor Tanasoaia authored and GitHub committed 2023-10-04 12:27:27 +00:00
1 parent 32b761a591
commit 7d1005faad
2 files changed
+13

No files matched your search

+1
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
+12
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
}