// // Copyright 2002 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. //
namespace sh
{ class AtomicCounterFunctionHLSL; class ImageFunctionHLSL; class ResourcesHLSL; class StructureHLSL; class TextureFunctionHLSL; class TSymbolTable; class TVariable; class UnfoldShortCircuit;
using ReferencedVariables = std::map<int, const TVariable *>;
class OutputHLSL : public TIntermTraverser
{ public:
OutputHLSL(sh::GLenum shaderType,
ShShaderSpec shaderSpec, int shaderVersion, const TExtensionBehavior &extensionBehavior, constchar *sourcePath,
ShShaderOutput outputType, int numRenderTargets, int maxDualSourceDrawBuffers, const std::vector<ShaderVariable> &uniforms, const ShCompileOptions &compileOptions,
sh::WorkGroupSize workGroupSize,
TSymbolTable *symbolTable,
PerformanceDiagnostics *perfDiagnostics, const std::map<int, const TInterfaceBlock *> &uniformBlockOptimizedMap, const std::vector<InterfaceBlock> &shaderStorageBlocks, bool isEarlyFragmentTestsSpecified);
// Emit one of three strings depending on traverse phase. Called with literal strings so using // const char* instead of TString. void outputTriplet(TInfoSinkBase &out,
Visit visit, constchar *preString, constchar *inString, constchar *postString); void outputLineDirective(TInfoSinkBase &out, int line); void writeParameter(const TVariable *param, TInfoSinkBase &out);
// Returns true if it found a 'same symbol' initializer (initializer that references the // variable it's initting) bool writeSameSymbolInitializer(TInfoSinkBase &out,
TIntermSymbol *symbolNode,
TIntermTyped *expression); // Returns true if variable initializer could be written using literal {} notation. bool writeConstantInitialization(TInfoSinkBase &out,
TIntermSymbol *symbolNode,
TIntermTyped *expression);
// A stack is useful when we want to traverse in the header, or in helper functions, but not // always write to the body. Instead use an InfoSink stack to keep our current state intact. // TODO (jmadill): Just passing an InfoSink in function parameters would be simpler.
std::stack<TInfoSinkBase *> mInfoSinkStack;
ReferencedVariables mReferencedUniforms;
// Indexed by block id, not instance id.
ReferencedInterfaceBlocks mReferencedUniformBlocks;
// A list of all equality comparison functions. It's important to preserve the order at // which we add the functions, since nested structures call each other recursively, and // structure equality functions may need to call array equality functions and vice versa. // The ownership of the pointers is maintained by the type-specific arrays.
std::vector<HelperFunction *> mEqualityFunctions;
// The construct-into functions are functions that fill an N-element array passed as an out // parameter with the other N parameters of the function. This is used to work around that // arrays can't be return values in HLSL.
std::vector<ArrayHelperFunction> mArrayConstructIntoFunctions;
sh::WorkGroupSize mWorkGroupSize;
PerformanceDiagnostics *mPerfDiagnostics;
private:
TString generateStructMapping(const std::vector<MappedStruct> &std140Structs) const;
ImmutableString samplerNamePrefixFromStruct(TIntermTyped *node); bool ancestorEvaluatesToSamplerInStruct(); // We need to do struct mapping when pass the struct to a function or copy the struct via // assignment. bool needStructMapping(TIntermTyped *node);
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.