LLGL 0.05 Beta
Loading...
Searching...
No Matches
LLGL::FragmentAttribute Struct Reference

Fragment output attribute structure. More...

#include <FragmentAttribute.h>

Public Member Functions

 FragmentAttribute ()=default
 FragmentAttribute (StringLiteral name, std::uint32_t location=0)
 Constructor for minimal fragment attribute information.
 FragmentAttribute (StringLiteral name, const Format format, std::uint32_t location=0, const SystemValue systemValue=SystemValue::Undefined)
 Constructor to initialize all members.

Public Attributes

StringLiteral name
 Fragment attribute name (for GLSL) or semantic name (for HLSL).
Format format = Format::RGBA32Float
 Fragment attribute format. By default Format::RGBA32Float.
std::uint32_t location = 0
 Fragment attribute location.
SystemValue systemValue = SystemValue::Undefined
 Specifies the system value type for this fragment attribute or SystemValue::Undefined if this attribute is not a system value. By default SystemValue::Undefined.

Detailed Description

Fragment output attribute structure.

Remarks
This is primarily used for shader reflection and to bind fragment output attributes for OpenGL 2.0.
See also
FragmentShaderAttributes::outputAttribs
VertexAttribute

Constructor & Destructor Documentation

◆ FragmentAttribute() [1/3]

LLGL::FragmentAttribute::FragmentAttribute ( )
default

◆ FragmentAttribute() [2/3]

LLGL::FragmentAttribute::FragmentAttribute ( StringLiteral name,
std::uint32_t location = 0 )
inline

Constructor for minimal fragment attribute information.

◆ FragmentAttribute() [3/3]

LLGL::FragmentAttribute::FragmentAttribute ( StringLiteral name,
const Format format,
std::uint32_t location = 0,
const SystemValue systemValue = SystemValue::Undefined )
inline

Constructor to initialize all members.

Member Data Documentation

◆ format

Format LLGL::FragmentAttribute::format = Format::RGBA32Float

Fragment attribute format. By default Format::RGBA32Float.

◆ location

std::uint32_t LLGL::FragmentAttribute::location = 0

Fragment attribute location.

Remarks
Here is an example of two fragment output attributes in GLSL with location 0 and 1:
layout(location = 0) out vec4 myBaseColor;
layout(location = 1) out vec4 mySecondaryColor;
std::uint32_t location
Fragment attribute location.
Definition FragmentAttribute.h:91
Here is an example of two fragment output attributes in HLSL with location 0 and 1:
struct PixelShaderOutput
{
float4 myBaseColor : SV_Target0;
float4 mySecondaryColor : SV_Target1;
};
Here is an example of two fragment output attributes in Metal with location 0 and 1:
struct FragmentFunctionOutput
{
float4 myBaseColor [[color(0)]];
float4 mySecondaryColor [[color(1)]];
};

◆ name

StringLiteral LLGL::FragmentAttribute::name

Fragment attribute name (for GLSL) or semantic name (for HLSL).

Remarks
Semantic names in HLSL may contain an index as suffix. However, this name must not contain an index suffix, because it will be added automatically.

◆ systemValue

SystemValue LLGL::FragmentAttribute::systemValue = SystemValue::Undefined

Specifies the system value type for this fragment attribute or SystemValue::Undefined if this attribute is not a system value. By default SystemValue::Undefined.

Remarks
This can only be one the following values:

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