![]() |
VPP
0.8
A high-level modern C++ API for Vulkan
|
Shader (GPU-side) data type for 4-element 32-bit integer vectors. More...
#include <vppLangVectorTypes.hpp>
Public Member Functions | |
IVec4 (const std::initializer_list< int > &init) | |
Vector initialization with curly braces syntax. More... | |
IVec4 (int init) | |
Vector initialization to single constant value. | |
IVec4 (const IVec4 &rhs) | |
Vector initialization from another vector. | |
template<class Arg1T > | |
IVec4 (const Arg1T &arg1) | |
Vector initialization from GPU-side value. More... | |
template<class Arg1T , class Arg2T > | |
IVec4 (const Arg1T &arg1, const Arg2T &arg2) | |
Vector initialization from two GPU-side values. More... | |
template<class Arg1T , class Arg2T , class Arg3T > | |
IVec4 (const Arg1T &arg1, const Arg2T &arg2, const Arg3T &arg3) | |
Vector initialization from three GPU-side values. More... | |
template<class Arg1T , class Arg2T , class Arg3T , class Arg4T > | |
IVec4 (const Arg1T &arg1, const Arg2T &arg2, const Arg3T &arg3, const Arg4T &arg4) | |
Vector initialization from four GPU-side values. More... | |
IVec4 | operator+ (const IVec4 &rhs) const |
Addition operation on vector components. | |
IVec4 | operator- (const IVec4 &rhs) const |
Subtraction operation on vector components. | |
IVec4 | operator* (const IVec4 &rhs) const |
Multiplication operation on vector components. | |
IVec4 | operator/ (const IVec4 &rhs) const |
Division operation on vector components. | |
IVec4 | operator% (const IVec4 &rhs) const |
Remainder operation on vector components. | |
IVec4 | operator<< (const IVec4 &rhs) const |
Shift to the left operation on vector components. | |
IVec4 | operator>> (const IVec4 &rhs) const |
Shift to the right operation on vector components. | |
IVec4 | operator| (const IVec4 &rhs) const |
Bitwise or operation on vector components. | |
IVec4 | operator^ (const IVec4 &rhs) const |
Bitwise xor operation on vector components. | |
IVec4 | operator & (const IVec4 &rhs) const |
Bitwise and operation on vector components. | |
IVec4 | operator- () const |
Arithmetic negation operation on vector components. | |
IVec4 | operator~ () const |
Bitwise negation operation on vector components. | |
BVec4 | operator== (const IVec4 &rhs) const |
Comparison (equal) operation on vector components. | |
BVec4 | operator!= (const IVec4 &rhs) const |
Comparison (not equal) operation on vector components. | |
BVec4 | operator> (const IVec4 &rhs) const |
Comparison (greater) operation on vector components. | |
BVec4 | operator>= (const IVec4 &rhs) const |
Comparison (greater or equal) operation on vector components. | |
BVec4 | operator< (const IVec4 &rhs) const |
Comparison (less) operation on vector components. | |
BVec4 | operator<= (const IVec4 &rhs) const |
Comparison (less or equal) operation on vector components. | |
auto | operator[] (ESwizzle sw) const |
Component selection operation. | |
Static Public Attributes | |
static const size_t | item_count = 4 |
Number of elements in this vector. | |
Shader (GPU-side) data type for 4-element 32-bit integer vectors.
Use this type inside shader code as a counterpart of CPU-side float[4] 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.
Constant initialization can be performed with initializer list syntax, i.e.:
Note that from the GPU point of view, CPU-side variables are constants and can be used in initializers.
Initialization with GPU-side values (variable or constant) is performed using the constructor syntax, e.g.:
For mutable variable type, see VIVec4. Beware that mutable variables can degrade performance on GPU, therefore IVec4 is preferable, unless you really want a mutable variable.
vpp::IVec4::IVec4 | ( | const std::initializer_list< int > & | init | ) |
Vector initialization with curly braces syntax.
For example:
|
explicit |
Vector initialization from GPU-side value.
The value can be a scalar, or another vector.
vpp::IVec4::IVec4 | ( | const Arg1T & | arg1, |
const Arg2T & | arg2 | ||
) |
Vector initialization from two GPU-side values.
These values can be scalars or vectors. They will be concatenated to form the resulting vector.
vpp::IVec4::IVec4 | ( | const Arg1T & | arg1, |
const Arg2T & | arg2, | ||
const Arg3T & | arg3 | ||
) |
Vector initialization from three GPU-side values.
These values can be scalars or vectors. They will be concatenated to form the resulting vector.
vpp::IVec4::IVec4 | ( | const Arg1T & | arg1, |
const Arg2T & | arg2, | ||
const Arg3T & | arg3, | ||
const Arg4T & | arg4 | ||
) |
Vector initialization from four GPU-side values.
These values can be scalars or vectors. They will be concatenated to form the resulting vector.