![]() |
VPP
0.7
A high-level modern C++ API for Vulkan
|
A container for various rendering parameters. More...
#include <vppRenderingOptions.hpp>
Public Member Functions | |
RenderingOptions () | |
Constructs a container with default options. | |
void | setPolygonMode (VkPolygonMode v) |
Sets the polygon rendering mode. More... | |
VkPolygonMode | getPolygonMode () const |
Retrieves currently set polygon mode. | |
VkCullModeFlagBits | getCullMode () const |
Retrieves currently set face culling mode. More... | |
VkFrontFace | getFrontFace () const |
Retrieves currently set front face detection mode. More... | |
VkSampleCountFlagBits | getRasterizationSamples () const |
Retrieves currently set sample count for multisampling. More... | |
float | getLineWidth () const |
Retrieves currently set line width for rasterizing lines. More... | |
float | getDepthBiasConstantFactor () const |
Retrieves the scalar factor controlling the constant depth value added to each fragment. More... | |
float | getDepthBiasClamp () const |
Retrieves the maximum (or minimum) depth bias of a fragment. More... | |
float | getDepthBiasSlopeFactor () const |
Retrieves the scalar factor applied to a fragment’s slope in depth bias calculations. More... | |
float | getSampleShadingAmount () const |
Retrieves the minimum fraction of sample shading. More... | |
float | getMinDepthBounds () const |
Retrieves the minimum depth for depth bounds test. More... | |
float | getMaxDepthBounds () const |
Retrieves the maximum depth for depth bounds test. More... | |
bool | getEnableDepthClamp () const |
Retrieves the status of the depth clamp feature. More... | |
bool | getEnableRasterizerDiscard () const |
Retrieves the status of the rasterizer discard feature. More... | |
bool | getEnableDepthBias () const |
Retrieves the status of the depth bias feature. More... | |
bool | getEnableSampleShading () const |
Retrieves the status of the samples shading feature. More... | |
bool | getEnableAlphaToCoverage () const |
Retrieves the status of the alpha to coverage conversion feature. More... | |
bool | getEnableResetAlphaToOne () const |
Retrieves the status of the alpha reset feature. More... | |
bool | getEnableDepthTest () const |
Retrieves the status of the depth test. More... | |
bool | getEnableDepthWrite () const |
Retrieves the status of the depth write mode. More... | |
bool | getEnableDepthBoundsTest () const |
Retrieves the status of the depth bounds test. More... | |
bool | getEnableStencilTest () const |
Retrieves the status of the stencil test. More... | |
bool | getModifyCoverageMask () const |
std::uint32_t | getModifiedCoverageMask (std::uint32_t index) const |
VkCompareOp | getDepthCompareOperator () const |
Retrieves comparison operator for the depth test. More... | |
const VkStencilOpState & | getFrontFacingStencilCfg () const |
const VkStencilOpState & | getBackFacingStencilCfg () const |
void | setCullMode (VkCullModeFlagBits v) |
Sets the face culling mode. More... | |
void | setFrontFace (VkFrontFace v) |
Set the front face detection mode. More... | |
void | setRasterizationSamples (VkSampleCountFlagBits v) |
Sets the sample count for multisampling. More... | |
void | setLineWidth (float v) |
Sets the line width for rasterizing lines. More... | |
void | setDepthBiasConstantFactor (float v) |
Sets the scalar factor controlling the constant depth value added to each fragment. More... | |
void | setDepthBiasClamp (float v) |
Sets the maximum (or minimum) depth bias of a fragment. More... | |
void | setDepthBiasSlopeFactor (float v) |
Sets the scalar factor applied to a fragment’s slope in depth bias calculations. More... | |
void | setSampleShadingAmount (float v) |
Sets the minimum fraction of sample shading. More... | |
void | setMinDepthBounds (float v) |
Sets the minimum depth for depth bounds test. More... | |
void | setMaxDepthBounds (float v) |
Sets the maximum depth for depth bounds test. More... | |
void | setEnableDepthClamp (bool v) |
Sets the status of the depth clamp feature. More... | |
void | setEnableRasterizerDiscard (bool v) |
Sets the status of the rasterizer discard feature. More... | |
void | setEnableDepthBias (bool v) |
Sets the status of the depth bias feature. More... | |
void | setEnableSampleShading (bool v) |
Sets the status of the samples shading feature. More... | |
void | setEnableAlphaToCoverage (bool v) |
Sets the status of the alpha to coverage conversion feature. More... | |
void | setEnableResetAlphaToOne (bool v) |
Sets the status of the alpha reset feature. More... | |
void | setEnableDepthTest (bool v) |
Sets the status of the depth test. More... | |
void | setEnableDepthWrite (bool v) |
Sets the status of the depth write mode. More... | |
void | setEnableDepthBoundsTest (bool v) |
Sets the status of the depth bounds test. More... | |
void | setEnableStencilTest (bool v) |
Sets the status of the stencil test. More... | |
void | setModifyCoverageMask (bool v) |
void | setModifiedCoverageMask (std::uint32_t index, std::uint32_t v) |
void | setDepthCompareOperator (VkCompareOp v) |
void | setFrontFacingStencilCfg (VkStencilOpState v) |
void | setBackFacingStencilCfg (VkStencilOpState v) |
void | addViewport (const Viewport &vp) |
A container for various rendering parameters.
This object is consumed by RenderPass::addPipeline() function.
This object is reference counted and can be passed by value.
VkCullModeFlagBits vpp::RenderingOptions::getCullMode | ( | ) | const |
Retrieves currently set face culling mode.
There are four modes: VK_CULL_MODE_NONE, VK_CULL_MODE_FRONT_BIT, VK_CULL_MODE_BACK_BIT, VK_CULL_MODE_FRONT_AND_BACK. See chapter 24.7.1 of the official Vulkan specification for details.
float vpp::RenderingOptions::getDepthBiasClamp | ( | ) | const |
Retrieves the maximum (or minimum) depth bias of a fragment.
See chapter 24.7.3 of the official Vulkan specification for details.
float vpp::RenderingOptions::getDepthBiasConstantFactor | ( | ) | const |
Retrieves the scalar factor controlling the constant depth value added to each fragment.
See chapter 24.7.3 of the official Vulkan specification for details.
float vpp::RenderingOptions::getDepthBiasSlopeFactor | ( | ) | const |
Retrieves the scalar factor applied to a fragment’s slope in depth bias calculations.
See chapter 24.7.3 of the official Vulkan specification for details.
VkCompareOp vpp::RenderingOptions::getDepthCompareOperator | ( | ) | const |
Retrieves comparison operator for the depth test.
See chapter 25.10 of the official Vulkan specification for details.
bool vpp::RenderingOptions::getEnableAlphaToCoverage | ( | ) | const |
Retrieves the status of the alpha to coverage conversion feature.
See chapter 25.6 of the official Vulkan specification for details.
bool vpp::RenderingOptions::getEnableDepthBias | ( | ) | const |
Retrieves the status of the depth bias feature.
Depth bias allows to add some bias to depth values, to prevent artifacts resulting limited floating point precision (e.g. self-shadowing).
See chapter 24.7.3 of the official Vulkan specification for details.
bool vpp::RenderingOptions::getEnableDepthBoundsTest | ( | ) | const |
Retrieves the status of the depth bounds test.
See chapter 25.8 of the official Vulkan specification for details.
bool vpp::RenderingOptions::getEnableDepthClamp | ( | ) | const |
Retrieves the status of the depth clamp feature.
See chapter 23.2 of the official Vulkan specification for details.
bool vpp::RenderingOptions::getEnableDepthTest | ( | ) | const |
Retrieves the status of the depth test.
Depth test enables usage of the Z-buffer e.g. to discard fragments which are behind already drawn fragments. Z-buffer operation is configurable.
See chapter 25.10 of the official Vulkan specification for details.
bool vpp::RenderingOptions::getEnableDepthWrite | ( | ) | const |
Retrieves the status of the depth write mode.
This enables writing to the Z-buffer. It is usually the desired side effect. However, if you have separate D-pass and then subsequent passes which only read the Z-buffer, turn writing off.
See chapter 25.10 of the official Vulkan specification for details.
bool vpp::RenderingOptions::getEnableRasterizerDiscard | ( | ) | const |
Retrieves the status of the rasterizer discard feature.
Rasterizer discard mode allows to skip rasterization and fragment processing entirely. This can speed up computation if only geometry processing is being done in the pipeline, without fragment shader.
See chapter 24.1 of the official Vulkan specification for details.
bool vpp::RenderingOptions::getEnableResetAlphaToOne | ( | ) | const |
Retrieves the status of the alpha reset feature.
See chapter 25.6 of the official Vulkan specification for details.
bool vpp::RenderingOptions::getEnableSampleShading | ( | ) | const |
Retrieves the status of the samples shading feature.
Sample shading allows to call fragment shader separately for each sample in multisampling mode. Otherwise the shader is being called only once for each fragment.
See chapter 24.4 of the official Vulkan specification for details.
bool vpp::RenderingOptions::getEnableStencilTest | ( | ) | const |
Retrieves the status of the stencil test.
See chapter 25.9 of the official Vulkan specification for details.
VkFrontFace vpp::RenderingOptions::getFrontFace | ( | ) | const |
Retrieves currently set front face detection mode.
There are two modes: VK_FRONT_FACE_COUNTER_CLOCKWISE, VK_FRONT_FACE_CLOCKWISE. See chapter 24.7.1 of the official Vulkan specification for details.
float vpp::RenderingOptions::getLineWidth | ( | ) | const |
Retrieves currently set line width for rasterizing lines.
See chapter 24.6 of the official Vulkan specification for details.
float vpp::RenderingOptions::getMaxDepthBounds | ( | ) | const |
Retrieves the maximum depth for depth bounds test.
See chapter 25.8 of the official Vulkan specification for details.
float vpp::RenderingOptions::getMinDepthBounds | ( | ) | const |
Retrieves the minimum depth for depth bounds test.
See chapter 25.8 of the official Vulkan specification for details.
VkSampleCountFlagBits vpp::RenderingOptions::getRasterizationSamples | ( | ) | const |
Retrieves currently set sample count for multisampling.
It can be one of these values: VK_SAMPLE_COUNT_1_BIT, VK_SAMPLE_COUNT_2_BIT, VK_SAMPLE_COUNT_4_BIT ... VK_SAMPLE_COUNT_16_BIT. See chapter 24 of the official Vulkan specification for details.
float vpp::RenderingOptions::getSampleShadingAmount | ( | ) | const |
Retrieves the minimum fraction of sample shading.
See chapter 24.4 of the official Vulkan specification for details.
void vpp::RenderingOptions::setCullMode | ( | VkCullModeFlagBits | v | ) |
Sets the face culling mode.
There are four modes: VK_CULL_MODE_NONE, VK_CULL_MODE_FRONT_BIT, VK_CULL_MODE_BACK_BIT, VK_CULL_MODE_FRONT_AND_BACK. See chapter 24.7.1 of the official Vulkan specification for details.
void vpp::RenderingOptions::setDepthBiasClamp | ( | float | v | ) |
Sets the maximum (or minimum) depth bias of a fragment.
See chapter 24.7.3 of the official Vulkan specification for details.
void vpp::RenderingOptions::setDepthBiasConstantFactor | ( | float | v | ) |
Sets the scalar factor controlling the constant depth value added to each fragment.
See chapter 24.7.3 of the official Vulkan specification for details.
void vpp::RenderingOptions::setDepthBiasSlopeFactor | ( | float | v | ) |
Sets the scalar factor applied to a fragment’s slope in depth bias calculations.
See chapter 24.7.3 of the official Vulkan specification for details.
void vpp::RenderingOptions::setEnableAlphaToCoverage | ( | bool | v | ) |
Sets the status of the alpha to coverage conversion feature.
See chapter 25.6 of the official Vulkan specification for details.
void vpp::RenderingOptions::setEnableDepthBias | ( | bool | v | ) |
Sets the status of the depth bias feature.
Depth bias allows to add some bias to depth values, to prevent artifacts resulting limited floating point precision (e.g. self-shadowing).
See chapter 24.7.3 of the official Vulkan specification for details.
void vpp::RenderingOptions::setEnableDepthBoundsTest | ( | bool | v | ) |
Sets the status of the depth bounds test.
See chapter 25.8 of the official Vulkan specification for details.
void vpp::RenderingOptions::setEnableDepthClamp | ( | bool | v | ) |
Sets the status of the depth clamp feature.
See chapter 23.2 of the official Vulkan specification for details.
void vpp::RenderingOptions::setEnableDepthTest | ( | bool | v | ) |
Sets the status of the depth test.
Depth test enables usage of the Z-buffer e.g. to discard fragments which are behind already drawn fragments. Z-buffer operation is configurable.
See chapter 25.10 of the official Vulkan specification for details.
void vpp::RenderingOptions::setEnableDepthWrite | ( | bool | v | ) |
Sets the status of the depth write mode.
This enables writing to the Z-buffer. It is usually the desired side effect. However, if you have separate D-pass and then subsequent passes which only read the Z-buffer, turn writing off.
See chapter 25.10 of the official Vulkan specification for details.
void vpp::RenderingOptions::setEnableRasterizerDiscard | ( | bool | v | ) |
Sets the status of the rasterizer discard feature.
Rasterizer discard mode allows to skip rasterization and fragment processing entirely. This can speed up computation if only geometry processing is being done in the pipeline, without fragment shader.
See chapter 24.1 of the official Vulkan specification for details.
void vpp::RenderingOptions::setEnableResetAlphaToOne | ( | bool | v | ) |
Sets the status of the alpha reset feature.
See chapter 25.6 of the official Vulkan specification for details.
void vpp::RenderingOptions::setEnableSampleShading | ( | bool | v | ) |
Sets the status of the samples shading feature.
Sample shading allows to call fragment shader separately for each sample in multisampling mode. Otherwise the shader is being called only once for each fragment.
See chapter 24.4 of the official Vulkan specification for details.
void vpp::RenderingOptions::setEnableStencilTest | ( | bool | v | ) |
Sets the status of the stencil test.
See chapter 25.9 of the official Vulkan specification for details.
void vpp::RenderingOptions::setFrontFace | ( | VkFrontFace | v | ) |
Set the front face detection mode.
There are two modes: VK_FRONT_FACE_COUNTER_CLOCKWISE, VK_FRONT_FACE_CLOCKWISE. See chapter 24.7.1 of the official Vulkan specification for details.
void vpp::RenderingOptions::setLineWidth | ( | float | v | ) |
Sets the line width for rasterizing lines.
See chapter 24.6 of the official Vulkan specification for details.
void vpp::RenderingOptions::setMaxDepthBounds | ( | float | v | ) |
Sets the maximum depth for depth bounds test.
See chapter 25.8 of the official Vulkan specification for details.
void vpp::RenderingOptions::setMinDepthBounds | ( | float | v | ) |
Sets the minimum depth for depth bounds test.
See chapter 25.8 of the official Vulkan specification for details.
void vpp::RenderingOptions::setPolygonMode | ( | VkPolygonMode | v | ) |
Sets the polygon rendering mode.
There are three polygon modes: VK_POLYGON_MODE_FILL, VK_POLYGON_MODE_LINE, and VK_POLYGON_MODE_POINT. See chapter 24.7.2 of the official Vulkan specification for details.
void vpp::RenderingOptions::setRasterizationSamples | ( | VkSampleCountFlagBits | v | ) |
Sets the sample count for multisampling.
It can be one of these values: VK_SAMPLE_COUNT_1_BIT, VK_SAMPLE_COUNT_2_BIT, VK_SAMPLE_COUNT_4_BIT ... VK_SAMPLE_COUNT_16_BIT. See chapter 24 of the official Vulkan specification for details.
void vpp::RenderingOptions::setSampleShadingAmount | ( | float | v | ) |
Sets the minimum fraction of sample shading.
See chapter 24.4 of the official Vulkan specification for details.