From aa96ba0880fe584b7ed291884b69f7aa1ab85290 Mon Sep 17 00:00:00 2001 From: teoxoy <28601907+teoxoy@users.noreply.github.com> Date: Fri, 11 Aug 2023 15:59:10 +0200 Subject: [PATCH 1/3] DX12 doesn't support `Features::POLYGON_MODE_POINT` --- wgpu-hal/src/dx12/adapter.rs | 1 - wgpu-hal/src/dx12/conv.rs | 10 +++++----- wgpu-types/src/lib.rs | 1 - 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/wgpu-hal/src/dx12/adapter.rs b/wgpu-hal/src/dx12/adapter.rs index 27e8e8e05f..eb94d4eb11 100644 --- a/wgpu-hal/src/dx12/adapter.rs +++ b/wgpu-hal/src/dx12/adapter.rs @@ -242,7 +242,6 @@ impl super::Adapter { | wgt::Features::ADDRESS_MODE_CLAMP_TO_BORDER | wgt::Features::ADDRESS_MODE_CLAMP_TO_ZERO | wgt::Features::POLYGON_MODE_LINE - | wgt::Features::POLYGON_MODE_POINT | wgt::Features::VERTEX_WRITABLE_STORAGE | wgt::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES | wgt::Features::TIMESTAMP_QUERY diff --git a/wgpu-hal/src/dx12/conv.rs b/wgpu-hal/src/dx12/conv.rs index 7b39e98ad2..8b44ae9c4b 100644 --- a/wgpu-hal/src/dx12/conv.rs +++ b/wgpu-hal/src/dx12/conv.rs @@ -213,12 +213,12 @@ pub fn map_topology( pub fn map_polygon_mode(mode: wgt::PolygonMode) -> d3d12_ty::D3D12_FILL_MODE { match mode { - wgt::PolygonMode::Point => { - log::error!("Point rasterization is not supported"); - d3d12_ty::D3D12_FILL_MODE_WIREFRAME - } - wgt::PolygonMode::Line => d3d12_ty::D3D12_FILL_MODE_WIREFRAME, wgt::PolygonMode::Fill => d3d12_ty::D3D12_FILL_MODE_SOLID, + wgt::PolygonMode::Line => d3d12_ty::D3D12_FILL_MODE_WIREFRAME, + wgt::PolygonMode::Point => panic!( + "{:?} is not enabled for this backend", + wgt::Features::POLYGON_MODE_POINT + ), } } diff --git a/wgpu-types/src/lib.rs b/wgpu-types/src/lib.rs index a3dc1906c6..8b493968d0 100644 --- a/wgpu-types/src/lib.rs +++ b/wgpu-types/src/lib.rs @@ -679,7 +679,6 @@ bitflags::bitflags! { /// This allows only drawing the vertices of polygons/triangles instead of filled /// /// Supported platforms: - /// - DX12 /// - Vulkan /// /// This is a native only feature. From af51df9cf7ba0031e4350ea8a789c1098829b49c Mon Sep 17 00:00:00 2001 From: teoxoy <28601907+teoxoy@users.noreply.github.com> Date: Fri, 11 Aug 2023 16:00:01 +0200 Subject: [PATCH 2/3] GLES transform note into panic on non fill polygon mode --- wgpu-hal/src/gles/conv.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/wgpu-hal/src/gles/conv.rs b/wgpu-hal/src/gles/conv.rs index 86ff3b60b0..dd5d764c6a 100644 --- a/wgpu-hal/src/gles/conv.rs +++ b/wgpu-hal/src/gles/conv.rs @@ -279,8 +279,18 @@ pub fn map_primitive_topology(topology: wgt::PrimitiveTopology) -> u32 { } pub(super) fn map_primitive_state(state: &wgt::PrimitiveState) -> super::PrimitiveState { - //Note: state.polygon_mode is not supported, see `Features::POLYGON_MODE_LINE` and - //`Features::POLYGON_MODE_POINT` + match state.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 + ), + } + super::PrimitiveState { //Note: we are flipping the front face, so that // the Y-flip in the generated GLSL keeps the same visibility. From 21bcb49f026d586327d0d83ba2c675b4d17356e8 Mon Sep 17 00:00:00 2001 From: teoxoy <28601907+teoxoy@users.noreply.github.com> Date: Fri, 11 Aug 2023 16:01:58 +0200 Subject: [PATCH 3/3] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8514eb4c52..f8a97d9954 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,6 +77,10 @@ By @Valaphee in [#3402](https://github.com/gfx-rs/wgpu/pull/3402) #### Vulkan - Fix enabling `wgpu::Features::PARTIALLY_BOUND_BINDING_ARRAY` not being actually enabled in vulkan backend. By @39ali in[#3772](https://github.com/gfx-rs/wgpu/pull/3772). +#### DX12 + +- DX12 doesn't support `Features::POLYGON_MODE_POINT``. By @teoxoy in [#4032](https://github.com/gfx-rs/wgpu/pull/4032). + ## v0.17.0 (2023-07-20) This is the first release that featured `wgpu-info` as a binary crate for getting information about what devices wgpu sees in your system. It can dump the information in both human readable format and json.