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

Geometry shader interface. More...

#include <vppLangIntInOut.hpp>

Inheritance diagram for vpp::GeometryShader:
vpp::Shader

Public Member Functions

void EmitVertex ()
 Emits one vertex for currently processed primitive and resets the outVertex and output variables to receive another vertex data. More...
 
void EndPrimitive ()
 Finishes the current primitive and starts a new one. No vertex is emitted.
 
- Public Member Functions inherited from vpp::Shader
const Devicedevice () const
 Retrieves the device the shader is currently compiled for.
 
void DebugCodeDump ()
 Enables diagnostic dump of intermediate SPIR-V code for this shader. More...
 
template<class ValueT >
void DebugProbe (const ValueT &value, const IVec2 &coords, const VkExtent3D &extent)
 Adds a debug probe to dump an expression value during shader execution. More...
 

Public Attributes

gl_perVertex inVertices []
 In: vertices of currently processed primitive.
 
Int inInvocationId
 In: index of current geometry shader invocation in case when multiple geometry shader invocations are enabled. More...
 
Int inPrimitiveId
 In: primitive index in current set of primitives.
 
gl_perVertex outVertex
 Out: computed vertex data.
 
Int outLayer
 Out: allows to direct currently processed primitive to specific layer of multi-layer output attachment.
 
Int outPrimitiveId
 Out: allows to pass the primitive id to the fragment shader.
 
Int outViewportIndex
 Out: allows to direct currently processed primitive to specific viewport. More...
 

Detailed Description

Geometry shader interface.

An object of this class is provided to user-defined geometry shader. It is usable only in GPU-side geometry shader code. Its main purpose is to give access to built-in shader variables and some special operations.

By convention, member names starting with in denote read-only variables, while the out prefix mean that the variable may be only written to.

Member Function Documentation

◆ EmitVertex()

void vpp::GeometryShader::EmitVertex ( )

Emits one vertex for currently processed primitive and resets the outVertex and output variables to receive another vertex data.

This funtion emits the current values of all output variables to the current output primitive. After execution, the values of all output variables are undefined.

Member Data Documentation

◆ inInvocationId

Int vpp::GeometryShader::inInvocationId

In: index of current geometry shader invocation in case when multiple geometry shader invocations are enabled.

Geometry shader can be invoked multiple times per primitive. This mode is enabled by calling the geometryShader::setInvocations() method and specifying the number of invocations.

◆ outViewportIndex

Int vpp::GeometryShader::outViewportIndex

Out: allows to direct currently processed primitive to specific viewport.

Multiple viewports can be specified for rasterization. They are all generating pixels for the same image, but may differ in viewport transformation and scissors.


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