VPP  0.8
A high-level modern C++ API for Vulkan
vpp::WInt Class Reference

Shader (GPU-side) data type for workgroup variables of 32-bit signed integer type. More...

#include <vppLangScalarTypes.hpp>

Detailed Description

Shader (GPU-side) data type for workgroup variables of 32-bit signed integer type.

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

This is a l-value type. You can assign to it at will.

These values are shared between threads within single workgroup. Workgroups are also called thread groups in some proprietary APIs. Usually a single workgroup maps to so-called warp (32 threads) or wavefront (64 threads) on the GPU - depending on particular GPU vendor. It is not necessary though, as the workgroup size is configurable.

Shared variables consume space inside the shared memory block. On current devices, it is typically 32 to 48 kB. No general purpose registers are allocated. This type of variable usually does not impose performance penalties, as long as all variables fit inside the block.

The lifetime of all shared variables spans from the declaration to the end of current shader execution. They are like static variables in C++ on that matter. This is different from ordinary mutable variables.

Shared variables are also useful as base for atomic variables. In VPP, atomic operations are performed by taking a pointer from the location (a shared variable, uniform buffer location or image texel) and executing the operation on a pointer. For that end, shared variables have additional operator & providing the pointer. See Pointer class for more information.

The WInt type has also a local counterpart called VInt. Apart from details mentioned above, the interface of both classes are the same.


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