diff options
author | Ben Fletcher <ben.fletcher@me.com> | 2022-01-25 16:59:03 -0800 |
---|---|---|
committer | Ben Fletcher <ben.fletcher@me.com> | 2022-01-31 08:52:05 -0800 |
commit | 1c3ae79ad36f77a044adb6264396e46575ee8757 (patch) | |
tree | ebcc8710d9a67ca8f426991cb1f7d2c17c92af7b /src/gui/rhi/qrhi_p.h | |
parent | 1d28fd7a9c4720289f3d41db2ed8e6fcb07d5a30 (diff) |
rhi: Add support for polygon fill mode
Support for Polygon Mode (Triangle Fill Mode in Metal, Fill Mode in D3D)
in the RHI graphics pipeline.
Options are Fill and Line
Status:
OpenGL - ok
Vulkan - ok
Metal - ok
D3D11 - ok
OpenGL ES - does not support glPolygonMode.
Change-Id: I20b7ef416624700c3dc8d1cbe6474f4ca3889db8
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhi_p.h')
-rw-r--r-- | src/gui/rhi/qrhi_p.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/rhi/qrhi_p.h b/src/gui/rhi/qrhi_p.h index 8c38b6383d..b0cf9e3469 100644 --- a/src/gui/rhi/qrhi_p.h +++ b/src/gui/rhi/qrhi_p.h @@ -1223,6 +1223,11 @@ public: CompareOp compareOp = Always; }; + enum PolygonMode { + Fill, + Line + }; + QRhiResource::Type resourceType() const override; Flags flags() const { return m_flags; } @@ -1305,6 +1310,9 @@ public: int patchControlPointCount() const { return m_patchControlPointCount; } void setPatchControlPointCount(int count) { m_patchControlPointCount = count; } + PolygonMode polygonMode() const {return m_polygonMode; } + void setPolygonMode(PolygonMode mode) {m_polygonMode = mode; } + virtual bool create() = 0; protected: @@ -1327,6 +1335,7 @@ protected: int m_depthBias = 0; float m_slopeScaledDepthBias = 0.0f; int m_patchControlPointCount = 3; + PolygonMode m_polygonMode = Fill; QVarLengthArray<QRhiShaderStage, 4> m_shaderStages; QRhiVertexInputLayout m_vertexInputLayout; QRhiShaderResourceBindings *m_shaderResourceBindings = nullptr; |