#include "compiler/translator/tree_ops/spirv/EmulateFramebufferFetch.h"
#include "common/bitset_utils.h"
#include "compiler/translator/Compiler.h"
#include "compiler/translator/ImmutableStringBuilder.h"
#include "compiler/translator/SymbolTable.h"
#include "compiler/translator/tree_util/BuiltIn.h"
#include "compiler/translator/tree_util/IntermNode_util.h"
#include "compiler/translator/tree_util/IntermTraverse.h"
#include "compiler/translator/tree_util/ReplaceVariable.h"
#include "compiler/translator/tree_util/RunAtTheBeginningOfShader.h"
#include "compiler/translator/util.h"
namespace sh
{
namespace
{
InputAttachmentIndexUsage;
class InputAttachmentUsageTraverser : public TIntermTraverser
{ … };
void InputAttachmentUsageTraverser::setInputAttachmentIndex(uint32_t index, const TType *type)
{ … }
bool InputAttachmentUsageTraverser::visitDeclaration(Visit visit, TIntermDeclaration *node)
{ … }
bool InputAttachmentUsageTraverser::visitBinary(Visit visit, TIntermBinary *node)
{ … }
void InputAttachmentUsageTraverser::visitSymbol(TIntermSymbol *symbol)
{ … }
ImmutableString GetInputAttachmentName(size_t index)
{ … }
TBasicType GetBasicTypeForSubpassInput(TBasicType inputType)
{ … }
void DeclareInputAttachmentVariable(TSymbolTable *symbolTable,
const TType &outputType,
size_t index,
InputAttachmentMap *inputAttachmentMapOut,
TIntermSequence *declarationsOut)
{ … }
const TVariable *DeclareLastFragDataGlobalVariable(TCompiler *compiler,
TIntermBlock *root,
const TVector<const TType *> &attachmentTypes,
TIntermSequence *declarationsOut)
{ … }
[[nodiscard]] bool DeclareVariables(TCompiler *compiler,
TIntermBlock *root,
InputAttachmentIndexUsage indexUsage,
bool usesLastFragData,
const TVector<const TType *> &attachmentTypes,
InputAttachmentMap *inputAttachmentMapOut,
const TVariable **lastFragDataOut)
{ … }
TIntermTyped *CreateSubpassLoadFuncCall(TSymbolTable *symbolTable, const TVariable *inputVariable)
{ … }
void GatherInoutVariables(TIntermBlock *root, TVector<const TVariable *> *inoutVariablesOut)
{ … }
void InitializeFromInputAttachment(TSymbolTable *symbolTable,
TIntermBlock *block,
const TVariable *inputVariable,
const TVariable *assignVariable,
uint32_t assignVariableArrayIndex)
{ … }
[[nodiscard]] bool InitializeFromInputAttachments(TCompiler *compiler,
TIntermBlock *root,
const InputAttachmentMap &inputAttachmentMap,
const TVector<const TVariable *> &inoutVariables,
const TVariable *lastFragData)
{ … }
[[nodiscard]] bool ReplaceVariables(TCompiler *compiler,
TIntermBlock *root,
const InputAttachmentMap &inputAttachmentMap,
const TVariable *lastFragData)
{ … }
}
[[nodiscard]] bool EmulateFramebufferFetch(TCompiler *compiler,
TIntermBlock *root,
InputAttachmentMap *inputAttachmentMapOut)
{ … }
}