#include <GrGLSLVarying.h>
Definition at line 91 of file GrGLSLVarying.h.
◆ VarArray
◆ VaryingList
◆ Interpolation
Enumerator |
---|
kInterpolated | |
kCanBeFlat | |
kMustBeFlat | |
Definition at line 112 of file GrGLSLVarying.h.
112 {
113 kInterpolated,
114 kCanBeFlat,
115 kMustBeFlat
116 };
◆ GrGLSLVaryingHandler()
Definition at line 93 of file GrGLSLVarying.h.
100 , fDefaultInterpolationModifier(nullptr) {}
static const int kVaryingsPerBlock
GrGLSLProgramBuilder * fProgramBuilder
◆ ~GrGLSLVaryingHandler()
virtual GrGLSLVaryingHandler::~GrGLSLVaryingHandler |
( |
| ) |
|
|
inlinevirtual |
◆ addPassThroughAttribute()
The GP can use these calls to pass a vertex shader variable directly to 'output' in the fragment shader. Though this adds code to vertex and fragment stages, 'output' is expected to be defined in the fragment shader before the call is made. TODO it might be nicer behavior to have a flag to declare output inside these calls
Definition at line 17 of file GrGLSLVarying.cpp.
19 {
25}
GrGLSLFragmentShaderBuilder fFS
void codeAppendf(const char format[],...) SK_PRINTF_LIKE(2
void addVarying(const char *name, GrGLSLVarying *varying, Interpolation=Interpolation::kInterpolated)
const char * c_str() const
◆ addVarying()
addVarying allows fine grained control for setting up varyings between stages. Calling this function will make sure all necessary decls are setup for the client. The client however is responsible for setting up all shader code (e.g "vOut = vIn;") If you just need to take an attribute and pass it through to an output value in a fragment shader, use addPassThroughAttribute. TODO convert most uses of addVarying to addPassThroughAttribute
Definition at line 43 of file GrGLSLVarying.cpp.
44 {
47
50 v.fType = varying->fType;
55 varying->fVsOut = v.fVsOut.c_str();
57 }
59 varying->fFsIn = v.fVsOut.c_str();
61 }
62}
static bool use_flat_interpolation(GrGLSLVaryingHandler::Interpolation interpolation, const GrShaderCaps &shaderCaps)
static constexpr bool SkSLTypeIsFloatType(SkSLType type)
SkString nameVariable(char prefix, const char *name, bool mangle=true)
const GrShaderCaps * shaderCaps() const
bool isInVertexShader() const
bool isInFragmentShader() const
DEF_SWITCHES_START aot vmservice shared library name
◆ emitAttributes()
Definition at line 64 of file GrGLSLVarying.cpp.
64 {
66 this->addAttribute(attr.asShaderVar());
67 }
69 this->addAttribute(attr.asShaderVar());
70 }
71}
const AttributeSet & vertexAttributes() const
const AttributeSet & instanceAttributes() const
◆ finalize()
void GrGLSLVaryingHandler::finalize |
( |
| ) |
|
Definition at line 97 of file GrGLSLVarying.cpp.
97 {
99 const char* modifier = v.fIsFlat ? "flat" : fDefaultInterpolationModifier;
103 }
105 const char* fsIn = v.fVsOut.
c_str();
108 }
109 }
111}
virtual void onFinalize()=0
T & emplace_back(Args &&... args)
◆ getFragDecls()
void GrGLSLVaryingHandler::getFragDecls |
( |
SkString * |
inputDecls, |
|
|
SkString * |
outputDecls |
|
) |
| const |
Definition at line 125 of file GrGLSLVarying.cpp.
125 {
126
131}
SkSL::GLSLGeneration fGLSLGeneration
◆ getVertexDecls()
void GrGLSLVaryingHandler::getVertexDecls |
( |
SkString * |
inputDecls, |
|
|
SkString * |
outputDecls |
|
) |
| const |
◆ onFinalize()
virtual void GrGLSLVaryingHandler::onFinalize |
( |
| ) |
|
|
privatepure virtual |
◆ setNoPerspective()
void GrGLSLVaryingHandler::setNoPerspective |
( |
| ) |
|
Notifies the varying handler that this shader will never emit geometry in perspective and therefore does not require perspective-correct interpolation. When supported, this allows varyings to use the "noperspective" keyword, which means the GPU can use cheaper math for interpolation.
Definition at line 84 of file GrGLSLVarying.cpp.
84 {
87 return;
88 }
93 }
94 fDefaultInterpolationModifier = "noperspective";
95}
bool addFeature(uint32_t featureBit, const char *extensionName)
@ kNoPerspectiveInterpolation_GLSLPrivateFeature
const char * noperspectiveInterpolationExtensionString() const
bool fNoPerspectiveInterpolationSupport
◆ GrGLSLProgramBuilder
◆ fFragInputs
VarArray GrGLSLVaryingHandler::fFragInputs |
|
protected |
◆ fFragOutputs
VarArray GrGLSLVaryingHandler::fFragOutputs |
|
protected |
◆ fProgramBuilder
◆ fVaryings
◆ fVertexInputs
VarArray GrGLSLVaryingHandler::fVertexInputs |
|
protected |
◆ fVertexOutputs
VarArray GrGLSLVaryingHandler::fVertexOutputs |
|
protected |
The documentation for this class was generated from the following files: