VPP  0.7
A high-level modern C++ API for Vulkan
vppRenderingOptions.hpp
1 /*
2  Copyright 2016-2018 SOFT-ERG, Przemek Kuczmierczyk (www.softerg.com)
3  All rights reserved.
4 
5  Redistribution and use in source and binary forms, with or without modification,
6  are permitted provided that the following conditions are met:
7 
8  1. Redistributions of source code must retain the above copyright notice,
9  this list of conditions and the following disclaimer.
10 
11  2. Redistributions in binary form must reproduce the above copyright notice,
12  this list of conditions and the following disclaimer in the documentation
13  and/or other materials provided with the distribution.
14 
15  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
17  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
19  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
22  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
24  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26 
27 // -----------------------------------------------------------------------------
28 namespace vpp {
29 // -----------------------------------------------------------------------------
30 
40 {
41 public:
44 
45 public:
46 
54  void setPolygonMode ( VkPolygonMode v );
55 
59  VkPolygonMode getPolygonMode() const;
60 
68  VkCullModeFlagBits getCullMode() const;
69 
77  VkFrontFace getFrontFace() const;
78 
86  VkSampleCountFlagBits getRasterizationSamples() const;
87 
93  float getLineWidth() const;
94 
100  float getDepthBiasConstantFactor() const;
101 
107  float getDepthBiasClamp() const;
108 
114  float getDepthBiasSlopeFactor() const;
115 
121  float getSampleShadingAmount() const;
122 
128  float getMinDepthBounds() const;
129 
135  float getMaxDepthBounds() const;
136 
142  bool getEnableDepthClamp() const;
143 
153  bool getEnableRasterizerDiscard() const;
154 
164  bool getEnableDepthBias() const;
165 
175  bool getEnableSampleShading() const;
176 
182  bool getEnableAlphaToCoverage() const;
183 
189  bool getEnableResetAlphaToOne() const;
190 
200  bool getEnableDepthTest() const;
201 
211  bool getEnableDepthWrite() const;
212 
218  bool getEnableDepthBoundsTest() const;
219 
225  bool getEnableStencilTest() const;
226 
227  bool getModifyCoverageMask() const;
228  std::uint32_t getModifiedCoverageMask ( std::uint32_t index ) const;
229 
236  VkCompareOp getDepthCompareOperator() const;
237 
238 
239  const VkStencilOpState& getFrontFacingStencilCfg() const;
240  const VkStencilOpState& getBackFacingStencilCfg() const;
241 
249  void setCullMode ( VkCullModeFlagBits v );
250 
258  void setFrontFace ( VkFrontFace v );
259 
267  void setRasterizationSamples ( VkSampleCountFlagBits v );
268 
274  void setLineWidth ( float v );
275 
281  void setDepthBiasConstantFactor ( float v );
282 
288  void setDepthBiasClamp ( float v );
289 
295  void setDepthBiasSlopeFactor ( float v );
296 
302  void setSampleShadingAmount ( float v );
303 
309  void setMinDepthBounds ( float v );
310 
316  void setMaxDepthBounds (float v );
317 
323  void setEnableDepthClamp ( bool v );
324 
334  void setEnableRasterizerDiscard ( bool v );
335 
344  void setEnableDepthBias ( bool v );
345 
355  void setEnableSampleShading ( bool v );
356 
362  void setEnableAlphaToCoverage ( bool v );
363 
369  void setEnableResetAlphaToOne ( bool v );
370 
380  void setEnableDepthTest ( bool v );
381 
391  void setEnableDepthWrite ( bool v );
392 
398  void setEnableDepthBoundsTest ( bool v );
399 
405  void setEnableStencilTest ( bool v );
406 
407  void setModifyCoverageMask ( bool v );
408  void setModifiedCoverageMask ( std::uint32_t index, std::uint32_t v );
409 
410  void setDepthCompareOperator ( VkCompareOp v );
411  void setFrontFacingStencilCfg ( VkStencilOpState v );
412  void setBackFacingStencilCfg ( VkStencilOpState v );
413 
414  void addViewport ( const Viewport& vp );
415 };
416 
417 // -----------------------------------------------------------------------------
418 } // namespace vpp
419 // -----------------------------------------------------------------------------
void setEnableDepthWrite(bool v)
Sets the status of the depth write mode.
RenderingOptions()
Constructs a container with default options.
bool getEnableDepthClamp() const
Retrieves the status of the depth clamp feature.
VkSampleCountFlagBits getRasterizationSamples() const
Retrieves currently set sample count for multisampling.
void setEnableAlphaToCoverage(bool v)
Sets the status of the alpha to coverage conversion feature.
void setFrontFace(VkFrontFace v)
Set the front face detection mode.
float getSampleShadingAmount() const
Retrieves the minimum fraction of sample shading.
void setPolygonMode(VkPolygonMode v)
Sets the polygon rendering mode.
float getMaxDepthBounds() const
Retrieves the maximum depth for depth bounds test.
The VPP namespace.
Definition: main.hpp:1
void setEnableSampleShading(bool v)
Sets the status of the samples shading feature.
bool getEnableDepthBoundsTest() const
Retrieves the status of the depth bounds test.
void setEnableDepthClamp(bool v)
Sets the status of the depth clamp feature.
bool getEnableDepthBias() const
Retrieves the status of the depth bias feature.
void setLineWidth(float v)
Sets the line width for rasterizing lines.
void setEnableDepthBias(bool v)
Sets the status of the depth bias feature.
void setEnableDepthBoundsTest(bool v)
Sets the status of the depth bounds test.
bool getEnableDepthTest() const
Retrieves the status of the depth test.
void setRasterizationSamples(VkSampleCountFlagBits v)
Sets the sample count for multisampling.
void setEnableStencilTest(bool v)
Sets the status of the stencil test.
bool getEnableAlphaToCoverage() const
Retrieves the status of the alpha to coverage conversion feature.
void setDepthBiasConstantFactor(float v)
Sets the scalar factor controlling the constant depth value added to each fragment.
bool getEnableResetAlphaToOne() const
Retrieves the status of the alpha reset feature.
bool getEnableRasterizerDiscard() const
Retrieves the status of the rasterizer discard feature.
void setEnableResetAlphaToOne(bool v)
Sets the status of the alpha reset feature.
bool getEnableStencilTest() const
Retrieves the status of the stencil test.
bool getEnableDepthWrite() const
Retrieves the status of the depth write mode.
float getMinDepthBounds() const
Retrieves the minimum depth for depth bounds test.
void setEnableDepthTest(bool v)
Sets the status of the depth test.
void setEnableRasterizerDiscard(bool v)
Sets the status of the rasterizer discard feature.
float getLineWidth() const
Retrieves currently set line width for rasterizing lines.
void setDepthBiasSlopeFactor(float v)
Sets the scalar factor applied to a fragment’s slope in depth bias calculations.
A container for various rendering parameters.
Definition: vppRenderingOptions.hpp:39
Helper class to define simple Vulkan viewport.
Definition: vppViewport.hpp:41
VkPolygonMode getPolygonMode() const
Retrieves currently set polygon mode.
void setDepthBiasClamp(float v)
Sets the maximum (or minimum) depth bias of a fragment.
void setSampleShadingAmount(float v)
Sets the minimum fraction of sample shading.
bool getEnableSampleShading() const
Retrieves the status of the samples shading feature.
void setCullMode(VkCullModeFlagBits v)
Sets the face culling mode.
void setMinDepthBounds(float v)
Sets the minimum depth for depth bounds test.
float getDepthBiasConstantFactor() const
Retrieves the scalar factor controlling the constant depth value added to each fragment.
float getDepthBiasSlopeFactor() const
Retrieves the scalar factor applied to a fragment’s slope in depth bias calculations.
VkCullModeFlagBits getCullMode() const
Retrieves currently set face culling mode.
void setMaxDepthBounds(float v)
Sets the maximum depth for depth bounds test.
VkFrontFace getFrontFace() const
Retrieves currently set front face detection mode.
VkCompareOp getDepthCompareOperator() const
Retrieves comparison operator for the depth test.
float getDepthBiasClamp() const
Retrieves the maximum (or minimum) depth bias of a fragment.