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

Shader (GPU-side) data type for 32-bit signed integer values. More...

#include <vppLangScalarTypes.hpp>

Public Member Functions

 Int (int value)
 Construct a r-value from specified C++ value. More...
 
Int operator+ (const Int &rhs) const
 Standard addition operator.
 
Int operator- (const Int &rhs) const
 Standard subtraction operator.
 
Int operator* (const Int &rhs) const
 Standard multiplication operator.
 
Int operator/ (const Int &rhs) const
 Standard division operator.
 
Int operator% (const Int &rhs) const
 Standard remainder operator. Result sign is taken from the first operand.
 
Int operator<< (const Int &rhs) const
 Standard left shift operator.
 
Int operator>> (const Int &rhs) const
 Standard right shift operator.
 
Int operator| (const Int &rhs) const
 Standard bitwise or operator.
 
Int operator^ (const Int &rhs) const
 Standard bitwise xor operator.
 
Int operator & (const Int &rhs) const
 Standard bitwise and operator.
 
Int operator- () const
 Standard sign reversal operator.
 
Int operator~ () const
 Standard bitwise negation operator.
 
Bool operator== (const Int &rhs) const
 Standard comparison operator (true if equal).
 
Bool operator!= (const Int &rhs) const
 Standard comparison operator (true if not equal).
 
Bool operator> (const Int &rhs) const
 Standard comparison operator (true if greater).
 
Bool operator>= (const Int &rhs) const
 Standard comparison operator (true if greater or equal).
 
Bool operator< (const Int &rhs) const
 Standard comparison operator (true if less).
 
Bool operator<= (const Int &rhs) const
 Standard comparison operator (true if less or equal).
 

Detailed Description

Shader (GPU-side) data type for 32-bit signed integer values.

Use this type inside shader code as a counterpart of CPU-side int 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 VInt. Beware that mutable variables can degrade performance on GPU, therefore Int is preferable, unless you really want a mutable variable (e.g. a loop counter).

Constructor & Destructor Documentation

◆ Int()

vpp::Int::Int ( int  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: