![]() |
VPP
0.7
A high-level modern C++ API for Vulkan
|
Fragment shader interface. More...
#include <vppLangIntInOut.hpp>
Public Member Functions | |
void | Kill () |
Terminates shader execution without writing the fragment. | |
void | EarlyTest () |
Enables early tests (depth, stencil, etc.) for this shader. | |
template<class ValueT > | |
void | DebugProbe (const ValueT &value) |
Creates a debug probe image and writes given value. More... | |
![]() | |
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 | |
Vec4 | inFragCoord |
In: current pixel coordinates in the frame buffer. | |
Bool | inFrontFacing |
In: true if current pixel belongs to a front-facing primitive. | |
Int | inLayer |
In: the layer index of the primitive that the fragment invocation belongs to. | |
Int | inSampleId |
In: zero-based index of the sample the invocation corresponds to. | |
Vec2 | inSamplePosition |
In: zero-based index of the sample the invocation corresponds to. | |
Vec2 | inPointCoord |
In: the sub-pixel position of the sample being shaded. | |
Bool | inHelperInvocation |
In: whether the current invocation is a helper invocation. | |
Int | inPrimitiveId |
In: the index of the current primitive. | |
Int | inViewportIndex |
In: the index of the viewport. | |
Float | outFragDepth |
Out: the new depth value for all samples covered by the fragment. | |
Fragment shader interface.
An object of this class is provided to user-defined fragment shader. It is usable only in GPU-side fragment 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.
void vpp::FragmentShader::DebugProbe | ( | const ValueT & | value | ) |
Creates a debug probe image and writes given value.
This method is similar to generic Shader::DebugProbe version, but is applicable only for fragment shaders and it automatically determines coordinates and size of the image. Use for convenience only. You can also use the generic version in fragment shaders.