VPP  0.8
A high-level modern C++ API for Vulkan
vpp::SUnnormalizedSampler Struct Reference

Structure describing unnormalized sampler parameters. More...

#include <vppSampler.hpp>

Public Member Functions

 SUnnormalizedSampler ()
 Constructor setting default parameters. More...
 
bool operator< (const SUnnormalizedSampler &rhs) const
 Ordering operator. Useful for storing sampler descriptions in sets or maps.
 

Public Attributes

unsigned int clampToBorderU
 Texel addressing mode for the U coordinate. More...
 
unsigned int clampToBorderV
 Texel addressing mode for the V coordinate. More...
 
unsigned int filterMode
 Specifies the method of interpolation when upscaling and downscaling the texture. More...
 
unsigned int borderColor
 Defines the color for border texels. More...
 
float mipLodBias
 The bias to be added to mipmap LOD (level-of-detail) calculation. More...
 

Detailed Description

Structure describing unnormalized sampler parameters.

Unnormalized sampler is a sampler using the coordinates in range [ 0, SIZE ].

Use SUnnormalizedSampler structure to define parameters of the sampler and UnnormalizedSampler class to create the sampler object.

Constructor & Destructor Documentation

◆ SUnnormalizedSampler()

vpp::SUnnormalizedSampler::SUnnormalizedSampler ( )

Constructor setting default parameters.

The default values are given in individual parameter descriptions.

Member Data Documentation

◆ borderColor

unsigned int vpp::SUnnormalizedSampler::borderColor

Defines the color for border texels.

A border texel is a texel outside valid range of coordinates. This can happen e.g. if VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER mode is set. The substitute color is chosen according to the following:

  • VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK specifies a transparent, floating-point format, black color.
  • VK_BORDER_COLOR_INT_TRANSPARENT_BLACK specifies a transparent, integer format, black color.
  • VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK specifies an opaque, floating-point format, black color.
  • VK_BORDER_COLOR_INT_OPAQUE_BLACK specifies an opaque, integer format, black color.
  • VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE specifies an opaque, floating-point format, white color.
  • VK_BORDER_COLOR_INT_OPAQUE_WHITE specifies an opaque, integer format, white color.

See section 15.3.1 of Vulkan docs for more details.

Default value: VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK.

◆ clampToBorderU

unsigned int vpp::SUnnormalizedSampler::clampToBorderU

Texel addressing mode for the U coordinate.

Controls the wraparound of computed integer coordinate of the texel.

Let SIZE be the image size in corresponding direction and i the integer coordinate value (computed from floating-point value). Then the meaning of values is as follows:

  • false (VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE): clamp ( i, 0, SIZE-1 )
  • true (VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER): clamp ( i, -1, SIZE )

The functions are defined as:

  • clamp ( n, a, b ) = ( n < a ? a : ( n > b ? b : n ) )

See section 15.9.1 of the Vulkan specs for more detail.

Default value: false.

◆ clampToBorderV

unsigned int vpp::SUnnormalizedSampler::clampToBorderV

Texel addressing mode for the V coordinate.

Controls the wraparound of computed integer coordinate of the texel.

See section 15.9.1 of the Vulkan specs for more detail.

Default value: false.

◆ filterMode

unsigned int vpp::SUnnormalizedSampler::filterMode

Specifies the method of interpolation when upscaling and downscaling the texture.

It has to be one of the values:

  • VK_FILTER_NEAREST specifies nearest filtering (no interpolation).
  • VK_FILTER_LINEAR specifies linear filtering (linear interpolation with neighbours).

For unnormalized samplers, filters for upscaling and downscaling are always the same.

See section 15.9.3 of the Vulkan specification for more details.

Default value: VK_FILTER_LINEAR.

◆ mipLodBias

float vpp::SUnnormalizedSampler::mipLodBias

The bias to be added to mipmap LOD (level-of-detail) calculation.

See section 15.6.7 of the Vulkan specification for more details.

Default value: 0.


The documentation for this struct was generated from the following file: