// // Copyright 2015 The ANGLE Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // VaryingPacking: // Class which describes a mapping from varyings to registers, according // to the spec, or using custom packing algorithms. We also keep a register // allocation list for the D3D renderer. //
namespace gl
{ class InfoLog; class ProgramExecutable; struct Caps; struct LinkingVariables; struct ProgramVaryingRef;
using ProgramMergedVaryings = std::vector<ProgramVaryingRef>;
// A varying can have different names between stages if matched by the location layout qualifier. // Additionally, same name varyings could still be of two identical struct types with different // names. This struct contains information on the varying in one of the two stages. PackedVarying // will thus contain two copies of this along with common information, such as interpolation or // field index. struct VaryingInShaderRef : angle::NonCopyable
{
VaryingInShaderRef(ShaderType stageIn, const sh::ShaderVariable *varyingIn);
VaryingInShaderRef(VaryingInShaderRef &&other);
~VaryingInShaderRef();
// Struct name
std::string parentStructName;
std::string parentStructMappedName;
};
struct PackedVarying : angle::NonCopyable
{ // Throughout this file, the "front" stage refers to the stage that outputs the varying, and the // "back" stage refers to the stage that takes the varying as input. Note that this struct // contains linked varyings, which means both front and back stage varyings are valid, except // for the following which may have only one valid stage. // // - transform-feedback-captured varyings // - builtins // - separable program stages, //
PackedVarying(VaryingInShaderRef &&frontVaryingIn,
VaryingInShaderRef &&backVaryingIn,
sh::InterpolationType interpolationIn);
PackedVarying(VaryingInShaderRef &&frontVaryingIn,
VaryingInShaderRef &&backVaryingIn,
sh::InterpolationType interpolationIn,
GLuint arrayIndexIn,
GLuint fieldIndexIn,
GLuint secondaryFieldIndexIn);
PackedVarying(PackedVarying &&other);
~PackedVarying();
// Return either front or back varying, whichever is available. Only used when the name of the // varying is not important, but only the type is interesting. const sh::ShaderVariable &varying() const
{ return frontVarying.varying ? *frontVarying.varying : *backVarying.varying;
}
// Transform feedback varyings can be only referenced in the VS. bool vertexOnly() const
{ return frontVarying.stage == ShaderType::Vertex && backVarying.varying == nullptr;
}
// Special handling for GS/TS array inputs. unsignedint getBasicTypeElementCount() const;
// Cached so we can store sh::ShaderVariable to point to varying fields.
sh::InterpolationType interpolation;
// Used by varyings that are captured with transform feedback, xor arrays of shader I/O blocks, // distinguished by isTransformFeedback;
GLuint arrayIndex; bool isTransformFeedback;
// Field index in the struct. In Vulkan, this is used to assign a // struct-typed varying location to the location of its first field.
GLuint fieldIndex;
GLuint secondaryFieldIndex;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.