VPP  0.7
A high-level modern C++ API for Vulkan
vppSampler.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 
41 {
47  SNormalizedSampler ( float maxLod = 1.0f );
48 
53  bool operator< ( const SNormalizedSampler& rhs ) const;
54 
78  unsigned int addressModeU;
79 
88  unsigned int addressModeV;
89 
98  unsigned int addressModeW;
99 
119  unsigned int borderColor;
120 
151  unsigned int compareOp;
152 
166  unsigned int compare;
167 
180  unsigned int magFilterMode;
181 
194  unsigned int minFilterMode;
195 
207  unsigned int mipMapMode;
208 
217  unsigned int anisotropy;
218 
226  float mipLodBias;
227 
234 
242  float minLod;
243 
251  float maxLod;
252 };
253 
254 // -----------------------------------------------------------------------------
265 {
272 
277  bool operator< ( const SUnnormalizedSampler& rhs ) const;
278 
298  unsigned int clampToBorderU;
299 
309  unsigned int clampToBorderV;
310 
325  unsigned int filterMode;
326 
345  unsigned int borderColor;
346 
354  float mipLodBias;
355 };
356 
357 // -----------------------------------------------------------------------------
376 {
377 public:
380 
384  NormalizedSampler ( const Device& hDevice );
385 
389  NormalizedSampler ( const Device& hDevice, const SNormalizedSampler& samplerInfo );
390 
394  VkSampler handle() const;
395 };
396 
397 // -----------------------------------------------------------------------------
416 {
417 public:
420 
424  UnnormalizedSampler ( const Device& hDevice );
425 
429  UnnormalizedSampler ( const Device& hDevice, const SUnnormalizedSampler& samplerInfo );
430 
434  VkSampler handle() const;
435 };
436 
437 // -----------------------------------------------------------------------------
438 } // namespace vpp
439 // -----------------------------------------------------------------------------
VkSampler handle() const
Returns Vulkan handle of the sampler object.
unsigned int compare
Enables depth comparison operation for this sampler.
Definition: vppSampler.hpp:166
Represents logical rendering device.
Definition: vppDevice.hpp:49
bool operator<(const SUnnormalizedSampler &rhs) const
Ordering operator. Useful for storing sampler descriptions in sets or maps.
Structure describing unnormalized sampler parameters.
Definition: vppSampler.hpp:264
unsigned int borderColor
Defines the color for border texels.
Definition: vppSampler.hpp:345
The VPP namespace.
Definition: main.hpp:1
unsigned int anisotropy
Enables anisotropic filtering.
Definition: vppSampler.hpp:217
NormalizedSampler()
Constructs null reference.
UnnormalizedSampler()
Constructs null reference.
unsigned int filterMode
Specifies the method of interpolation when upscaling and downscaling the texture. ...
Definition: vppSampler.hpp:325
unsigned int mipMapMode
Specifies the method of interpolation between mip levels.
Definition: vppSampler.hpp:207
unsigned int magFilterMode
Specifies the method of interpolation when upscaling the texture.
Definition: vppSampler.hpp:180
unsigned int borderColor
Defines the color for border texels.
Definition: vppSampler.hpp:119
SUnnormalizedSampler()
Constructor setting default parameters.
unsigned int addressModeU
Texel addressing mode for the U coordinate.
Definition: vppSampler.hpp:78
VkSampler handle() const
Returns Vulkan handle of the sampler object.
float maxLod
The maximum value used to clamp the computed LOD value.
Definition: vppSampler.hpp:251
Texture sampler object (normalized).
Definition: vppSampler.hpp:375
Structure describing normalized sampler parameters.
Definition: vppSampler.hpp:40
float maxAnisotropy
The anisotropy value clamp. Ignored when anisotropy is disabled.
Definition: vppSampler.hpp:233
unsigned int addressModeW
Texel addressing mode for the W coordinate.
Definition: vppSampler.hpp:98
unsigned int clampToBorderU
Texel addressing mode for the U coordinate.
Definition: vppSampler.hpp:298
unsigned int minFilterMode
Specifies the method of interpolation when downscaling the texture.
Definition: vppSampler.hpp:194
float mipLodBias
The bias to be added to mipmap LOD (level-of-detail) calculation.
Definition: vppSampler.hpp:354
unsigned int clampToBorderV
Texel addressing mode for the V coordinate.
Definition: vppSampler.hpp:309
unsigned int compareOp
Specifies the comparison function to apply to fetched data before the depth compare operation...
Definition: vppSampler.hpp:151
float mipLodBias
The bias to be added to mipmap LOD (level-of-detail) calculation.
Definition: vppSampler.hpp:226
SNormalizedSampler(float maxLod=1.0f)
Constructor setting default parameters.
float minLod
The minimum value used to clamp the computed LOD value.
Definition: vppSampler.hpp:242
unsigned int addressModeV
Texel addressing mode for the V coordinate.
Definition: vppSampler.hpp:88
bool operator<(const SNormalizedSampler &rhs) const
Ordering operator. Useful for storing sampler descriptions in sets or maps.
Texture sampler object (normalized).
Definition: vppSampler.hpp:415