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

Tessellation control shader interface. More...

#include <vppLangIntInOut.hpp>

Inheritance diagram for vpp::TessControlShader:
vpp::Shader

Public Attributes

gl_perVertex inVertices []
 In: vertices of the source patch.
 
Int inInvocationId
 In: index of currently computed output patch vertex.
 
Int inPatchVertices
 In: number of vertices in current input patch (inVertices array size).
 
Int inPrimitiveId
 In: index of the input patch in currently rendered set of patches.
 
gl_perVertex outVertices []
 Out: vertices of the resulting patch.
 
Float outTessLevelOuter [4]
 Out: computed outer tessellation levels.
 
Float outTessLevelInner [2]
 Out: computed inner tessellation levels.
 

Additional Inherited Members

- Public Member Functions inherited from vpp::Shader
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...
 

Detailed Description

Tessellation control shader interface.

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

Tessellation control shader is a preprocessing shader in tessellation. It converts an input patch of M control points to an output patch consisting of N control points. One possible application is to decompose a NURBS patch to an array of simpler Bezier patches (represented as single output patch).

The tessellation control shader routine is invoked exactly N times for each processed patch, that is, for each computed vertex of the resulting patch. However, Vulkan requires the output vertex data to be declared as an array. You must index the outVertices array by value read from inInvocationId variable and write single computed vertex. On the other hand, you have read access to all vertices of the source patch simultaneously, in each invocation.

All inter-shader variables declared between the vertex shader and the tessellation control shader are also presented as arrays. You can access these variables separately for each input patch vertex, by indexing these arrays.

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


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