VPP  0.7
A high-level modern C++ API for Vulkan
Public Member Functions | List of all members
vpp::Float Class Reference

Shader (GPU-side) data type for 32-bit floating point values. More...

#include <vppLangScalarTypes.hpp>

Public Member Functions

 Float (float value)
 Construct a r-value from specified C++ value. More...
 
Float operator+ (const Float &rhs) const
 Standard addition operator.
 
Float operator- (const Float &rhs) const
 Standard subtraction operator.
 
Float operator* (const Float &rhs) const
 Standard multiplication operator.
 
Float operator/ (const Float &rhs) const
 Standard division operator.
 
Float operator% (const Float &rhs) const
 Standard remainder operator. Result sign is taken from the first operand.
 
Float operator- () const
 Standard sign reversal operator.
 
Bool operator== (const Float &rhs) const
 Standard comparison operator (true if equal).
 
Bool operator!= (const Float &rhs) const
 Standard comparison operator (true if not equal).
 
Bool operator> (const Float &rhs) const
 Standard comparison operator (true if greater).
 
Bool operator>= (const Float &rhs) const
 Standard comparison operator (true if greater or equal).
 
Bool operator< (const Float &rhs) const
 Standard comparison operator (true if less).
 
Bool operator<= (const Float &rhs) const
 Standard comparison operator (true if less or equal).
 

Detailed Description

Shader (GPU-side) data type for 32-bit floating point values.

Use this type inside shader code as a counterpart of CPU-side float type.

This is a r-value type. You must initialize it with value, either CPU-side one (an explicit constant), or an expression computed on GPU side. The value can not be changed.

For mutable variable type, see VFloat. Beware that mutable variables can degrade performance on GPU, therefore Float is preferable, unless you really want a mutable variable.

Constructor & Destructor Documentation

◆ Float()

vpp::Float::Float ( float  value)

Construct a r-value from specified C++ value.

The source value can be either a constant, or a parameter passed to shader specific for that shader. The constructor is called once when compiling the pipeline.


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